]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
modified gamma handling, now VID_UpdateGamma is only called from VID_Finish, and...
[xonotic/darkplaces.git] / vid_sdl.c
index c87dbe7454a845502ef786a1ed9db24aa417a531..0df9e422a0b1649ca1d809584d86c9c1bdc23d13 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -473,14 +473,14 @@ void VID_Shutdown (void)
        SDL_QuitSubSystem(SDL_INIT_VIDEO);
 }
 
-int VID_SetGamma (unsigned short *ramps)
+int VID_SetGamma (unsigned short *ramps, int rampsize)
 {
-       return !SDL_SetGammaRamp (ramps, ramps + 256, ramps + 512);
+       return !SDL_SetGammaRamp (ramps, ramps + rampsize, ramps + rampsize*2);
 }
 
-int VID_GetGamma (unsigned short *ramps)
+int VID_GetGamma (unsigned short *ramps, int rampsize)
 {
-       return !SDL_GetGammaRamp( ramps, ramps + 256, ramps + 512);
+       return !SDL_GetGammaRamp (ramps, ramps + rampsize, ramps + rampsize*2);
 }
 
 void VID_Finish (qboolean allowmousegrab)
@@ -511,4 +511,6 @@ void VID_Finish (qboolean allowmousegrab)
                vid_usemouse = false;
 
        IN_Activate(vid_usemouse);
+
+       VID_UpdateGamma(false, 256);
 }