mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 20:11:44 +00:00
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:
parent
c41eb9937e
commit
df41c9461d
1 changed files with 5 additions and 17 deletions
|
@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue