diff options
Diffstat (limited to 'graphics/glide3')
-rw-r--r-- | graphics/glide3/Makefile | 16 | ||||
-rw-r--r-- | graphics/glide3/files/patch-h5-glide3-src-glfb_c | 73 | ||||
-rw-r--r-- | graphics/glide3/files/patch-swlibs-fxmisc-fxos_c | 55 |
3 files changed, 138 insertions, 6 deletions
diff --git a/graphics/glide3/Makefile b/graphics/glide3/Makefile index 2b732e309994..4b0ee84e1899 100644 --- a/graphics/glide3/Makefile +++ b/graphics/glide3/Makefile @@ -16,15 +16,14 @@ DISTNAME= Glide3-FreeBSD-${PORTVERSION} MAINTAINER= ports@FreeBSD.org COMMENT= Library to support 3dfx Voodoo3/4/5/Banshee with the DRI -USE_BZIP2= yes -WRKSRC= ${WRKDIR}/Glide3 -USE_X_PREFIX= yes +USE_BZIP2= yes +WRKSRC= ${WRKDIR}/Glide3 USE_LDCONFIG= yes USE_AUTOTOOLS= automake:14 autoconf:253 libtool:15 -AUTOMAKE_ARGS= -a -USE_GMAKE= yes +AUTOMAKE_ARGS= -a +USE_GMAKE= yes USE_BZIP2= yes -MAKEFILE= makefile.autoconf +MAKEFILE= makefile.autoconf # This Glide3 does not work on alpha, and I don't expect it to work right # on other non-i386 without patches. Further development is going on in @@ -48,5 +47,10 @@ PKGNAMESUFFIX= -v5 pre-configure: @cd ${WRKSRC} && ${ACLOCAL} -I ${LOCALBASE}/share/aclocal @${REINPLACE_CMD} -e '/^_LT_AC_SHELL_INIT/d' ${WRKSRC}/aclocal.m4 + @${REINPLACE_CMD} -e \ + 's|(float \*)pointers +=|pointers += sizeof(float *) *|' \ + ${WRKSRC}/h5/glide3/src/gaa.c \ + ${WRKSRC}/h5/glide3/src/gdraw.c \ + ${WRKSRC}/h5/glide3/src/distrip.c .include <bsd.port.post.mk> diff --git a/graphics/glide3/files/patch-h5-glide3-src-glfb_c b/graphics/glide3/files/patch-h5-glide3-src-glfb_c new file mode 100644 index 000000000000..9a523dd7e184 --- /dev/null +++ b/graphics/glide3/files/patch-h5-glide3-src-glfb_c @@ -0,0 +1,73 @@ +--- h5/glide3/src/glfb.c.orig Thu Jan 16 01:23:50 2003 ++++ h5/glide3/src/glfb.c Sun Jul 1 03:06:16 2007 +@@ -1308,17 +1308,28 @@ + FXFALSE, + &info)) + { +- FxU32 *src,*dst; ++ union { ++ FxU32 *src; ++ FxU16 *src16; ++ FxU8 *src8; ++ } s; ++ ++ union { ++ FxU32 *dst; ++ FxU16 *dst16; ++ FxU8 *dst8; ++ } d; ++ + FxI32 length,scanline; + FxU32 src_adjust,dst_adjust,tmp; + +- src=(FxU32 *) (((char*)info.lfbPtr)+ ++ s.src=(FxU32 *) (((char*)info.lfbPtr)+ + (src_y*info.strideInBytes) + (src_x * bpp)); +- dst=dst_data; ++ d.dst=dst_data; + scanline=src_height; + + /* set length - alignment fix*/ +- tmp=(((AnyPtr)src)&2); ++ tmp=(((AnyPtr)s.src)&2); + length=src_width * bpp - tmp; + src_adjust=info.strideInBytes - tmp; + dst_adjust=dst_stride - tmp; +@@ -1329,8 +1340,8 @@ + while(src_height--) + { + /* adjust starting alignment */ +- if (((AnyPtr)src)&3) +- *((FxU16 *)dst)++=*((FxU16 *)src)++; ++ if (((AnyPtr)s.src)&3) ++ *d.dst16++ = *s.src16++; + + /* read in dwords of pixels */ + if(length) +@@ -1341,16 +1352,21 @@ + /* copies aligned dwords */ + do + { +- *((FxU32 *)(((AnyPtr)dst) + byte_index))=*((FxU32 *)(((AnyPtr)src) + byte_index)); ++ FxU32 *dst = (FxU32 *)(((AnyPtr)dst) + byte_index); ++ FxU32 *src = (FxU32 *)(((AnyPtr)src) + byte_index); ++ *dst = *src; + }while((byte_index+=4)<aligned); + + /* handle backend misalignment */ +- if (byte_index!=(FxU32)length) +- *((FxU16 *)(((AnyPtr)dst) + byte_index))=*((FxU16 *)(((AnyPtr)src) + byte_index)); ++ if (byte_index!=(FxU32)length) { ++ FxU16 *dst = (FxU16 *)(((AnyPtr)dst) + byte_index); ++ FxU16 *src = (FxU16 *)(((AnyPtr)src) + byte_index); ++ *dst = *src; ++ } + } + /* adjust for next line */ +- ((FxU8 *)src)+=src_adjust; +- ((FxU8 *)dst)+=dst_adjust; ++ s.src8+=src_adjust; ++ d.dst8+=dst_adjust; + } + rv=FXTRUE; + /* unlock buffer */ diff --git a/graphics/glide3/files/patch-swlibs-fxmisc-fxos_c b/graphics/glide3/files/patch-swlibs-fxmisc-fxos_c new file mode 100644 index 000000000000..a9808cc4ad8a --- /dev/null +++ b/graphics/glide3/files/patch-swlibs-fxmisc-fxos_c @@ -0,0 +1,55 @@ +--- swlibs/fxmisc/fxos.c.orig Wed Jan 15 10:01:58 2003 ++++ swlibs/fxmisc/fxos.c Sun Jul 1 01:56:10 2007 +@@ -43,13 +43,26 @@ + #include <fxos.h> + #endif + #if !macintosh +-/* return current time in seconds (floating point) */ +-float fxTime(void) +-{ + #if defined ( __sparc__ ) || defined ( __DJGPP__ ) + /* times returns 0 in BSD Unix, so we use ftime instead */ + # include <sys/types.h> + # include <sys/timeb.h> ++#elif defined(__FreeBSD__) ++# include <sys/time.h> ++#elif defined ( WIN32 ) || ( __DOS__ ) ++# include <time.h> ++# define times(a) clock() ++# define HZ CLOCKS_PER_SEC ++#else ++# include <sys/types.h> ++# include <sys/times.h> ++# include <sys/param.h> ++#endif ++ ++/* return current time in seconds (floating point) */ ++float fxTime(void) ++{ ++#if defined ( __sparc__ ) || defined ( __DJGPP__ ) + struct timeb tb; + static time_t once; // saves first time value + +@@ -59,22 +72,12 @@ + return (tb.time - once) + tb.millitm * .001; + + #elif defined(__FreeBSD__) +-#include <sys/time.h> + struct timeval t; + struct timezone tz; + gettimeofday(&t, &tz); + return ((float)t.tv_sec + ((float)t.tv_usec)/1000000.0); + #else +-#if defined ( WIN32 ) || ( __DOS__ ) +-# include <time.h> +-# define times(a) clock() +-# define HZ CLOCKS_PER_SEC +-#else +-# include <sys/types.h> +-# include <sys/times.h> +-# include <sys/param.h> + struct tms foo; +-#endif + return times(&foo)/(float)HZ; + #endif + } |