- Blood/Exhumed/SW: Hook up gi->clearlocalinputstate().

This commit is contained in:
Mitchell Richters 2020-09-24 00:15:51 +10:00
parent 9b85816f70
commit e078ea6ebd
6 changed files with 40 additions and 0 deletions

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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