foxygit / doom Log in
commit 7cc9883010e9610e3e73160365ba0b4df1d6ea46
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat May 6 19:14:08 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat May 6 19:14:08 2006 +0000

    Add back -nomouse command line parameter.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 476
---
 src/i_video.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/src/i_video.c b/src/i_video.c
index 6ad865e8..b04b6d8f 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 471 2006-04-28 17:20:05Z fraggle $
+// $Id: i_video.c 476 2006-05-06 19:14:08Z 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 471 2006-04-28 17:20:05Z fraggle $";
+rcsid[] = "$Id: i_video.c 476 2006-05-06 19:14:08Z fraggle $";

 #include <SDL.h>
 #include <ctype.h>
@@ -222,6 +222,10 @@ static int windowwidth, windowheight;

 static boolean initialised = false;

+// disable mouse?
+
+static boolean nomouse = false;
+
 // if true, screens[0] is screen->pixel

 static boolean native_surface;
@@ -517,16 +521,22 @@ void I_GetEvent(void)
                 break;
                 */
             case SDL_MOUSEBUTTONDOWN:
-                event.type = ev_mouse;
-                event.data1 = MouseButtonState();
-                event.data2 = event.data3 = 0;
-                D_PostEvent(&event);
+		if (!nomouse)
+		{
+                    event.type = ev_mouse;
+                    event.data1 = MouseButtonState();
+                    event.data2 = event.data3 = 0;
+                    D_PostEvent(&event);
+		}
                 break;
             case SDL_MOUSEBUTTONUP:
-                event.type = ev_mouse;
-                event.data1 = MouseButtonState();
-                event.data2 = event.data3 = 0;
-                D_PostEvent(&event);
+		if (!nomouse)
+		{
+                    event.type = ev_mouse;
+                    event.data1 = MouseButtonState();
+                    event.data2 = event.data3 = 0;
+                    D_PostEvent(&event);
+		}
                 break;
             case SDL_QUIT:
                 // bring up the "quit doom?" prompt
@@ -573,7 +583,11 @@ static void I_ReadMouse(void)
 void I_StartTic (void)
 {
     I_GetEvent();
-    I_ReadMouse();
+
+    if (!nomouse)
+    {
+        I_ReadMouse();
+    }
 }


@@ -955,6 +969,8 @@ void I_InitGraphics(void)
         flags |= SDL_FULLSCREEN;
     }

+    nomouse = M_CheckParm("-nomouse") > 0;
+
     // scale-by-2 mode

     if (M_CheckParm("-1"))