mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-13 19:40:43 +00:00
- handle savegame loads like GZDoom.
They are synchronized with the game loop and should not be initiated directly from the menu.
This commit is contained in:
parent
499ed52972
commit
9dd9dc8efd
4 changed files with 29 additions and 5 deletions
|
@ -106,6 +106,7 @@ int oldentertics;
|
|||
int gametic;
|
||||
int intermissiondelay;
|
||||
|
||||
FString savename;
|
||||
FString BackupSaveGame;
|
||||
|
||||
void DoLoadGame(const char* name);
|
||||
|
@ -257,6 +258,12 @@ static void GameTicker()
|
|||
savedescription = "";
|
||||
break;
|
||||
|
||||
case ga_loadgame:
|
||||
case ga_loadgamehidecon:
|
||||
//case ga_autoloadgame:
|
||||
G_DoLoadGame();
|
||||
break;
|
||||
|
||||
case ga_autosave:
|
||||
if (gamestate == GS_LEVEL && !newGameStarted) M_Autosave();
|
||||
newGameStarted = false;
|
||||
|
|
|
@ -114,7 +114,7 @@ void FSavegameManager::ReadSaveStrings()
|
|||
|
||||
void FSavegameManager::PerformLoadGame(const char *f, bool s)
|
||||
{
|
||||
G_LoadGame(f);
|
||||
G_LoadGame(f, s);
|
||||
}
|
||||
|
||||
void FSavegameManager::PerformSaveGame(const char *f, const char *s)
|
||||
|
|
|
@ -68,6 +68,7 @@ walltype wallbackup[MAXWALLS];
|
|||
|
||||
void WriteSavePic(FileWriter* file, int width, int height);
|
||||
bool WriteZip(const char* filename, TArray<FString>& filenames, TArray<FCompressedBuffer>& content);
|
||||
extern FString savename;
|
||||
extern FString BackupSaveGame;
|
||||
|
||||
void SerializeMap(FSerializer &arc);
|
||||
|
@ -687,12 +688,27 @@ static int nextquicksave = -1;
|
|||
}
|
||||
|
||||
|
||||
void G_LoadGame(const char *filename)
|
||||
void G_LoadGame(const char* name, bool hidecon)
|
||||
{
|
||||
if (name != NULL)
|
||||
{
|
||||
savename = name;
|
||||
gameaction = !hidecon ? ga_loadgame : ga_loadgamehidecon;
|
||||
}
|
||||
}
|
||||
|
||||
void G_DoLoadGame()
|
||||
{
|
||||
if (gameaction == ga_loadgamehidecon && gamestate == GS_FULLCONSOLE)
|
||||
{
|
||||
// does this even do anything anymore?
|
||||
gamestate = GS_HIDECONSOLE;
|
||||
}
|
||||
|
||||
inputState.ClearAllInput();
|
||||
gi->FreeLevelData();
|
||||
DoLoadGame(filename);
|
||||
BackupSaveGame = filename;
|
||||
DoLoadGame(savename);
|
||||
BackupSaveGame = savename;
|
||||
}
|
||||
|
||||
extern bool sendsave;
|
||||
|
|
|
@ -11,9 +11,10 @@ class FileReader;
|
|||
FString G_BuildSaveName (const char *prefix);
|
||||
int G_ValidateSavegame(FileReader &fr, FString *savetitle, bool formenu);
|
||||
|
||||
void G_LoadGame(const char* filename);
|
||||
void G_LoadGame(const char* filename, bool hidecon = false);
|
||||
void G_SaveGame(const char* fn, const char* desc);
|
||||
void G_DoSaveGame(bool okForQuicksave, bool forceQuicksave, const char* filename, const char* description);
|
||||
void G_DoLoadGame();
|
||||
|
||||
void M_Autosave();
|
||||
|
||||
|
|
Loading…
Reference in a new issue