diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2007-07-02 06:15:22 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2007-07-02 06:15:22 +0000 |
commit | 93f2c08fc245fb7f0ff3c0bd1a9634855706dd93 (patch) | |
tree | 57a00c6294dea330268cf6aec6cdb6836f208425 /graphics/glide3/files | |
parent | 758d9ded1124764532109ce82e91d81d0bdf6e5c (diff) |
Notes
Diffstat (limited to 'graphics/glide3/files')
-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 |
2 files changed, 128 insertions, 0 deletions
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 + } |