]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
changed cl_ignoremousemove from a qboolean to an int named
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Dec 2007 06:08:32 +0000 (06:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Dec 2007 06:08:32 +0000 (06:08 +0000)
cl_ignoremousemoves which is set to 2 whenever the mouse grab state
changes, the one-frame ignore was not working

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7856 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
client.h
vid_glx.c
vid_sdl.c
vid_shared.c
vid_wgl.c

index a188693629913bdbc870d6c8003dc8aecdc53e67..fe3e67cfa13cfdca21e49083c443adae960e54fb 100644 (file)
@@ -503,7 +503,7 @@ void CL_AdjustAngles (void)
        cl.viewangles[ROLL] = bound(-50, cl.viewangles[ROLL], 50);
 }
 
-qboolean cl_ignoremousemove = false;
+int cl_ignoremousemoves = 2;
 
 /*
 ================
@@ -562,9 +562,9 @@ void CL_Input (void)
        IN_Move ();
 
        // ignore a mouse move if mouse was activated/deactivated this frame
-       if (cl_ignoremousemove)
+       if (cl_ignoremousemoves)
        {
-               cl_ignoremousemove = false;
+               cl_ignoremousemoves--;
                in_mouse_x = 0;
                in_mouse_y = 0;
        }
index 28c047d626cf1f56587b5bb76b51cec245bde1e4..0e3163d1f20310e954b8e8b63d2312f2aef083bb 100644 (file)
--- a/client.h
+++ b/client.h
@@ -1180,7 +1180,7 @@ void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allo
 void CL_UpdateWorld (void);
 void CL_WriteToServer (void);
 void CL_Input (void);
-extern qboolean cl_ignoremousemove;
+extern int cl_ignoremousemoves;
 
 
 float CL_KeyState (kbutton_t *key);
index 7f5fbe051eb359f4c47cc74f90f8e1cc00f32f53..02911ed859ace7808796cf6a4a4c9742ca233d80 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -282,7 +282,7 @@ static void IN_Activate (qboolean grab)
                                XGrabKeyboard(vidx11_display, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
 
                        mouse_x = mouse_y = 0;
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        vid_usingmouse = true;
                }
        }
@@ -302,7 +302,7 @@ static void IN_Activate (qboolean grab)
                        if (win)
                                XUndefineCursor(vidx11_display, win);
 
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        vid_usingmouse = false;
                }
        }
index a9adbde319a634594c08f2a2cef5cd59f29bb543..959105fbcb310e51d0e5df73291916e5a589eccf 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -241,7 +241,7 @@ static void IN_Activate( qboolean grab )
                if (!vid_usingmouse)
                {
                        vid_usingmouse = true;
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        SDL_WM_GrabInput( SDL_GRAB_ON );
                        SDL_ShowCursor( SDL_DISABLE );
                }               
@@ -251,7 +251,7 @@ static void IN_Activate( qboolean grab )
                if (vid_usingmouse)
                {
                        vid_usingmouse = false;
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        SDL_WM_GrabInput( SDL_GRAB_OFF );
                        SDL_ShowCursor( SDL_ENABLE );
                }
index 3ea646e77ccbb7d0de8d74b83235d673ce01c610..02e0fcdd73d8f01f8b6eb65df2411af652b31356 100644 (file)
@@ -1018,6 +1018,7 @@ void VID_Shared_Init(void)
 
 int VID_Mode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer)
 {
+       cl_ignoremousemoves = 2;
        Con_Printf("Video: %s %dx%dx%dx%dhz%s\n", fullscreen ? "fullscreen" : "window", width, height, bpp, refreshrate, stereobuffer ? " stereo" : "");
        if (VID_InitMode(fullscreen, width, height, bpp, refreshrate, stereobuffer))
        {
index 322eb6b9b403d7102016bdc87db2ed0aa928dd07..4f97d31a716e057d63007f1364dd535e36acd8b1 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -1004,7 +1004,7 @@ static void IN_Activate (qboolean grab)
                if (!vid_usingmouse)
                {
                        vid_usingmouse = true;
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        if (dinput && g_pMouse)
                        {
                                IDirectInputDevice_Acquire(g_pMouse);
@@ -1043,7 +1043,7 @@ static void IN_Activate (qboolean grab)
                if (vid_usingmouse)
                {
                        vid_usingmouse = false;
-                       cl_ignoremousemove = true;
+                       cl_ignoremousemoves = 2;
                        if (dinput_acquired)
                        {
                                IDirectInputDevice_Unacquire(g_pMouse);