From e40b14026828e11fb229c614bc0247edcdd90afb Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 29 May 2006 13:25:38 +0000 Subject: Warp mouse to screen center (possibly fix joe's mouse problem). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 538 --- src/i_video.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i_video.c b/src/i_video.c index 62ad2c79..a6d30982 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 536 2006-05-29 10:38:27Z fraggle $ +// $Id: i_video.c 538 2006-05-29 13:25:38Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -175,7 +175,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 536 2006-05-29 10:38:27Z fraggle $"; +rcsid[] = "$Id: i_video.c 538 2006-05-29 13:25:38Z fraggle $"; #include #include @@ -600,6 +600,13 @@ static void I_ReadMouse(void) D_PostEvent(&ev); } + + if (MouseShouldBeGrabbed()) + { + SDL_WarpMouse(screen->w / 2, screen->h / 2); + SDL_PumpEvents(); + SDL_GetRelativeMouseState(NULL, NULL); + } } // -- cgit v1.2.3