[Scummvm-cvs-logs] scummvm master -> ee09af6a12e26f100a9a0457dcb552707abd4288

clone2727 clone2727 at gmail.com
Tue Feb 15 04:39:48 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:
ee09af6a12 SCI: Fix loading SCI32 games


Commit: ee09af6a12e26f100a9a0457dcb552707abd4288
    https://github.com/scummvm/scummvm/commit/ee09af6a12e26f100a9a0457dcb552707abd4288
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-14T19:38:12-08:00

Commit Message:
SCI: Fix loading SCI32 games

The frames/items in GfxFrameout need to be cleared upon loading

Changed paths:
    engines/sci/engine/savegame.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 610698f..ab355ce 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -47,6 +47,10 @@
 #include "sci/sound/audio.h"
 #include "sci/sound/music.h"
 
+#ifdef ENABLE_SCI32
+#include "sci/graphics/frameout.h"
+#endif
+
 namespace Sci {
 
 
@@ -130,6 +134,13 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
 
 		// Reset _scriptSegMap, to be restored below
 		_scriptSegMap.clear();
+
+#ifdef ENABLE_SCI32
+		// Clear any planes/screen items currently showing so they
+		// don't show up after the load.
+		if (getSciVersion() >= SCI_VERSION_2)
+			g_sci->_gfxFrameout->clear();
+#endif
 	}
 
 	s.skip(4, VER(14), VER(18));		// OBSOLETE: Used to be _exportsAreWide
@@ -166,16 +177,15 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
 				_heap[i] = NULL;	// set as freed
 				continue;
 			}
-		}
 #ifdef ENABLE_SCI32
-		else if (type == SEG_TYPE_ARRAY) {
+		} 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);
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 026a2ff..ab4a2c9 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -58,6 +58,12 @@ GfxFrameout::GfxFrameout(SegManager *segMan, ResourceManager *resMan, GfxCoordAd
 GfxFrameout::~GfxFrameout() {
 }
 
+void GfxFrameout::clear() {
+	_screenItems.clear();
+	_planes.clear();
+	_planePictures.clear();
+}
+
 void GfxFrameout::kernelAddPlane(reg_t object) {
 	PlaneEntry newPlane;
 
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 93d61ba..347ecb9 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -28,6 +28,8 @@
 
 namespace Sci {
 
+class GfxPicture;
+
 struct PlaneEntry {
 	reg_t object;
 	uint16 priority;
@@ -99,6 +101,7 @@ public:
 
 	void addPlanePicture(reg_t object, GuiResourceId pictureId, uint16 startX);
 	void deletePlanePictures(reg_t object);
+	void clear();
 
 private:
 	SegManager *_segMan;






More information about the Scummvm-git-logs mailing list