- Clean out where inputState.ClearAllInput() is called.

* We can do this from just a few places and achieve the same result as having it sprinkled everywhere did.
This commit is contained in:
Mitchell Richters 2023-03-29 08:54:38 +11:00
parent 9f8cda4be3
commit 7caec5fa69
8 changed files with 2 additions and 17 deletions

View file

@ -1103,8 +1103,6 @@ int RunGame()
StartWindow = FStartupScreen::CreateInstance(8, true);
StartWindow->Progress();
inputState.ClearAllInput();
if (!GameConfig->IsInitialized())
{
CONFIG_ReadCombatMacros();

View file

@ -266,6 +266,7 @@ static void GameTicker()
case ga_level:
Net_ClearFifo();
inputState.ClearAllInput();
gamestate = GS_LEVEL;
break;

View file

@ -467,8 +467,6 @@ void validateStartSector(const char* filename, const DVector3& pos, sectortype**
void loadMap(const char* filename, int flags, DVector3* pos, int16_t* ang, sectortype** cursect, SpawnSpriteDef& sprites)
{
inputState.ClearAllInput();
FileReader fr = fileSystem.OpenFileReader(filename);
if (!fr.isOpen()) I_Error("Unable to open map %s", filename);
int mapversion = fr.ReadInt32();

View file

@ -157,7 +157,6 @@ bool M_SetSpecialMenu(FName& menu, int param)
int ep = NewGameStartupInfo.Episode;
auto vol = FindVolume(ep);
if (vol) STAT_StartNewGame(vol->name, NewGameStartupInfo.Skill);
inputState.ClearAllInput();
}
return false;
@ -206,7 +205,6 @@ void OnMenuOpen(bool makeSound)
void System_MenuClosed()
{
GSnd->SetSfxPaused(false, PAUSESFX_MENU);
inputState.ClearAllInput();
gi->MenuClosed();
}

View file

@ -733,7 +733,6 @@ static int nextquicksave = -1;
gamestate = GS_HIDECONSOLE;
}
inputState.ClearAllInput();
DoLoadGame(savename);
BackupSaveGame = savename;
}

View file

@ -245,7 +245,6 @@ void StartLevel(MapRecord* level, bool newgame)
if (!level) return;
gFrameCount = 0;
PlayClock = 0;
inputState.ClearAllInput();
currentLevel = level;
if (gGameOptions.nGameType == 0)
@ -636,11 +635,6 @@ static void gameInit()
gViewIndex = myconnectindex;
UpdateNetworkMenus();
if (gGameOptions.nGameType > 0)
{
inputState.ClearAllInput();
}
}

View file

@ -1180,7 +1180,6 @@ void GameInterface::NewGame(MapRecord* map, int skill, bool)
if (isShareware() && ud.recstat != 2) FTA(QUOTE_F1HELP, &ps[myconnectindex]);
PlayerColorChanged();
inputState.ClearAllInput();
}
//---------------------------------------------------------------------------

View file

@ -335,9 +335,6 @@ void RestartPlayer(int nPlayer)
}
BuildRa(nPlayer);
// clear out all input before finishing here
inputState.ClearAllInput();
}
//---------------------------------------------------------------------------
@ -1934,6 +1931,7 @@ static bool doPlayerDeathRestart(Player* const pPlayer)
// will invalidate nPlayerSprite
RestartPlayer(pPlayer->nPlayer);
inputState.ClearAllInput();
}
else
{