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
This commit is contained in:
Mark Olsen 2005-12-06 21:52:38 +00:00
parent c41eb9937e
commit df41c9461d

View file

@ -629,7 +629,6 @@ void GLVID_SetPalette (unsigned char *palette)
{ {
qbyte *pal; qbyte *pal;
unsigned r,g,b; unsigned r,g,b;
unsigned v;
unsigned short i; unsigned short i;
unsigned *table; unsigned *table;
unsigned *table2; unsigned *table2;
@ -650,23 +649,12 @@ void GLVID_SetPalette (unsigned char *palette)
b = gammatable[pal[2]]; b = gammatable[pal[2]];
pal += 3; pal += 3;
// v = (255<<24) + (r<<16) + (g<<8) + (b<<0); *table++ = BigLong((r<<24)|(g<<16)|(b<<8)|255);
// v = (255<<0) + (r<<8) + (g<<16) + (b<<24); *table2++ = BigLong((b<<24)|(g<<16)|(r<<8)|255);
#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
} }
#ifdef BIG_ENDIAN
d_8to24bgrtable[255] &= 0xffffff00; // 255 is transparent d_8to24bgrtable[255] &= BigLong(0xffffff00); // 255 is transparent
d_8to24rgbtable[255] &= 0xffffff00; // 255 is transparent d_8to24rgbtable[255] &= BigLong(0xffffff00); // 255 is transparent
#else
d_8to24bgrtable[255] &= 0xffffff; // 255 is transparent
d_8to24rgbtable[255] &= 0xffffff; // 255 is transparent
#endif
} }
/* /*