From: havoc Date: Sun, 7 Dec 2003 08:35:48 +0000 (+0000) Subject: removed vid_allowhwgamma variable because vid_activewindow is a better thing to check X-Git-Tag: xonotic-v0.1.0preview~6237 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dd7e9b3ed67aa77575442a2fa7f1f2df947cfe07;p=xonotic%2Fdarkplaces.git removed vid_allowhwgamma variable because vid_activewindow is a better thing to check git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3693 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid.h b/vid.h index df206114..a8086e6a 100644 --- a/vid.h +++ b/vid.h @@ -43,7 +43,6 @@ extern void (*vid_menukeyfn)(int key); extern int vid_hidden; extern int vid_activewindow; -extern int vid_allowhwgamma; extern cvar_t vid_hardwaregammasupported; extern int vid_usinghwgamma; diff --git a/vid_glx.c b/vid_glx.c index 37b6d5aa..4135f726 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -468,24 +468,20 @@ static void HandleEvents(void) // window restored vid_hidden = false; vid_activewindow = false; - vid_allowhwgamma = false; VID_RestoreSystemGamma(); break; case UnmapNotify: // window iconified/rolledup/whatever vid_hidden = true; vid_activewindow = false; - vid_allowhwgamma = false; VID_RestoreSystemGamma(); break; case FocusIn: // window is now the input focus - vid_allowhwgamma = true; vid_activewindow = true; break; case FocusOut: // window is no longer the input focus - vid_allowhwgamma = false; vid_activewindow = false; VID_RestoreSystemGamma(); break; @@ -835,7 +831,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp) usingmouse = false; vid_hidden = false; - vid_allowhwgamma = true; + vid_activewindow = true; GL_Init(); return true; } diff --git a/vid_shared.c b/vid_shared.c index 7589a181..4da77ee4 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -46,8 +46,6 @@ int vid_hidden = true; // LordHavoc: if window is not the active window, don't hog as much CPU time, // let go of the mouse, turn off sound, and restore system gamma ramps... int vid_activewindow = true; -// LordHavoc: whether to allow use of hwgamma (disabled when window is inactive) -int vid_allowhwgamma = false; // we don't know until we try it! cvar_t vid_hardwaregammasupported = {CVAR_READONLY,"vid_hardwaregammasupported","1"}; @@ -605,7 +603,7 @@ void VID_UpdateGamma(qboolean force) return; if (!force - && vid_usinghwgamma == (vid_allowhwgamma && v_hwgamma.integer) + && vid_usinghwgamma == (vid_activewindow && v_hwgamma.integer) && v_gamma.value == cachegamma && v_contrast.value == cachecontrast && v_brightness.value == cachebrightness @@ -621,7 +619,7 @@ void VID_UpdateGamma(qboolean force) && cachewhite[2] == v_color_white_b.value) return; - if (vid_allowhwgamma && v_hwgamma.integer) + if (vid_activewindow && v_hwgamma.integer) { if (!vid_usinghwgamma) { diff --git a/vid_wgl.c b/vid_wgl.c index 64fed039..049258ec 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -468,7 +468,6 @@ void AppActivate(BOOL fActive, BOOL minimize) if (fActive) { - vid_allowhwgamma = true; if (vid_isfullscreen) { if (vid_wassuspended) @@ -485,7 +484,6 @@ void AppActivate(BOOL fActive, BOOL minimize) if (!fActive) { - vid_allowhwgamma = false; vid_usingmouse = false; IN_DeactivateMouse (); IN_ShowMouse ();