summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-05-29 13:25:38 +0000
committerSimon Howard2006-05-29 13:25:38 +0000
commite40b14026828e11fb229c614bc0247edcdd90afb (patch)
tree618e50816cd709b596620c9b61b81e5f528820b8
parent9fbd2eda3e78dd6e6189b188522ff56a6551ec67 (diff)
downloadchocolate-doom-e40b14026828e11fb229c614bc0247edcdd90afb.tar.gz
chocolate-doom-e40b14026828e11fb229c614bc0247edcdd90afb.tar.bz2
chocolate-doom-e40b14026828e11fb229c614bc0247edcdd90afb.zip
Warp mouse to screen center (possibly fix joe's mouse problem).
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 538
-rw-r--r--src/i_video.c11
1 files 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 <SDL.h>
#include <ctype.h>
@@ -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);
+ }
}
//