mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
if saveslot specified with -x doesn't exist, show restore menu
svn-id: r10256
This commit is contained in:
parent
fe349d2d99
commit
ffd39dc95a
@ -468,6 +468,19 @@ uint32 GetSaveDescription(uint16 slotNo, uint8 *description) // (James05feb97)
|
||||
return(SR_OK);
|
||||
}
|
||||
|
||||
bool SaveExists(uint16 slotNo) {
|
||||
char saveFileName[MAX_FILENAME_LEN];
|
||||
SaveFileManager *mgr = g_system->get_savefile_manager();
|
||||
|
||||
sprintf(saveFileName, "%s.%.3d", g_sword2->_game_name, slotNo); // construct filename
|
||||
|
||||
if (!(mgr->open_savefile(saveFileName, g_sword2->getSavePath(), false)))
|
||||
return(false);
|
||||
delete mgr;
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------------
|
||||
void GetPlayerStructures(void) // James27feb97
|
||||
|
@ -29,6 +29,7 @@
|
||||
uint32 SaveGame(uint16 slotNo, uint8 *description);
|
||||
uint32 RestoreGame(uint16 slotNo);
|
||||
uint32 GetSaveDescription(uint16 slotNo, uint8 *description);
|
||||
bool SaveExists(uint16 slotNo);
|
||||
void FillSaveBuffer(mem *buffer, uint32 size, uint8 *desc);
|
||||
uint32 RestoreFromBuffer(mem *buffer, uint32 size);
|
||||
uint32 FindBufferSize( void );
|
||||
|
@ -310,10 +310,15 @@ void Sword2State::go()
|
||||
Zdebug("RETURNED from InitialiseGame - ok");
|
||||
|
||||
|
||||
|
||||
if (_saveSlot != -1)
|
||||
RestoreGame(_saveSlot);
|
||||
else
|
||||
if (_saveSlot != -1) {
|
||||
if (SaveExists(_saveSlot))
|
||||
RestoreGame(_saveSlot);
|
||||
else { // show restore menu
|
||||
Set_mouse(NORMAL_MOUSE_ID);
|
||||
if (!Restore_control())
|
||||
Start_game();
|
||||
}
|
||||
} else
|
||||
Start_game();
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user