[Scummvm-cvs-logs] SF.net SVN: scummvm:[49503] scummvm/trunk/engines/sci/engine

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 8 15:16:30 CEST 2010


Revision: 49503
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49503&view=rev
Author:   thebluegr
Date:     2010-06-08 13:16:30 +0000 (Tue, 08 Jun 2010)

Log Message:
-----------
Made reconstruct_stack() a member of SegManager

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.h

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-08 13:15:15 UTC (rev 49502)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-08 13:16:30 UTC (rev 49503)
@@ -739,15 +739,6 @@
 	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::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 @@
 	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;
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h	2010-06-08 13:15:15 UTC (rev 49502)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h	2010-06-08 13:16:30 UTC (rev 49503)
@@ -96,6 +96,11 @@
 	void reconstructScripts(EngineState *s);
 
 	/**
+	 * Reconstructs the stack. Used when restoring saved games
+	 */
+	void reconstructStack(EngineState *s);
+
+	/**
 	 * Determines the segment occupied by a certain script, if any.
 	 * @param script_nr		Number of the script to look up
 	 * @return				The script's segment ID, or 0 on failure


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list