From d351c7b9cb6cb46da9bb141c9ca90aba021c1602 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 8 Jul 2009 10:44:25 +0000 Subject: Only the kernel needs to be initialized before anything else, when saving/loading svn-id: r42262 --- engines/sci/engine/savegame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 83f65db81c..e167e7eca8 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -756,18 +756,9 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { // FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch. retval = new EngineState(s->resmgr, s->_version, s->_flags); - // static parser information: - assert(0 == retval->_vocabulary); - retval->_vocabulary = s->_vocabulary; -// s->_vocabulary = 0; // FIXME: We should set s->_vocabulary to 0 here, -// else it could be freed when the old EngineState is freed. Luckily, this freeing currently -// never happens, so we don't need to. - - retval->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE); - // static VM/Kernel information: assert(0 == retval->_kernel); - retval->_kernel = s->_kernel; + retval->_kernel = s->_kernel; // needs to be initialized before _reset_graphics_input is called // s->_kernel = 0; // FIXME: We should set s->_kernel to 0 here, // else it could be freed when the old EngineState is freed. Luckily, this freeing currently // never happens, so we don't need to. @@ -829,6 +820,15 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->last_wait_time = g_system->getMillis(); retval->game_start_time = g_system->getMillis() - retval->game_time * 1000; + // static parser information: + assert(0 == retval->_vocabulary); + retval->_vocabulary = s->_vocabulary; +// s->_vocabulary = 0; // FIXME: We should set s->_vocabulary to 0 here, +// else it could be freed when the old EngineState is freed. Luckily, this freeing currently +// never happens, so we don't need to. + + retval->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE); + // Copy breakpoint information from current game instance retval->have_bp = s->have_bp; retval->bp_list = s->bp_list; -- cgit v1.2.3