mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
- fixed savegame loading in Blood.
This commit is contained in:
parent
ba117554b0
commit
def63209be
2 changed files with 12 additions and 6 deletions
|
@ -440,15 +440,19 @@ void MyLoadSave::Save(void)
|
||||||
|
|
||||||
void LoadSavedInfo(void)
|
void LoadSavedInfo(void)
|
||||||
{
|
{
|
||||||
FString path = M_GetSavegamesPath() + "%sgame*.sav";
|
FString path = M_GetSavegamesPath() + "game*.sav";
|
||||||
TArray<FString> saves;
|
TArray<FString> saves;
|
||||||
D_AddWildFile(saves, path);
|
D_AddWildFile(saves, path);
|
||||||
int nCount = 0;
|
int nCount = 0;
|
||||||
for (auto & savename : saves)
|
for (auto & savename : saves)
|
||||||
{
|
{
|
||||||
auto hFile = fopenFileReader(savename, 0);
|
OpenSaveGameForRead(savename);
|
||||||
if (!hFile.isOpen())
|
auto hFile = ReadSavegameChunk("snapshot.bld");
|
||||||
ThrowError("Error loading save file header.");
|
if (!hFile.isOpen())
|
||||||
|
{
|
||||||
|
FinishSavegameRead();
|
||||||
|
ThrowError("Error loading save file header.");
|
||||||
|
}
|
||||||
int vc;
|
int vc;
|
||||||
short v4;
|
short v4;
|
||||||
vc = 0;
|
vc = 0;
|
||||||
|
@ -471,6 +475,7 @@ void LoadSavedInfo(void)
|
||||||
strcpy(strRestoreGameStrings[gSaveGameOptions[nCount].nSaveGameSlot], gSaveGameOptions[nCount].szUserGameName);
|
strcpy(strRestoreGameStrings[gSaveGameOptions[nCount].nSaveGameSlot], gSaveGameOptions[nCount].szUserGameName);
|
||||||
nCount++;
|
nCount++;
|
||||||
}
|
}
|
||||||
|
FinishSavegameRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateSavedInfo(int nSlot)
|
void UpdateSavedInfo(int nSlot)
|
||||||
|
|
|
@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "cmdlib.h"
|
||||||
#include "i_specialpaths.h"
|
#include "i_specialpaths.h"
|
||||||
|
|
||||||
EXTERN_CVAR(Bool, hud_powerupduration)
|
EXTERN_CVAR(Bool, hud_powerupduration)
|
||||||
|
@ -2120,7 +2121,7 @@ void LoadGame(CGameMenuItemZEditBitmap *pItem, CGameMenuEvent *event)
|
||||||
if (gGameOptions.nGameType > 0)
|
if (gGameOptions.nGameType > 0)
|
||||||
return;
|
return;
|
||||||
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), nSlot);
|
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), nSlot);
|
||||||
if (!testkopen(strLoadGameName, 0))
|
if (!FileExists(strLoadGameName))
|
||||||
return;
|
return;
|
||||||
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[nSlot]);
|
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[nSlot]);
|
||||||
videoNextPage();
|
videoNextPage();
|
||||||
|
@ -2135,7 +2136,7 @@ void QuickLoadGame(void)
|
||||||
if (gGameOptions.nGameType > 0)
|
if (gGameOptions.nGameType > 0)
|
||||||
return;
|
return;
|
||||||
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), gQuickLoadSlot);
|
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), gQuickLoadSlot);
|
||||||
if (!testkopen(strLoadGameName, 0))
|
if (!FileExists(strLoadGameName))
|
||||||
return;
|
return;
|
||||||
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[gQuickLoadSlot]);
|
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[gQuickLoadSlot]);
|
||||||
videoNextPage();
|
videoNextPage();
|
||||||
|
|
Loading…
Reference in a new issue