summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hexen/g_game.c19
-rw-r--r--src/hexen/h2_main.c19
-rw-r--r--src/hexen/h2def.h3
-rw-r--r--src/hexen/mn_menu.c12
4 files changed, 53 insertions, 0 deletions
diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c
index 190fdf76..fa115e56 100644
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -175,6 +175,9 @@ static skill_t TempSkill;
static int TempEpisode;
static int TempMap;
+boolean testcontrols = false;
+int testcontrols_mousespeed;
+
//=============================================================================
/*
====================
@@ -535,6 +538,12 @@ void G_BuildTiccmd(ticcmd_t * cmd)
{
cmd->angleturn -= mousex * 0x8;
}
+
+ if (mousex == 0)
+ {
+ testcontrols_mousespeed = 0;
+ }
+
forward += mousey;
mousex = mousey = 0;
@@ -632,6 +641,11 @@ void G_DoLoadLevel(void)
sendpause = sendsave = paused = false;
memset(mousebuttons, 0, sizeof(mousebuttons));
memset(joybuttons, 0, sizeof(joybuttons));
+
+ if (testcontrols)
+ {
+ P_SetMessage(&players[consoleplayer], "PRESS ESCAPE TO QUIT.", false);
+ }
}
@@ -693,6 +707,11 @@ boolean G_Responder(event_t * ev)
}
}
+ if (ev->type == ev_mouse)
+ {
+ testcontrols_mousespeed = abs(ev->data2);
+ }
+
switch (ev->type)
{
case ev_keydown:
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index c78d662a..20720e4e 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -92,6 +92,7 @@ static void DrawAndBlit(void);
static void ExecOptionSCRIPTS(char **args, int tag);
static void ExecOptionSKILL(char **args, int tag);
static void ExecOptionPLAYDEMO(char **args, int tag);
+static void ExecOptionTestControls(char **args, int tag);
static void CreateSavePath(void);
static void WarpCheck(void);
@@ -137,6 +138,7 @@ static execOpt_t ExecOptions[] = {
{"-skill", ExecOptionSKILL, 1, 0},
{"-playdemo", ExecOptionPLAYDEMO, 1, 0},
{"-timedemo", ExecOptionPLAYDEMO, 1, 0},
+ {"-testcontrols", ExecOptionTestControls, 0, 0},
{NULL, NULL, 0, 0} // Terminator
};
@@ -517,6 +519,18 @@ static void ExecOptionPLAYDEMO(char **args, int tag)
//==========================================================================
//
+// ExecOptionTestControls
+//
+//==========================================================================
+
+static void ExecOptionTestControls(char **args, int tag)
+{
+ autostart = true;
+ testcontrols = true;
+}
+
+//==========================================================================
+//
// ExecOptionSCRIPTS
//
//==========================================================================
@@ -656,6 +670,11 @@ static void DrawAndBlit(void)
break;
}
+ if (testcontrols)
+ {
+ V_DrawMouseSpeedBox(testcontrols_mousespeed);
+ }
+
if (paused && !MenuActive && !askforquit)
{
if (!netgame)
diff --git a/src/hexen/h2def.h b/src/hexen/h2def.h
index 5993fe55..7910cde8 100644
--- a/src/hexen/h2def.h
+++ b/src/hexen/h2def.h
@@ -739,6 +739,9 @@ extern int startepisode;
extern int startmap;
extern boolean autostart;
+extern boolean testcontrols;
+extern int testcontrols_mousespeed;
+
/*
===============================================================================
diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
index 9f37df66..c7a8bef9 100644
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -1142,6 +1142,18 @@ boolean MN_Responder(event_t * event)
extern void G_CheckDemoStatus(void);
char *textBuffer;
+ if (testcontrols)
+ {
+ if (event->type == ev_quit
+ || (event->type == ev_keydown
+ && (event->data1 == key_menu_activate
+ || event->data1 == key_menu_quit)))
+ {
+ I_Quit();
+ return true;
+ }
+ }
+
// "close" button pressed on window?
if (event->type == ev_quit)
{