- Move crouch toggling back into the backend so the toggle key can be used as a swim key.

* Reverts 272dfa762d, but is a fresh implementation.
* I doubted anyone was doing this but apparently not.
* Exhumed needed a bit more work as it has very specific underwater checks.
This commit is contained in:
Mitchell Richters 2023-09-24 13:40:15 +10:00
parent 615267dbd4
commit 29e021b5bf
19 changed files with 124 additions and 134 deletions

View file

@ -72,6 +72,7 @@
void WriteSavePic(FileWriter* file, int width, int height);
extern bool crouch_toggle;
extern FString savename;
extern FString BackupSaveGame;
int SaveVersion;
@ -89,6 +90,21 @@ END_BLD_NS
//
//=============================================================================
static void SerializeGlobals(FSerializer& arc)
{
if (arc.BeginObject("globals"))
{
arc("crouch_toggle", crouch_toggle)
.EndObject();
}
}
//=============================================================================
//
//
//
//=============================================================================
static void SerializeSession(FSerializer& arc)
{
// Only Exhumed still depends in indexed sounds.
@ -103,6 +119,7 @@ static void SerializeSession(FSerializer& arc)
S_SerializeSounds(arc);
SerializeAutomap(arc);
SerializeHud(arc);
SerializeGlobals(arc);
gi->SerializeGameState(arc);
}