From df41c9461d426a26c5be9689487f8d212f94f04a Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Tue, 6 Dec 2005 21:52:38 +0000 Subject: [PATCH] Let's try not to fuck it up for little endian next time :P git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1684 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidlinuxglx.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index 0e612939f..343eb54a6 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -629,7 +629,6 @@ void GLVID_SetPalette (unsigned char *palette) { qbyte *pal; unsigned r,g,b; - unsigned v; unsigned short i; unsigned *table; unsigned *table2; @@ -650,23 +649,12 @@ void GLVID_SetPalette (unsigned char *palette) b = gammatable[pal[2]]; pal += 3; -// v = (255<<24) + (r<<16) + (g<<8) + (b<<0); -// v = (255<<0) + (r<<8) + (g<<16) + (b<<24); -#ifdef BIG_ENDIAN - *table++ = (r<<24)|(g<<16)|(b<<8)|255; - *table2++ = (b<<24)|(g<<16)|(r<<8)|255; -#else - *table++ = (a<<24)|(b<<16)|(g<<8)|255; - *table2++ = (a<<24)|(r<<16)|(g<<8)|255; -#endif + *table++ = BigLong((r<<24)|(g<<16)|(b<<8)|255); + *table2++ = BigLong((b<<24)|(g<<16)|(r<<8)|255); } -#ifdef BIG_ENDIAN - d_8to24bgrtable[255] &= 0xffffff00; // 255 is transparent - d_8to24rgbtable[255] &= 0xffffff00; // 255 is transparent -#else - d_8to24bgrtable[255] &= 0xffffff; // 255 is transparent - d_8to24rgbtable[255] &= 0xffffff; // 255 is transparent -#endif + + d_8to24bgrtable[255] &= BigLong(0xffffff00); // 255 is transparent + d_8to24rgbtable[255] &= BigLong(0xffffff00); // 255 is transparent } /*