forked from fte/fteqw
1
0
Fork 0

Trying to fix grey stuff.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3264 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-07-12 17:00:52 +00:00
parent 27fddffedb
commit 9728dde4ac
1 changed files with 27 additions and 11 deletions

View File

@ -31,8 +31,6 @@
// note: cocoa code is separated in vid_cocoa.m because of compilation pbs
static qboolean vid_hwgamma_enabled = false;
cvar_t in_xflip = SCVAR("in_xflip", "0");
static int real_width, real_height;
@ -171,6 +169,22 @@ void GLVID_SetPalette (unsigned char *palette)
pal = palette;
table1 = d_8to24rgbtable;
table2 = d_8to24bgrtable;
if (vid_hardwaregamma.value)
{
for (i=0 ; i<256 ; i++)
{
r = pal[0];
g = pal[1];
b = pal[2];
pal += 3;
*table1++ = LittleLong((255<<24) + (r<<0) + (g<<8) + (b<<16));
*table2++ = LittleLong((255<<24) + (r<<16) + (g<<8) + (b<<0));
}
}
else
{
for (i=0 ; i<256 ; i++)
{
r = gammatable[pal[0]];
@ -181,6 +195,7 @@ void GLVID_SetPalette (unsigned char *palette)
*table1++ = LittleLong((255<<24) + (r<<0) + (g<<8) + (b<<16));
*table2++ = LittleLong((255<<24) + (r<<16) + (g<<8) + (b<<0));
}
}
d_8to24bgrtable[255] &= LittleLong(0xffffff); // 255 is transparent
d_8to24rgbtable[255] &= LittleLong(0xffffff); // 255 is transparent
Con_Printf("Converted\n");
@ -235,6 +250,7 @@ void GLVID_SetDeviceGammaRamp(unsigned short *ramps)
void GLVID_ShiftPalette(unsigned char *p)
{
extern unsigned short ramps[3][256];
if (vid_hardwaregamma.value)
GLVID_SetDeviceGammaRamp(ramps);
}