mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Move VID_ShiftPalette from all the driver files to vid_common_sw.c
Do the palette gamma correction inside VID_UpdateGamma (fixes sw palette gamma)
This commit is contained in:
parent
c5735d2f19
commit
f1730d7870
13 changed files with 16 additions and 74 deletions
|
@ -147,10 +147,15 @@ VID_UpdateGamma (cvar_t *vid_gamma)
|
||||||
VID_BuildGammaTable (1.0); // hardware gamma wants a linear palette
|
VID_BuildGammaTable (1.0); // hardware gamma wants a linear palette
|
||||||
VID_SetGamma (gamma);
|
VID_SetGamma (gamma);
|
||||||
} else { // We have to hack the palette
|
} else { // We have to hack the palette
|
||||||
|
int i;
|
||||||
|
byte pal[768];
|
||||||
Con_DPrintf ("Setting software gamma to %g\n", gamma);
|
Con_DPrintf ("Setting software gamma to %g\n", gamma);
|
||||||
VID_BuildGammaTable (gamma);
|
VID_BuildGammaTable (gamma);
|
||||||
if (vid.initialized)
|
if (vid.initialized) {
|
||||||
VID_SetPalette (vid_basepal); // update with the new palette
|
for (i = 0; i < sizeof (pal); i++)
|
||||||
|
pal[i] = gammatable[vid_basepal[i]];
|
||||||
|
VID_SetPalette (pal); // update with the new palette
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,9 +152,9 @@ VID_SetPalette (unsigned char *palette)
|
||||||
pal = palette;
|
pal = palette;
|
||||||
table = d_8to24table;
|
table = d_8to24table;
|
||||||
for (i = 0; i < 255; i++) { // used to be i<256, see d_8to24table below
|
for (i = 0; i < 255; i++) { // used to be i<256, see d_8to24table below
|
||||||
r = gammatable[pal[0]];
|
r = pal[0];
|
||||||
g = gammatable[pal[1]];
|
g = pal[1];
|
||||||
b = gammatable[pal[2]];
|
b = pal[2];
|
||||||
pal += 3;
|
pal += 3;
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
|
|
@ -95,3 +95,9 @@ VID_InitBuffers (void)
|
||||||
if (vid.init_caches)
|
if (vid.init_caches)
|
||||||
vid.init_caches (vid.surfcache, cachesize);
|
vid.init_caches (vid.surfcache, cachesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VID_ShiftPalette (unsigned char *p)
|
||||||
|
{
|
||||||
|
VID_SetPalette (p);
|
||||||
|
}
|
||||||
|
|
|
@ -306,19 +306,6 @@ VID_SetPalette (unsigned char *palette)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
VID_ShiftPalette
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *palette)
|
|
||||||
{
|
|
||||||
|
|
||||||
VID_SetPalette (palette);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
VID_Shutdown
|
VID_Shutdown
|
||||||
|
|
|
@ -298,13 +298,6 @@ VID_Shutdown (void)
|
||||||
fbdev_inited = 0;
|
fbdev_inited = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *p)
|
|
||||||
{
|
|
||||||
VID_SetPalette (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
loadpalette (unsigned short *red, unsigned short *green, unsigned short *blue)
|
loadpalette (unsigned short *red, unsigned short *green, unsigned short *blue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1804,13 +1804,6 @@ VID_SetPalette (unsigned char *palette)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *palette)
|
|
||||||
{
|
|
||||||
VID_SetPalette (palette);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
VID_DescribeCurrentMode_f
|
VID_DescribeCurrentMode_f
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -48,11 +48,6 @@ VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *palette)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_Init (unsigned char *palette)
|
VID_Init (unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,12 +86,6 @@ VID_SetPalette (unsigned char *palette)
|
||||||
SDL_SetColors (screen, colors, 0, 256);
|
SDL_SetColors (screen, colors, 0, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *palette)
|
|
||||||
{
|
|
||||||
VID_SetPalette (palette);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_Init (unsigned char *palette)
|
VID_Init (unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
|
|
@ -816,12 +816,6 @@ VID_Init (unsigned char *palette)
|
||||||
vid.initialized = true;
|
vid.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *p)
|
|
||||||
{
|
|
||||||
VID_SetPalette (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetPalette (unsigned char *palette)
|
VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
|
|
@ -694,12 +694,6 @@ VID_ResetFramebuffer_MT ()
|
||||||
malloc (PM (vid.width) * PM (vid.height) * sizeof (*d_pzbuffer));
|
malloc (PM (vid.width) * PM (vid.height) * sizeof (*d_pzbuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *p)
|
|
||||||
{
|
|
||||||
VID_SetPalette (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetPalette (unsigned char *palette)
|
VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
|
|
@ -336,13 +336,6 @@ VID_Shutdown (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *p)
|
|
||||||
{
|
|
||||||
VID_SetPalette (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetPalette (byte * palette)
|
VID_SetPalette (byte * palette)
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,11 +497,6 @@ GL_EndRendering (void)
|
||||||
Sbar_Changed ();
|
Sbar_Changed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *palette)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetDefaultMode (void)
|
VID_SetDefaultMode (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -561,13 +561,6 @@ VID_Init_Cvars ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
VID_ShiftPalette (unsigned char *p)
|
|
||||||
{
|
|
||||||
VID_SetPalette (p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_SetPalette (unsigned char *palette)
|
VID_SetPalette (unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue