diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 9f7320fb4..5e9f70636 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1291,11 +1291,7 @@ RESTART: ready2send = 1; while (!gQuitGame) { - if (handleevents() && quitevent) - { - inputState.SetKeyStatus(sc_Escape, 1); - quitevent = 0; - } + handleevents(); netUpdate(); MUSIC_Update(); inputState.SetBindsEnabled(gInputMode == kInputGame); diff --git a/source/blood/src/demo.cpp b/source/blood/src/demo.cpp index 6b1eb8c11..202ebc661 100644 --- a/source/blood/src/demo.cpp +++ b/source/blood/src/demo.cpp @@ -49,6 +49,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "i_specialpaths.h" #include "view.h" #include "gamecontrol.h" +#include "menu/menu.h" BEGIN_BLD_NS @@ -293,14 +294,7 @@ void CDemo::ProcessKeys(void) { switch (nKey) { - case 1: - if (!CGameMenuMgr::m_bActive) - { - gGameMenuMgr.Push(&menuMain, -1); - at2 = 1; - } - break; - case 0x58: + case sc_F12: gViewIndex = connectpoint2[gViewIndex]; if (gViewIndex == -1) gViewIndex = connecthead; @@ -321,21 +315,12 @@ void CDemo::Playback(void) inputState.SetBindsEnabled(false); ready2send = 0; int v4 = 0; - if (!CGameMenuMgr::m_bActive) - { - gGameMenuMgr.Push(&menuMain, -1); - at2 = 1; - } gNetFifoClock = totalclock; gViewMode = 3; _DEMOPLAYBACK: while (at1 && !gQuitGame) { - if (handleevents() && quitevent) - { - inputState.SetKeyStatus(sc_Escape, 1); - quitevent = 0; - } + handleevents(); MUSIC_Update(); while (totalclock >= gNetFifoClock && !gQuitGame) { @@ -407,8 +392,6 @@ _DEMOPLAYBACK: if (G_FPSLimit()) { viewDrawScreen(); - if (gInputMode == kInputMenu && CGameMenuMgr::m_bActive) - gGameMenuMgr.Draw(); videoNextPage(); } if (TestBitString(gotpic, 2342)) diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index 1e6242d79..0310bfb4f 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -542,7 +542,7 @@ void netGetPackets(void) gStartNewGame = 1; break; case 255: - inputState.SetKeyStatus(sc_Escape, 1); + inputState.SetKeyStatus(sc_Escape); break; } } @@ -1007,11 +1007,13 @@ void netInitialize(bool bConsole) while (numplayers < gNetPlayers) { handleevents(); +#if 0 if (quitevent) { netServerDisconnect(); QuitGame(); } +#endif if (!bConsole && inputState.GetKeyStatus(sc_Escape)) { netServerDisconnect(); @@ -1168,11 +1170,13 @@ void netInitialize(bool bConsole) while (bWaitServer) { handleevents(); +#if 0 if (quitevent) { netClientDisconnect(); QuitGame(); } +#endif if (!bConsole && inputState.GetKeyStatus(sc_Escape)) { netClientDisconnect(); diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index 2e5449598..40f147f5f 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -22,7 +22,7 @@ extern int32_t g_maskDrawMode; #endif -extern char quitevent, appactive; +extern char appactive; extern char modechange; extern char nogl; diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 0d0577e4f..872e2c299 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -306,7 +306,6 @@ static int32_t defsparser(scriptfile *script) } #endif handleevents(); - if (quitevent) return 0; tokn = getatoken(script,basetokens,ARRAY_SIZE(basetokens)); cmdtokptr = script->ltextptr; switch (tokn) diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 65f3bb8ab..84d0badb0 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -100,7 +100,7 @@ unsigned char syncstate; int32_t inputchecked = 0; bool screenshot_requested; -char quitevent=0, appactive=1, novideo=0; +char appactive=1, novideo=0; // video static SDL_Surface *sdl_surface/*=NULL*/; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index ec3c682a4..423e61e69 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5720,12 +5720,6 @@ static void G_Startup(void) for (i=0; i 1) @@ -6031,8 +6025,6 @@ int GameInterface::app_main() system_getcvars(); - if (quitevent) return 4; - if (g_networkMode != NET_DEDICATED_SERVER && validmodecnt > 0) { if (videoSetGameMode(ScreenMode, ScreenWidth, ScreenHeight, ScreenBPP, 1) < 0) @@ -6195,11 +6187,7 @@ MAIN_LOOP_RESTART: do //main loop { - if (gameHandleEvents() && quitevent) - { - inputState.SetKeyStatus(sc_Escape, 1); - quitevent = 0; - } + gameHandleEvents(); // only allow binds to function if the player is actually in a game (not in a menu, typing, et cetera) or demo inputState.SetBindsEnabled(!!(myplayer.gm & (MODE_GAME|MODE_DEMO))); diff --git a/source/platform/win32/startwin.game.cpp b/source/platform/win32/startwin.game.cpp index 60d387675..592c93ecc 100644 --- a/source/platform/win32/startwin.game.cpp +++ b/source/platform/win32/startwin.game.cpp @@ -432,7 +432,6 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case WM_CLOSE: if (mode == TAB_CONFIG) done = 0; - else quitevent++; return TRUE; case WM_DESTROY: @@ -456,7 +455,6 @@ static INT_PTR CALLBACK startup_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, { case WIN_STARTWIN_CANCEL: if (mode == TAB_CONFIG) done = 0; - else quitevent++; return TRUE; case WIN_STARTWIN_START: done = 1; diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 07336cd03..9456c3d0a 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -7157,12 +7157,6 @@ static void G_Startup(void) for (i=0; i 1) @@ -7416,8 +7410,6 @@ int GameInterface::app_main() i = 1-i; } - if (quitevent) return 4; - Anim_Init(); const char *defsfile = G_DefFile(); @@ -7628,11 +7620,7 @@ MAIN_LOOP_RESTART: do //main loop { - if (handleevents() && quitevent) - { - inputState.SetKeyStatus(sc_Escape, 1); - quitevent = 0; - } + handleevents(); Net_GetPackets(); diff --git a/source/sw/src/anim.cpp b/source/sw/src/anim.cpp index 052822e0c..aec81d051 100644 --- a/source/sw/src/anim.cpp +++ b/source/sw/src/anim.cpp @@ -320,12 +320,12 @@ playanm(short anim_num) switch (ANIMnum) { case ANIM_INTRO: - if (I_GeneralTrigger() || quitevent) + if (I_GeneralTrigger()) I_GeneralTriggerClear(); goto ENDOFANIMLOOP; break; case ANIM_SERP: - if (I_EscapeTrigger() || quitevent) + if (I_EscapeTrigger()) I_EscapeTriggerClear(); goto ENDOFANIMLOOP; break; diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index d6a40a641..308a68e8f 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -842,11 +842,6 @@ void InitGame() while (initmultiplayerscycle()) { handleevents(); - if (quitevent) - { - QuitFlag = TRUE; - return; - } } } #else @@ -1650,7 +1645,6 @@ void LogoLevel(void) while (TRUE) { handleevents(); - if (quitevent) { QuitFlag = TRUE; break; } // taken from top of faketimerhandler // limits checks to max of 40 times a second @@ -1778,7 +1772,7 @@ void SybexScreen(void) videoNextPage(); ResetKeys(); - while (!KeyPressed() && !quitevent) handleevents(); + while (!KeyPressed()) handleevents(); } // CTW REMOVED END @@ -1961,8 +1955,6 @@ void MenuLevel(void) handleevents(); OSD_DispatchQueued(); - if (quitevent) QuitFlag = TRUE; - // taken from top of faketimerhandler // limits checks to max of 40 times a second if (totalclock >= ototalclock + synctics) @@ -2645,8 +2637,6 @@ void Control() handleevents(); OSD_DispatchQueued(); - if (quitevent) QuitFlag = TRUE; - NewLevel(); } @@ -2903,8 +2893,6 @@ void RunLevel(void) D_ProcessEvents(); faketimerhandler(); - if (quitevent) QuitFlag = TRUE; - MoveLoop(); diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index 1eb21c93f..a4fd7f4ba 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -631,7 +631,7 @@ waitforeverybody(void) handleevents(); getpackets(); - if (quitevent || (wfe_ExitCallback && wfe_ExitCallback())) + if (wfe_ExitCallback && wfe_ExitCallback())) { // allow exit //if (inputState.GetKeyStatus(KEYSC_ESC))