From ce7add25216cbc67c3d7bbc17874297e82fa9554 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 23 Jun 2006 06:31:32 +0000 Subject: [PATCH] fix gamma 'flicker' bug caused by gamma_forcenextframe being repeatedly set when gamma fails git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6483 d7cf8633-e32d-0410-b094-e92efae38249 --- vid_shared.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vid_shared.c b/vid_shared.c index 18591664..d333d476 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -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) -- 2.39.2