summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-05-06 19:14:08 +0000
committerSimon Howard2006-05-06 19:14:08 +0000
commit7cc9883010e9610e3e73160365ba0b4df1d6ea46 (patch)
tree19ddfc3a6f0f5942357078a73d1871b928837229
parent319f427c9369bfe1c5a6cad636ecd91934c3024d (diff)
downloadchocolate-doom-7cc9883010e9610e3e73160365ba0b4df1d6ea46.tar.gz
chocolate-doom-7cc9883010e9610e3e73160365ba0b4df1d6ea46.tar.bz2
chocolate-doom-7cc9883010e9610e3e73160365ba0b4df1d6ea46.zip
Add back -nomouse command line parameter.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 476
-rw-r--r--src/i_video.c38
1 files 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"))