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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 15 16:55:52 CEST 2010


Revision: 49857
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49857&view=rev
Author:   thebluegr
Date:     2010-06-15 14:55:52 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Fixed detective Mosely's hotspot in GK1 (day 1)

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 13:52:06 UTC (rev 49856)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp	2010-06-15 14:55:52 UTC (rev 49857)
@@ -792,12 +792,18 @@
 	nsRect.top = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsTop));
 	nsRect.right = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsRight));
 	nsRect.bottom = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsBottom));
-
 	uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
 	uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y));
+	if (nsRect.left < 0 || nsRect.top < 0) {
+		// If top and left are negative, we need to adjust coordinates by the item's x and y
+		nsRect.translate(itemX, itemY);
+	}
+
+	// HACK: nsLeft and nsTop can be invalid, so try and fix them here using x and y
+	// (e.g. with the inventory screen in GK1 or detective Mosely in his office)
+	// Not sure why this is happening, but at least this hack fixes most of the issues
 	if (nsRect.left == itemY && nsRect.top == itemX) {
-		// FIXME: Why is this happening??
-		// Swap the values, as they're inversed(eh???)
+		// Swap the values, as they're inversed (eh???)
 		nsRect.left = itemX;
 		nsRect.top = itemY;
 	}


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