]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
force a gamma update if v_hwgamma value changes between 1 and 2
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 3 Jul 2006 00:56:42 +0000 (00:56 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 3 Jul 2006 00:56:42 +0000 (00:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6494 d7cf8633-e32d-0410-b094-e92efae38249

vid_shared.c

index 4a41ee01ac9db56bca750d546747f95df32a5b2f..196eefe8c7f8aa4b6e9ddc0b3534b3124c653588 100644 (file)
@@ -724,7 +724,7 @@ void VID_UpdateGamma(qboolean force, int rampsize)
        if (!force
         && !gamma_forcenextframe
         && !v_psycho.integer
-        && cachehwgamma == (vid_activewindow && v_hwgamma.integer)
+        && cachehwgamma == (vid_activewindow ? v_hwgamma.integer : 0)
         && v_gamma.value == cachegamma
         && v_contrast.value == cachecontrast
         && v_brightness.value == cachebrightness
@@ -753,7 +753,7 @@ void VID_UpdateGamma(qboolean force, int rampsize)
        BOUNDCVAR(v_color_white_g, 1, 5);cachewhite[1] = v_color_white_g.value;
        BOUNDCVAR(v_color_white_b, 1, 5);cachewhite[2] = v_color_white_b.value;
        cachecolorenable = v_color_enable.integer;
-       cachehwgamma = vid_activewindow && v_hwgamma.integer;
+       cachehwgamma = vid_activewindow ? v_hwgamma.integer : 0;
 
        gamma_forcenextframe = false;
 
@@ -826,7 +826,7 @@ void VID_UpdateGamma(qboolean force, int rampsize)
                }
 
                // set vid_hardwaregammasupported to true if VID_SetGamma succeeds, OR if vid_hwgamma is >= 2 (forced gamma - ignores driver return value)
-               Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_gammaramps, vid_gammarampsize) || v_hwgamma.integer >= 2);
+               Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_gammaramps, vid_gammarampsize) || cachehwgamma >= 2);
                // if custom gamma ramps failed (Windows stupidity), restore to system gamma
                if(!vid_hardwaregammasupported.integer)
                {