diff --git a/libs/video/targets/vid.c b/libs/video/targets/vid.c index f9922812e..be9c8f176 100644 --- a/libs/video/targets/vid.c +++ b/libs/video/targets/vid.c @@ -147,10 +147,15 @@ VID_UpdateGamma (cvar_t *vid_gamma) VID_BuildGammaTable (1.0); // hardware gamma wants a linear palette VID_SetGamma (gamma); } else { // We have to hack the palette + int i; + byte pal[768]; Con_DPrintf ("Setting software gamma to %g\n", gamma); VID_BuildGammaTable (gamma); - if (vid.initialized) - VID_SetPalette (vid_basepal); // update with the new palette + if (vid.initialized) { + for (i = 0; i < sizeof (pal); i++) + pal[i] = gammatable[vid_basepal[i]]; + VID_SetPalette (pal); // update with the new palette + } } } diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index 7a8d7c7f7..23ace557e 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -152,9 +152,9 @@ VID_SetPalette (unsigned char *palette) pal = palette; table = d_8to24table; for (i = 0; i < 255; i++) { // used to be i<256, see d_8to24table below - r = gammatable[pal[0]]; - g = gammatable[pal[1]]; - b = gammatable[pal[2]]; + r = pal[0]; + g = pal[1]; + b = pal[2]; pal += 3; #ifdef WORDS_BIGENDIAN diff --git a/libs/video/targets/vid_common_sw.c b/libs/video/targets/vid_common_sw.c index 9103be8f4..5d0611967 100644 --- a/libs/video/targets/vid_common_sw.c +++ b/libs/video/targets/vid_common_sw.c @@ -95,3 +95,9 @@ VID_InitBuffers (void) if (vid.init_caches) vid.init_caches (vid.surfcache, cachesize); } + +void +VID_ShiftPalette (unsigned char *p) +{ + VID_SetPalette (p); +} diff --git a/libs/video/targets/vid_dos.c b/libs/video/targets/vid_dos.c index beb1b0983..ad0b6a006 100644 --- a/libs/video/targets/vid_dos.c +++ b/libs/video/targets/vid_dos.c @@ -306,19 +306,6 @@ VID_SetPalette (unsigned char *palette) } -/* -================ -VID_ShiftPalette -================ -*/ -void -VID_ShiftPalette (unsigned char *palette) -{ - - VID_SetPalette (palette); -} - - /* ================ VID_Shutdown diff --git a/libs/video/targets/vid_fbdev.c b/libs/video/targets/vid_fbdev.c index 7cfca037e..58c91feaa 100644 --- a/libs/video/targets/vid_fbdev.c +++ b/libs/video/targets/vid_fbdev.c @@ -298,13 +298,6 @@ VID_Shutdown (void) fbdev_inited = 0; } - -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} - static void loadpalette (unsigned short *red, unsigned short *green, unsigned short *blue) { diff --git a/libs/video/targets/vid_mgl.c b/libs/video/targets/vid_mgl.c index 1159ea2f6..402f013e3 100644 --- a/libs/video/targets/vid_mgl.c +++ b/libs/video/targets/vid_mgl.c @@ -1804,13 +1804,6 @@ VID_SetPalette (unsigned char *palette) } -void -VID_ShiftPalette (unsigned char *palette) -{ - VID_SetPalette (palette); -} - - /* VID_DescribeCurrentMode_f */ diff --git a/libs/video/targets/vid_null.c b/libs/video/targets/vid_null.c index 194c9e8db..58a847239 100644 --- a/libs/video/targets/vid_null.c +++ b/libs/video/targets/vid_null.c @@ -48,11 +48,6 @@ VID_SetPalette (unsigned char *palette) { } -void -VID_ShiftPalette (unsigned char *palette) -{ -} - void VID_Init (unsigned char *palette) { diff --git a/libs/video/targets/vid_sdl.c b/libs/video/targets/vid_sdl.c index 538ae0c4b..195a0d469 100644 --- a/libs/video/targets/vid_sdl.c +++ b/libs/video/targets/vid_sdl.c @@ -86,12 +86,6 @@ VID_SetPalette (unsigned char *palette) SDL_SetColors (screen, colors, 0, 256); } -void -VID_ShiftPalette (unsigned char *palette) -{ - VID_SetPalette (palette); -} - void VID_Init (unsigned char *palette) { diff --git a/libs/video/targets/vid_sunx.c b/libs/video/targets/vid_sunx.c index fb444c2ae..1c635eb51 100644 --- a/libs/video/targets/vid_sunx.c +++ b/libs/video/targets/vid_sunx.c @@ -816,12 +816,6 @@ VID_Init (unsigned char *palette) vid.initialized = true; } -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} - void VID_SetPalette (unsigned char *palette) { diff --git a/libs/video/targets/vid_sunxil.c b/libs/video/targets/vid_sunxil.c index 66bff8545..c3bec3107 100644 --- a/libs/video/targets/vid_sunxil.c +++ b/libs/video/targets/vid_sunxil.c @@ -694,12 +694,6 @@ VID_ResetFramebuffer_MT () malloc (PM (vid.width) * PM (vid.height) * sizeof (*d_pzbuffer)); } -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} - void VID_SetPalette (unsigned char *palette) { diff --git a/libs/video/targets/vid_svgalib.c b/libs/video/targets/vid_svgalib.c index 99e4be19d..3af7a6a8a 100644 --- a/libs/video/targets/vid_svgalib.c +++ b/libs/video/targets/vid_svgalib.c @@ -336,13 +336,6 @@ VID_Shutdown (void) } -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} - - void VID_SetPalette (byte * palette) { diff --git a/libs/video/targets/vid_wgl.c b/libs/video/targets/vid_wgl.c index b7e538702..e0e28739d 100644 --- a/libs/video/targets/vid_wgl.c +++ b/libs/video/targets/vid_wgl.c @@ -497,11 +497,6 @@ GL_EndRendering (void) Sbar_Changed (); } -void -VID_ShiftPalette (unsigned char *palette) -{ -} - void VID_SetDefaultMode (void) { diff --git a/libs/video/targets/vid_x11.c b/libs/video/targets/vid_x11.c index 44f0bdd24..85d4bab99 100644 --- a/libs/video/targets/vid_x11.c +++ b/libs/video/targets/vid_x11.c @@ -561,13 +561,6 @@ VID_Init_Cvars () } -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} - - void VID_SetPalette (unsigned char *palette) {