changed VID_Finish to take an allowmousegrab parameter, this avoids mousegrab on...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 11 Mar 2006 17:24:10 +0000 (17:24 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 11 Mar 2006 17:24:10 +0000 (17:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6103 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
vid.h
vid_agl.c
vid_glx.c
vid_null.c
vid_sdl.c
vid_wgl.c

index 5d63a28..0b7121d 100644 (file)
@@ -1871,7 +1871,7 @@ void SCR_UpdateLoadingScreen (void)
        GL_LockArrays(0, 0);
        R_Mesh_Finish();
        // refresh
-       VID_Finish();
+       VID_Finish(false);
 }
 
 /*
@@ -1949,7 +1949,7 @@ void SCR_UpdateScreen (void)
        else
                SCR_DrawScreen();
 
-       VID_Finish();
+       VID_Finish(true);
        if (r_timereport_active)
                R_TimeReport("finish");
 }
diff --git a/vid.h b/vid.h
index 6943a85..c2b3e1f 100644 (file)
--- a/vid.h
+++ b/vid.h
@@ -136,7 +136,7 @@ int VID_GetGamma (unsigned short *ramps);
 void VID_UpdateGamma(qboolean force);
 void VID_RestoreSystemGamma(void);
 
-void VID_Finish (void);
+void VID_Finish (qboolean allowmousegrab);
 
 void VID_Restart_f(void);
 
index fb4860b..604c0a1 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -101,14 +101,14 @@ static void IN_Activate( qboolean grab )
        }
 }
 
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
 {
        qboolean vid_usemouse;
        qboolean vid_usevsync;
-       
+
        // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousgrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
                vid_usemouse = true;
        if (!vid_activewindow)
                vid_usemouse = false;
@@ -171,7 +171,7 @@ int VID_GetGamma(unsigned short *ramps)
        CGGammaValue table_blue [GAMMA_TABLE_SIZE];
        CGTableCount actualsize = 0;
        unsigned int i;
-       
+
        // Get the gamma ramps from the system
        if (CGGetDisplayTransferByTable(CGMainDisplayID(), GAMMA_TABLE_SIZE, table_red, table_green, table_blue, &actualsize) != CGDisplayNoErr)
        {
index 84a16a8..c510104 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -559,7 +559,7 @@ void InitSig(void)
        signal(SIGTERM, signal_handler);
 }
 
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
 {
        qboolean vid_usemouse;
 
@@ -573,7 +573,7 @@ void VID_Finish (void)
 
 // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
                vid_usemouse = true;
        if (!vid_activewindow)
                vid_usemouse = false;
index 41be51f..85d18cd 100644 (file)
@@ -51,7 +51,7 @@ void InitSig(void)
 #endif
 }
 
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
 {
 }
 
index 6f59ad3..65d4bcb 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -483,7 +483,7 @@ int VID_GetGamma (unsigned short *ramps)
        return !SDL_GetGammaRamp( ramps, ramps + 256, ramps + 512);
 }
 
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
 {
        Uint8 appstate;
        qboolean vid_usemouse;
@@ -503,7 +503,7 @@ void VID_Finish (void)
                vid_activewindow = true;
 
        vid_usemouse = false;
-       if( vid_mouse.integer && !key_consoleactive && !cls.demoplayback )
+       if( allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback )
                vid_usemouse = true;
        if( vid_isfullscreen )
                vid_usemouse = true;
index 22f4652..a06465d 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -262,7 +262,7 @@ static void IN_StartupMouse (void);
 
 //====================================
 
-void VID_Finish (void)
+void VID_Finish (qboolean allowmousegrab)
 {
        qboolean vid_usemouse;
 
@@ -275,7 +275,7 @@ void VID_Finish (void)
 
 // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
                vid_usemouse = true;
        if (vid_isfullscreen)
                vid_usemouse = true;