[Scummvm-cvs-logs] scummvm master -> 8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf

bluegr md5 at scummvm.org
Tue Feb 15 00:31:19 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8ef4594f9b SCI2+: Set the correct segment for SCI32 strings/arrays when loading


Commit: 8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf
    https://github.com/scummvm/scummvm/commit/8ef4594f9b9016f6b93fc176dd8aea8bdd7d85cf
Author: md5 (md5 at scummvm.org)
Date: 2011-02-14T15:30:33-08:00

Commit Message:
SCI2+: Set the correct segment for SCI32 strings/arrays when loading

This was an omission, observed after a discussion with clone2727

Changed paths:
    engines/sci/engine/savegame.cpp



diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index ea56a2f..610698f 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -144,17 +144,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
 		SegmentType type = (s.isSaving() && mobj) ? mobj->getType() : SEG_TYPE_INVALID;
 		s.syncAsUint32LE(type);
 
-		// If we were saving and mobj == 0, or if we are loading and this is an
-		// entry marked as empty -> skip to next
-		if (type == SEG_TYPE_INVALID)
+		if (type == SEG_TYPE_HUNK) {
+			// Don't save or load HunkTable segments
 			continue;
-
-		// Don't save or load HunkTable segments
-		if (type == SEG_TYPE_HUNK)
+		} else if (type == SEG_TYPE_INVALID) {
+			// If we were saving and mobj == 0, or if we are loading and this is an
+			// entry marked as empty -> skip to next
 			continue;
-
-		// Don't save or load the obsolete system string segments
-		if (type == 5) {
+		} else if (type == 5) {
+			// Don't save or load the obsolete system string segments
 			if (s.isSaving()) {
 				continue;
 			} else {
@@ -169,6 +167,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
 				continue;
 			}
 		}
+#ifdef ENABLE_SCI32
+		else if (type == SEG_TYPE_ARRAY) {
+			// Set the correct segment for SCI32 arrays
+			_arraysSegId = i;
+		} else if (type == SEG_TYPE_STRING) {
+			// Set the correct segment for SCI32 strings
+			_stringSegId = i;
+		}
+#endif
 
 		if (s.isLoading())
 			mobj = SegmentObj::createSegmentObj(type);
@@ -178,7 +185,6 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
 		// Let the object sync custom data
 		mobj->saveLoadWithSerializer(s);
 
-
 		if (type == SEG_TYPE_SCRIPT) {
 			Script *scr = (Script *)mobj;
 






More information about the Scummvm-git-logs mailing list