From d9919887fed8a056fb3437562d649baf8ced2297 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 11 Mar 2006 17:24:10 +0000 Subject: [PATCH] changed VID_Finish to take an allowmousegrab parameter, this avoids mousegrab on the initial loading screen (before +vid_mouse 1 on commandline is executed) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6103 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 4 ++-- vid.h | 2 +- vid_agl.c | 8 ++++---- vid_glx.c | 4 ++-- vid_null.c | 2 +- vid_sdl.c | 4 ++-- vid_wgl.c | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index 5d63a28a..0b7121d7 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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 6943a854..c2b3e1f1 100644 --- 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); diff --git a/vid_agl.c b/vid_agl.c index fb4860b0..604c0a19 100644 --- 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) { diff --git a/vid_glx.c b/vid_glx.c index 84a16a84..c5101041 100644 --- 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; diff --git a/vid_null.c b/vid_null.c index 41be51fa..85d18cda 100644 --- a/vid_null.c +++ b/vid_null.c @@ -51,7 +51,7 @@ void InitSig(void) #endif } -void VID_Finish (void) +void VID_Finish (qboolean allowmousegrab) { } diff --git a/vid_sdl.c b/vid_sdl.c index 6f59ad30..65d4bcb7 100644 --- 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; diff --git a/vid_wgl.c b/vid_wgl.c index 22f46520..a06465d1 100644 --- 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; -- 2.39.2