On Windows, add command-line switch -nopause, disabling the pause key.

Hopefully this fixes the periodic pausing/unpausing that a few people
have been experiencing.
Also fix build with GCC 3.

git-svn-id: https://svn.eduke32.com/eduke32@2108 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-11-10 21:47:26 +00:00
parent 63805a025b
commit a67af55153
4 changed files with 20 additions and 1 deletions

View file

@ -115,7 +115,11 @@ W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
BASECFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \
-Wextra -Wstrict-overflow=1 #-Wwrite-strings -Waddress -Wlogical-op
-Wextra #-Wwrite-strings -Waddress -Wlogical-op
ifneq (3,$(GCC_MAJOR))
BASECFLAGS+= -Wstrict-overflow=1
endif
ifneq (0,$(USE_LIBPNG))
BASECFLAGS+= -DUSE_LIBPNG
endif

View file

@ -10,6 +10,7 @@ extern uint32_t maxrefreshfreq;
extern int32_t glusecds;
extern char rawinput_nopause;
extern char di_disabled;
int32_t win_gethwnd(void);

View file

@ -6,6 +6,7 @@
#include "scancodes.h"
#include "build.h"
char rawinput_nopause = 0;
static BOOL rawinput_started = 0;
static uint8_t KeyboardState[256] = {0}; // VKeys
static int8_t MWheel = 0;
@ -128,6 +129,9 @@ static inline void RI_ProcessKeyboard(const RAWKEYBOARD *rkbd)
case VK_RETURN:
if (rkbd->Flags & RI_KEY_E0) key = sc_kpad_Enter; break;
case VK_PAUSE:
if (rawinput_nopause)
return;
KeyboardState[VKey] = 1 - (rkbd->Flags & RI_KEY_BREAK);
if (rkbd->Flags & RI_KEY_BREAK) return;

View file

@ -8001,7 +8001,10 @@ static void G_ShowDebugHelp(void)
"-gamegrp \tSelects which file to use as main grp\n"
"-name [name]\tPlayer name in multiplay\n"
"-noautoload\tDisable loading content from autoload dir\n"
#ifdef _WIN32
"-nodinput\t\tDisable DirectInput (joystick) support\n"
"-nopause\t\tDisable the pause key\n"
#endif
"-nologo\t\tSkip the logo anim\n"
"-ns/-nm\t\tDisable sound or music\n"
"-q#\t\tFake multiplayer with # (2-8) players\n"
@ -8554,6 +8557,13 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
i++;
continue;
}
if (!Bstrcasecmp(c+1,"nopause"))
{
initprintf("Pause key disabled\n");
rawinput_nopause = 1;
i++;
continue;
}
#endif
if (!Bstrcasecmp(c+1,"noautoload"))
{