removed vid_allowhwgamma variable because vid_activewindow is a better thing to check
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Dec 2003 08:35:48 +0000 (08:35 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Dec 2003 08:35:48 +0000 (08:35 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3693 d7cf8633-e32d-0410-b094-e92efae38249

vid.h
vid_glx.c
vid_shared.c
vid_wgl.c

diff --git a/vid.h b/vid.h
index df20611..a8086e6 100644 (file)
--- 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;
 
index 37b6d5a..4135f72 100644 (file)
--- 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;
 }
index 7589a18..4da77ee 100644 (file)
@@ -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)
                {
index 64fed03..049258e 100644 (file)
--- 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 ();