diff options
author | Filippos Karapetis | 2010-06-08 13:16:30 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-08 13:16:30 +0000 |
commit | 5ba761a687d9b908f09b218cc22aec548d98c3f6 (patch) | |
tree | 4699a6241ca02d8f84d9230610635f5090ebedc5 /engines/sci/engine/savegame.cpp | |
parent | fb73cef4d9d481f616576a2779b53ea6c8c48b18 (diff) | |
download | scummvm-rg350-5ba761a687d9b908f09b218cc22aec548d98c3f6.tar.gz scummvm-rg350-5ba761a687d9b908f09b218cc22aec548d98c3f6.tar.bz2 scummvm-rg350-5ba761a687d9b908f09b218cc22aec548d98c3f6.zip |
Made reconstruct_stack() a member of SegManager
svn-id: r49503
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 9bf23dedf5..17dbbc94d9 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -739,15 +739,6 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename return 0; } -// TODO: This should probably be turned into an EngineState or DataStack method. -static void reconstruct_stack(EngineState *retval) { - SegmentId stack_seg = retval->_segMan->findSegmentByType(SEG_TYPE_STACK); - DataStack *stack = (DataStack *)(retval->_segMan->_heap[stack_seg]); - - retval->stack_base = stack->_entries; - retval->stack_top = stack->_entries + stack->_capacity; -} - // TODO: Move thie function to a more appropriate place, such as vm.cpp or script.cpp void SegManager::reconstructScripts(EngineState *s) { uint i; @@ -784,6 +775,14 @@ void SegManager::reconstructScripts(EngineState *s) { } } +void SegManager::reconstructStack(EngineState *s) { + SegmentId stack_seg = findSegmentByType(SEG_TYPE_STACK); + DataStack *stack = (DataStack *)(_heap[stack_seg]); + + s->stack_base = stack->_entries; + s->stack_top = stack->_entries + stack->_capacity; +} + #ifdef USE_OLD_MUSIC_FUNCTIONS static void reconstruct_sounds(EngineState *s) { Song *seeker; @@ -876,10 +875,9 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { s->_soundCmd->updateSfxState(&retval->_sound); #endif - reconstruct_stack(s); + s->_segMan->reconstructStack(s); s->_segMan->reconstructScripts(s); s->_segMan->reconstructClones(); - s->_gameObj = s->_gameObj; s->script_000 = s->_segMan->getScript(s->_segMan->getScriptSegment(0, SCRIPT_GET_DONT_LOAD)); s->gc_countdown = GC_INTERVAL - 1; |