mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 04:16:34 +00:00
SCI: kGameIsRestarting returns 2 when we restored
fixes castle of dr. brain save issue in puzzle room, fixes island of dr. brain save issue when saving in first room svn-id: r51538
This commit is contained in:
parent
fd7bc29536
commit
2d76fe0092
@ -46,11 +46,11 @@ reg_t kRestartGame(EngineState *s, int argc, reg_t *argv) {
|
||||
** Returns the restarting_flag in acc
|
||||
*/
|
||||
reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) {
|
||||
s->r_acc = make_reg(0, s->gameWasRestarted);
|
||||
s->r_acc = make_reg(0, s->gameIsRestarting);
|
||||
|
||||
if (argc) { // Only happens during replay
|
||||
if (!argv[0].toUint16()) // Set restarting flag
|
||||
s->gameWasRestarted = false;
|
||||
s->gameIsRestarting = GAMEISRESTARTING_NONE;
|
||||
}
|
||||
|
||||
uint32 neededSleep = 30;
|
||||
|
@ -776,6 +776,9 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
|
||||
s->_msgState = new MessageState(s->_segMan);
|
||||
|
||||
s->abortScriptProcessing = kAbortLoadGame;
|
||||
|
||||
// signal restored game to game scripts
|
||||
s->gameIsRestarting = GAMEISRESTARTING_RESTORE;
|
||||
}
|
||||
|
||||
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
|
||||
|
@ -87,6 +87,12 @@ enum {
|
||||
SAVEGAMEID_OFFICIALRANGE_END = 1999
|
||||
};
|
||||
|
||||
enum {
|
||||
GAMEISRESTARTING_NONE = 0,
|
||||
GAMEISRESTARTING_RESTART = 1,
|
||||
GAMEISRESTARTING_RESTORE = 2
|
||||
};
|
||||
|
||||
class FileHandle {
|
||||
public:
|
||||
Common::String _name;
|
||||
@ -159,7 +165,7 @@ public:
|
||||
int variablesMax[4]; ///< Max. values for all variables
|
||||
|
||||
AbortGameState abortScriptProcessing;
|
||||
bool gameWasRestarted;
|
||||
int16 gameIsRestarting; // is set when restarting (=1) or restoring the game (=2)
|
||||
|
||||
int scriptStepCounter; // Counts the number of steps executed
|
||||
int scriptGCInterval; // Number of steps in between gcs
|
||||
|
@ -290,7 +290,7 @@ bool SciEngine::initGame() {
|
||||
_gamestate->_executionStackPosChanged = false;
|
||||
|
||||
_gamestate->abortScriptProcessing = kAbortNone;
|
||||
_gamestate->gameWasRestarted = false;
|
||||
_gamestate->gameIsRestarting = GAMEISRESTARTING_NONE;
|
||||
|
||||
_gamestate->stack_base = stack->_entries;
|
||||
_gamestate->stack_top = stack->_entries + stack->_capacity;
|
||||
@ -416,7 +416,7 @@ void SciEngine::runGame() {
|
||||
_gamestate->_segMan->resetSegMan();
|
||||
initGame();
|
||||
initStackBaseWithSelector(SELECTOR(play));
|
||||
_gamestate->gameWasRestarted = true;
|
||||
_gamestate->gameIsRestarting = GAMEISRESTARTING_RESTART;
|
||||
if (_gfxMenu)
|
||||
_gfxMenu->reset();
|
||||
_gamestate->abortScriptProcessing = kAbortNone;
|
||||
|
Loading…
x
Reference in New Issue
Block a user