[Scummvm-cvs-logs] SF.net SVN: scummvm:[49663] scummvm/trunk/engines/sci/graphics/frameout.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Mon Jun 14 18:58:15 CEST 2010


Revision: 49663
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49663&view=rev
Author:   mthreepwood
Date:     2010-06-14 16:58:15 +0000 (Mon, 14 Jun 2010)

Log Message:
-----------
Ignore and remove invalid plane and item objects in kFrameout. Fixes loading in-game in GK1.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/frameout.cpp

Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-06-14 16:57:43 UTC (rev 49662)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-06-14 16:58:15 UTC (rev 49663)
@@ -126,6 +126,14 @@
 
 	for (uint32 planeNr = 0; planeNr < _planes.size(); planeNr++) {
 		planeObject = _planes[planeNr];
+
+		// Remove any invalid planes
+		if (!_segMan->isObject(planeObject)) {
+			_planes.remove_at(planeNr);
+			planeNr--;
+			continue;
+		}
+
 		planePriority = readSelectorValue(_segMan, planeObject, SELECTOR(priority));
 
 		if (planePriority == -1) // Plane currently not meant to be shown
@@ -161,6 +169,14 @@
 		itemEntry = itemData;
 		for (uint32 itemNr = 0; itemNr < _screenItems.size(); itemNr++) {
 			itemObject = _screenItems[itemNr];
+
+			// Remove any invalid items
+			if (!_segMan->isObject(itemObject)) {
+				_screenItems.remove_at(itemNr);
+				itemNr--;
+				continue;
+			}
+
 			itemPlane = readSelector(_segMan, itemObject, SELECTOR(plane));
 			if (planeObject == itemPlane) {
 				// Found an item on current plane


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