shithub: choc

Download patch

ref: e40b14026828e11fb229c614bc0247edcdd90afb
parent: 9fbd2eda3e78dd6e6189b188522ff56a6551ec67
author: Simon Howard <fraggle@gmail.com>
date: Mon May 29 09:25:38 EDT 2006

Warp mouse to screen center (possibly fix joe's mouse problem).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 538

--- 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>
@@ -599,6 +599,13 @@
         ev.data3 = -AccelerateMouse(y);
         
         D_PostEvent(&ev);
+    }
+
+    if (MouseShouldBeGrabbed())
+    {
+        SDL_WarpMouse(screen->w / 2, screen->h / 2);
+        SDL_PumpEvents();
+        SDL_GetRelativeMouseState(NULL, NULL);
     }
 }