svn-id: r49521
This commit is contained in:
Filippos Karapetis 2010-06-08 21:21:19 +00:00
parent 6474eaa1b2
commit eafc63e572
3 changed files with 16 additions and 21 deletions

View file

@ -856,9 +856,6 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
s->_sound.sfx_exit(); s->_sound.sfx_exit();
#endif #endif
// Set exec stack base to zero
s->execution_stack_base = 0;
// Now copy all current state information // Now copy all current state information
#ifdef USE_OLD_MUSIC_FUNCTIONS #ifdef USE_OLD_MUSIC_FUNCTIONS

View file

@ -91,20 +91,22 @@ void EngineState::reset(bool isRestoring) {
_memorySegmentSize = 0; _memorySegmentSize = 0;
_soundCmd = 0; _soundCmd = 0;
execution_stack_base = 0;
_executionStackPosChanged = false;
_fileHandles.resize(5); _fileHandles.resize(5);
r_acc = NULL_REG;
restAdjust = 0;
r_prev = NULL_REG;
stack_base = 0; stack_base = 0;
stack_top = 0; stack_top = 0;
abortScriptProcessing = kAbortNone; abortScriptProcessing = kAbortNone;
} }
execution_stack_base = 0;
_executionStackPosChanged = false;
restAdjust = 0;
restAdjustCur = 0;
r_acc = NULL_REG;
r_prev = NULL_REG;
last_wait_time = 0; last_wait_time = 0;
gc_countdown = 0; gc_countdown = 0;

View file

@ -1713,7 +1713,6 @@ void game_run(EngineState **_s) {
if (s->abortScriptProcessing == kAbortRestartGame) { if (s->abortScriptProcessing == kAbortRestartGame) {
s->abortScriptProcessing = kAbortNone; s->abortScriptProcessing = kAbortNone;
s->_executionStack.clear();
s->_executionStackPosChanged = false; s->_executionStackPosChanged = false;
script_init_engine(s); script_init_engine(s);
@ -1726,16 +1725,13 @@ void game_run(EngineState **_s) {
send_selector(s, s->_gameObj, s->_gameObj, s->stack_base, 2, s->stack_base); send_selector(s, s->_gameObj, s->_gameObj, s->stack_base, 2, s->stack_base);
s->gameWasRestarted = true; s->gameWasRestarted = true;
} else if (s->abortScriptProcessing == kAbortLoadGame) {
} else {
if (s->abortScriptProcessing == kAbortLoadGame) {
s->abortScriptProcessing = kAbortNone; s->abortScriptProcessing = kAbortNone;
debugC(2, kDebugLevelVM, "Restarting with replay()"); debugC(2, kDebugLevelVM, "Restarting with replay()");
s->_executionStack.clear();
// Restart with replay // Restart with replay
_init_stack_base_with_selector(s, g_sci->getKernel()->_selectorCache.replay); _init_stack_base_with_selector(s, g_sci->getKernel()->_selectorCache.replay);
send_selector(s, s->_gameObj, s->_gameObj, s->stack_base, 2, s->stack_base); send_selector(s, s->_gameObj, s->_gameObj, s->stack_base, 2, s->stack_base);
} else } else {
break; // exit loop break; // exit loop
} }
} while (true); } while (true);