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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 15 18:36:09 CEST 2010


Revision: 49862
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49862&view=rev
Author:   thebluegr
Date:     2010-06-15 16:36:09 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Don't adjust the object's coordinates if the object does not belong to a plane in kIsOnMe(). It's now possible to start the interactive part of the Phantasmagoria 1 demo

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel32.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel32.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel32.cpp	2010-06-15 15:50:37 UTC (rev 49861)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp	2010-06-15 16:36:09 UTC (rev 49862)
@@ -834,22 +834,24 @@
 
 	// Get the object's plane
 	reg_t planeObject = readSelector(s->_segMan, targetObject, SELECTOR(plane));
-	uint16 planeResY = readSelectorValue(s->_segMan, planeObject, SELECTOR(resY));
-	uint16 planeResX = readSelectorValue(s->_segMan, planeObject, SELECTOR(resX));
-	uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top));
-	uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left));
-	planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY;
-	planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX;
+	if (!planeObject.isNull()) {
+		uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
+		uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y));
+		uint16 planeResY = readSelectorValue(s->_segMan, planeObject, SELECTOR(resY));
+		uint16 planeResX = readSelectorValue(s->_segMan, planeObject, SELECTOR(resX));
+		uint16 planeTop = readSelectorValue(s->_segMan, planeObject, SELECTOR(top));
+		uint16 planeLeft = readSelectorValue(s->_segMan, planeObject, SELECTOR(left));
+		planeTop = (planeTop * g_sci->_gfxScreen->getHeight()) / planeResY;
+		planeLeft = (planeLeft * g_sci->_gfxScreen->getWidth()) / planeResX;
 
-	// Adjust the bounding rectangle of the object by the object's actual X, Y coordinates
-	uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
-	uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y));
-	itemY = ((itemY * g_sci->_gfxScreen->getHeight()) / planeResY);
-	itemX = ((itemX * g_sci->_gfxScreen->getWidth()) / planeResX);
-	itemY += planeTop;
-	itemX += planeLeft;
+		// Adjust the bounding rectangle of the object by the object's actual X, Y coordinates
+		itemY = ((itemY * g_sci->_gfxScreen->getHeight()) / planeResY);
+		itemX = ((itemX * g_sci->_gfxScreen->getWidth()) / planeResX);
+		itemY += planeTop;
+		itemX += planeLeft;
 
-	nsRect.translate(itemX, itemY);
+		nsRect.translate(itemX, itemY);
+	}
 
 	//warning("kIsOnMe: (%d, %d) on object %04x:%04x, parameter %d", argv[0].toUint16(), argv[1].toUint16(), PRINT_REG(argv[2]), argv[3].toUint16());
 


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