diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 921f3c348..3c0e59178 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "baselayer.h" #include "common.h" #include "common_game.h" +#include "g_input.h" #include "db.h" #include "blood.h" @@ -315,7 +316,7 @@ void PreloadTiles(void) fxPrecache(); gibPrecache(); - gameHandleEvents(); + I_GetEvent(); } void PreloadCache(void) @@ -325,21 +326,20 @@ void PreloadCache(void) int cnt = 0; int percentDisplayed = -1; - for (int i=0; ihand == 1) { -#define CHOKERATE 8 -#define TICRATE 30 + const int CHOKERATE = 8; + const int COUNTRATE = 30; gChokeCounter += CHOKERATE; - while (gChokeCounter >= TICRATE) + while (gChokeCounter >= COUNTRATE) { gChoke.at1c(gMe); - gChokeCounter -= TICRATE; + gChokeCounter -= COUNTRATE; } } gLevelTime++; @@ -636,14 +636,17 @@ void ProcessFrame(void) if ((gGameOptions.uGameFlags&1) != 0 && !gStartNewGame) { ready2send = 0; +#if 0 if (gNetPlayers > 1 && gNetMode == NETWORK_SERVER && gPacketMode == PACKETMODE_1 && myconnectindex == connecthead) { while (gNetFifoMasterTail < gNetFifoTail) { - gameHandleEvents(); + netGetPackets(); + h andleevents(); netMasterUpdate(); } } +#endif seqKillAll(); if (gGameOptions.uGameFlags&2) { @@ -932,7 +935,8 @@ int GameInterface::app_main() if (gamestate == GS_STARTUP) gameInit(); commonTicker(playvideo); - gameHandleEvents(); + netGetPackets(); + handleevents(); updatePauseStatus(); D_ProcessEvents(); ctrlGetInput(); diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index d64d69c7a..44fb8b11c 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -485,12 +485,6 @@ extern void G_ExtInit(void); extern void G_SetupGlobalPsky(void); -static inline int gameHandleEvents(void) -{ - netGetPackets(); - return handleevents(); -} - #pragma pack(push,1) #if 0 diff --git a/source/common/engine/g_input.h b/source/common/engine/g_input.h index 1a998014b..cc78d02ff 100644 --- a/source/common/engine/g_input.h +++ b/source/common/engine/g_input.h @@ -6,4 +6,4 @@ void I_PutInClipboard (const char *str); FString I_GetFromClipboard (bool use_primary_selection); void I_SetMouseCapture(); void I_ReleaseMouseCapture(); - +void I_GetEvent(); \ No newline at end of file diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index f5f9df0a4..92265ba05 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -526,7 +526,6 @@ public: if (completion) completion(false); return false; } - handleevents(); if (actionState == State_Clear) { actionState = State_Run; diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 3570cdee5..4298d92d6 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -28,6 +28,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "ns.h" // Must come before everything else! +#include "g_input.h" #include "duke3d.h" #include "superfasthash.h" @@ -292,7 +293,7 @@ void GameInterface::StartGame(FNewGameStartup& gs) while (S_CheckSoundPlaying(skillsound)) { S_Update(); - handleevents(); + I_GetEvent(); } } ud.m_respawn_monsters = (gs.Skill == 3); diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index f5a12090a..da1e4ad01 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -841,7 +841,6 @@ void donewgame(MapRecord* map, int sk) template void newgame(MapRecord* map, int sk, func completion) { - handleevents(); ready2send = 0; auto completion1 = [=](bool res) diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 8d16b2831..1e2c71bae 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -36,6 +36,7 @@ source as it is released. #include "ns.h" // Must come before everything else! #include "compat.h" +#include "g_input.h" #include "duke3d.h" #include "raze_music.h" @@ -103,7 +104,7 @@ void S_CacheAllSounds(void) { soundEngine->CacheSound(&snd); if (((++i)&31) == 0) - handleevents(); + I_GetEvent(); } } diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index a6702f4a5..81c7785ea 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" // Must come before everything else! #include "build.h" +#include "g_input.h" #include "names2.h" #include "panel.h" @@ -221,7 +222,7 @@ void GameInterface::StartGame(FNewGameStartup& gs) while (soundEngine->IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE)) { DoUpdateSounds(); - handleevents(); + I_GetEvent(); } } diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index e1dbb0411..cec1765ee 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -412,21 +412,8 @@ bool InitGame() InitPalette(); // sets numplayers, connecthead, connectpoint2, myconnectindex -#if 0 - if (!firstnet) - initmultiplayers(0, NULL, 0, 0, 0); - else if (initmultiplayersparms(argc - firstnet, &argv[firstnet])) - { - Printf("Waiting for players...\n"); - while (initmultiplayerscycle()) - { - handleevents(); - } - } -#else numplayers = 1; myconnectindex = 0; connecthead = 0; connectpoint2[0] = -1; -#endif initsynccrc(); // code to duplicate packets