From: havoc Date: Mon, 12 Jun 2006 21:25:29 +0000 (+0000) Subject: modified VID_RestoreSystemGamma to force a gamma update on next frame (if it turned... X-Git-Tag: xonotic-v0.1.0preview~3904 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9641e27f04d102c4049fbbb1510af7e7f75a30e2;p=xonotic%2Fdarkplaces.git modified VID_RestoreSystemGamma to force a gamma update on next frame (if it turned off hardware gamma temporarily) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6474 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_shared.c b/vid_shared.c index 2504c286..78a3e0a0 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -708,6 +708,7 @@ void Force_CenterView_f (void) cl.viewangles[PITCH] = 0; } +static int gamma_forcenextframe = false; static float cachegamma, cachebrightness, cachecontrast, cacheblack[3], cachegrey[3], cachewhite[3]; static int cachecolorenable, cachehwgamma; #define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f); @@ -722,7 +723,7 @@ void VID_UpdateGamma(qboolean force, int rampsize) return; if (!force - && !forcenextframe + && !gamma_forcenextframe && !v_psycho.integer && cachehwgamma == (vid_activewindow && v_hwgamma.integer) && v_gamma.value == cachegamma @@ -843,6 +844,8 @@ void VID_RestoreSystemGamma(void) { vid_usinghwgamma = false; Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_systemgammaramps, vid_gammarampsize)); + // force gamma situation to be reexamined next frame + gamma_forcenextframe = true; } }