]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix gamma 'flicker' bug caused by gamma_forcenextframe being repeatedly set when...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Jun 2006 06:31:32 +0000 (06:31 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Jun 2006 06:31:32 +0000 (06:31 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6483 d7cf8633-e32d-0410-b094-e92efae38249

vid_shared.c

index 1859166466e64752206aca6c16397a205bff2969..d333d4761827bfc5c467ceb5635d52062f422aad 100644 (file)
@@ -829,12 +829,21 @@ void VID_UpdateGamma(qboolean force, int rampsize)
                // if custom gamma ramps failed (Windows stupidity), restore to system gamma
                if(!vid_hardwaregammasupported.integer)
                {
-                       VID_RestoreSystemGamma();
-                       Cvar_SetValueQuick(&vid_hardwaregammasupported, false);
+                       if (vid_usinghwgamma)
+                       {
+                               vid_usinghwgamma = false;
+                               VID_SetGamma(vid_systemgammaramps, vid_gammarampsize);
+                       }
                }
        }
        else
-               VID_RestoreSystemGamma();
+       {
+               if (vid_usinghwgamma)
+               {
+                       vid_usinghwgamma = false;
+                       VID_SetGamma(vid_systemgammaramps, vid_gammarampsize);
+               }
+       }
 }
 
 void VID_RestoreSystemGamma(void)