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.viewangles[ROLL] = bound(-50, cl.viewangles[ROLL], 50);
}
-qboolean cl_ignoremousemove = false;
+int cl_ignoremousemoves = 2;
/*
================
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;
}
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);
XGrabKeyboard(vidx11_display, win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
mouse_x = mouse_y = 0;
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
vid_usingmouse = true;
}
}
if (win)
XUndefineCursor(vidx11_display, win);
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
vid_usingmouse = false;
}
}
if (!vid_usingmouse)
{
vid_usingmouse = true;
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
SDL_WM_GrabInput( SDL_GRAB_ON );
SDL_ShowCursor( SDL_DISABLE );
}
if (vid_usingmouse)
{
vid_usingmouse = false;
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
SDL_WM_GrabInput( SDL_GRAB_OFF );
SDL_ShowCursor( SDL_ENABLE );
}
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))
{
if (!vid_usingmouse)
{
vid_usingmouse = true;
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
if (dinput && g_pMouse)
{
IDirectInputDevice_Acquire(g_pMouse);
if (vid_usingmouse)
{
vid_usingmouse = false;
- cl_ignoremousemove = true;
+ cl_ignoremousemoves = 2;
if (dinput_acquired)
{
IDirectInputDevice_Unacquire(g_pMouse);