diff --git a/source/blood/src/blood.h b/source/blood/src/blood.h index 203742226..2f8e81afd 100644 --- a/source/blood/src/blood.h +++ b/source/blood/src/blood.h @@ -71,6 +71,7 @@ struct GameInterface : ::GameInterface { const char* Name() override { return "Blood"; } void app_init() override; + void clearlocalinputstate() override; bool GenerateSavePic() override; void FreeLevelData() override; void FreeGameData() override; diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index a2108ca33..e365cd850 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -170,4 +170,16 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) } } +//--------------------------------------------------------------------------- +// +// This is called from ImputState::ClearAllInput and resets all static state being used here. +// +//--------------------------------------------------------------------------- + +void GameInterface::clearlocalinputstate() +{ + gInput = {}; + turnHeldTime = 0; +} + END_BLD_NS diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 113f9d764..d9aa19767 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -235,6 +235,7 @@ struct GameInterface : ::GameInterface { const char* Name() override { return "Exhumed"; } void app_init() override; + void clearlocalinputstate() override; bool GenerateSavePic() override; void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override; void MenuOpened() override; diff --git a/source/exhumed/src/input.cpp b/source/exhumed/src/input.cpp index 04f64a0a4..2df7586a3 100644 --- a/source/exhumed/src/input.cpp +++ b/source/exhumed/src/input.cpp @@ -232,4 +232,17 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput) if (packet) *packet = localInput; } +//--------------------------------------------------------------------------- +// +// This is called from ImputState::ClearAllInput and resets all static state being used here. +// +//--------------------------------------------------------------------------- + +void GameInterface::clearlocalinputstate() +{ + localInput = {}; + turn = 0; + counter = 0; +} + END_PS_NS diff --git a/source/sw/src/game.h b/source/sw/src/game.h index e297550c7..dedcf503b 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -2182,6 +2182,7 @@ struct GameInterface : ::GameInterface { const char* Name() override { return "ShadowWarrior"; } void app_init() override; + void clearlocalinputstate() override; void FreeGameData() override; void FreeLevelData() override; bool GenerateSavePic() override; diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 9034e77a6..0dce53998 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -344,4 +344,16 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput) } } +//--------------------------------------------------------------------------- +// +// This is called from ImputState::ClearAllInput and resets all static state being used here. +// +//--------------------------------------------------------------------------- + +void GameInterface::clearlocalinputstate() +{ + loc = {}; + turnheldtime = 0; +} + END_SW_NS