mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 01:11:15 +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 gametic;
|
||||||
int intermissiondelay;
|
int intermissiondelay;
|
||||||
|
|
||||||
|
FString savename;
|
||||||
FString BackupSaveGame;
|
FString BackupSaveGame;
|
||||||
|
|
||||||
void DoLoadGame(const char* name);
|
void DoLoadGame(const char* name);
|
||||||
|
@ -257,6 +258,12 @@ static void GameTicker()
|
||||||
savedescription = "";
|
savedescription = "";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ga_loadgame:
|
||||||
|
case ga_loadgamehidecon:
|
||||||
|
//case ga_autoloadgame:
|
||||||
|
G_DoLoadGame();
|
||||||
|
break;
|
||||||
|
|
||||||
case ga_autosave:
|
case ga_autosave:
|
||||||
if (gamestate == GS_LEVEL && !newGameStarted) M_Autosave();
|
if (gamestate == GS_LEVEL && !newGameStarted) M_Autosave();
|
||||||
newGameStarted = false;
|
newGameStarted = false;
|
||||||
|
|
|
@ -114,7 +114,7 @@ void FSavegameManager::ReadSaveStrings()
|
||||||
|
|
||||||
void FSavegameManager::PerformLoadGame(const char *f, bool s)
|
void FSavegameManager::PerformLoadGame(const char *f, bool s)
|
||||||
{
|
{
|
||||||
G_LoadGame(f);
|
G_LoadGame(f, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSavegameManager::PerformSaveGame(const char *f, const char *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);
|
void WriteSavePic(FileWriter* file, int width, int height);
|
||||||
bool WriteZip(const char* filename, TArray<FString>& filenames, TArray<FCompressedBuffer>& content);
|
bool WriteZip(const char* filename, TArray<FString>& filenames, TArray<FCompressedBuffer>& content);
|
||||||
|
extern FString savename;
|
||||||
extern FString BackupSaveGame;
|
extern FString BackupSaveGame;
|
||||||
|
|
||||||
void SerializeMap(FSerializer &arc);
|
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();
|
inputState.ClearAllInput();
|
||||||
gi->FreeLevelData();
|
gi->FreeLevelData();
|
||||||
DoLoadGame(filename);
|
DoLoadGame(savename);
|
||||||
BackupSaveGame = filename;
|
BackupSaveGame = savename;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool sendsave;
|
extern bool sendsave;
|
||||||
|
|
|
@ -11,9 +11,10 @@ class FileReader;
|
||||||
FString G_BuildSaveName (const char *prefix);
|
FString G_BuildSaveName (const char *prefix);
|
||||||
int G_ValidateSavegame(FileReader &fr, FString *savetitle, bool formenu);
|
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_SaveGame(const char* fn, const char* desc);
|
||||||
void G_DoSaveGame(bool okForQuicksave, bool forceQuicksave, const char* filename, const char* description);
|
void G_DoSaveGame(bool okForQuicksave, bool forceQuicksave, const char* filename, const char* description);
|
||||||
|
void G_DoLoadGame();
|
||||||
|
|
||||||
void M_Autosave();
|
void M_Autosave();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue