commit 2532daf4e1e8cf58274c0c845ec9b297cde369c7
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sat Jun 4 20:15:57 2016 -0400
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Sat Jun 4 20:15:57 2016 -0400
video: Remove useless command line arguments.
The -grabmouse, -novert and -nonovert command line arguments were added
in the early days of the project, before the setup tool existed. With
hindsight there do not appear to be clear use cases for them and it's
better that these are just configured through the config files.
The -nograbmouse argument is the one exception, which is useful for
debugging purposes as a temporary override. Change this to only be a
temporary override that does not have any permanent effect on the
config option, making it consistent with arguments found in vanilla
Doom (-nomouse, -noblit, -nosound, etc.).
This fixes #212.
---
src/doom/d_main.c | 1 -
src/heretic/d_main.c | 1 -
src/hexen/h2_main.c | 1 -
src/i_input.c | 25 -------------------------
src/i_input.h | 1 -
src/i_video.c | 22 +++++-----------------
src/strife/d_main.c | 1 -
7 files changed, 5 insertions(+), 47 deletions(-)
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 7077d17a..d4584052 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -426,7 +426,6 @@ void D_DoomLoop (void)
I_SetWindowTitle(gamedescription);
I_GraphicsCheckCommandLine();
- I_InputCheckCommandLine();
I_SetGrabMouseCallback(D_GrabMouseCallback);
I_InitGraphics();
V_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H);
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index b3aadc6a..04c6d977 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -243,7 +243,6 @@ void D_DoomLoop(void)
debugfile = fopen(filename, "w");
}
I_GraphicsCheckCommandLine();
- I_InputCheckCommandLine();
I_SetGrabMouseCallback(D_GrabMouseCallback);
I_InitGraphics();
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 62cd1083..e60047b3 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -739,7 +739,6 @@ void H2_GameLoop(void)
}
I_SetWindowTitle(gamedescription);
I_GraphicsCheckCommandLine();
- I_InputCheckCommandLine();
I_SetGrabMouseCallback(D_GrabMouseCallback);
I_InitGraphics();
diff --git a/src/i_input.c b/src/i_input.c
index a96492da..44c03302 100644
--- a/src/i_input.c
+++ b/src/i_input.c
@@ -418,31 +418,6 @@ void I_ReadMouse(void)
}
}
-void I_InputCheckCommandLine(void)
-{
- //!
- // @category video
- //
- // Disable vertical mouse movement.
- //
-
- if (M_CheckParm("-novert"))
- {
- novert = true;
- }
-
- //!
- // @category video
- //
- // Enable vertical mouse movement.
- //
-
- if (M_CheckParm("-nonovert"))
- {
- novert = false;
- }
-}
-
// Bind all variables controlling input options.
void I_BindInputVariables(void)
{
diff --git a/src/i_input.h b/src/i_input.h
index e9d87ea4..8e3b2f1f 100644
--- a/src/i_input.h
+++ b/src/i_input.h
@@ -29,7 +29,6 @@ extern int mouse_threshold;
void I_BindInputVariables(void);
void I_ReadMouse(void);
-void I_InputCheckCommandLine(void);
// I_StartTextInput begins text input, activating the on-screen keyboard
// (if one is used). The caller indicates that any entered text will be
diff --git a/src/i_video.c b/src/i_video.c
index d9afaea8..1499a0df 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -129,9 +129,11 @@ int aspect_ratio_correct = true;
static int startup_delay = 1000;
-// Grab the mouse? (int type for config code)
+// Grab the mouse? (int type for config code). nograbmouse_override allows
+// this to be temporarily disabled via the command line.
static int grabmouse = true;
+static boolean nograbmouse_override = false;
// The screen buffer; this is modified to draw things to the screen
@@ -198,7 +200,7 @@ static boolean MouseShouldBeGrabbed()
// if we specify not to grab the mouse, never grab
- if (!grabmouse)
+ if (nograbmouse_override || !grabmouse)
return false;
// Invoke the grabmouse callback function to determine whether
@@ -817,27 +819,13 @@ void I_GraphicsCheckCommandLine(void)
noblit = M_CheckParm ("-noblit");
- //!
- // @category video
- //
- // Grab the mouse when running in windowed mode.
- //
-
- if (M_CheckParm("-grabmouse"))
- {
- grabmouse = true;
- }
-
//!
// @category video
//
// Don't grab the mouse when running in windowed mode.
//
- if (M_CheckParm("-nograbmouse"))
- {
- grabmouse = false;
- }
+ nograbmouse_override = M_ParmExists("-nograbmouse");
// default to fullscreen mode, allow override with command line
// nofullscreen because we love prboom
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index aed16590..f58d3e3f 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -1675,7 +1675,6 @@ void D_DoomMain (void)
M_CreateSaveDirs(savegamedir);
I_GraphicsCheckCommandLine();
- I_InputCheckCommandLine();
// haleyjd 20110206 [STRIFE] Startup the introduction sequence
D_InitIntroSequence();