[Scummvm-cvs-logs] SF.net SVN: scummvm: [25603] scummvm/trunk/engines/scumm/scumm.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Feb 15 12:56:18 CET 2007


Revision: 25603
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25603&view=rev
Author:   fingolfin
Date:     2007-02-15 03:56:17 -0800 (Thu, 15 Feb 2007)

Log Message:
-----------
Fix for bug #1328131 (MANIACNES: Inventory hotspots can be misaligned) and its dup #1537595 (MANIACNES: Heavy script bug)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/scumm.cpp

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2007-02-15 11:48:17 UTC (rev 25602)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2007-02-15 11:56:17 UTC (rev 25603)
@@ -1917,7 +1917,7 @@
 		VAR(VAR_CAMERA_POS_X) = camera._cur.x;
 		VAR(VAR_CAMERA_POS_Y) = camera._cur.y;
 	} else if (_game.version <= 2) {
-		VAR(VAR_CAMERA_POS_X) = camera._cur.x / 8;
+		VAR(VAR_CAMERA_POS_X) = camera._cur.x / V12_X_MULTIPLIER;
 	} else {
 		VAR(VAR_CAMERA_POS_X) = camera._cur.x;
 	}
@@ -1934,8 +1934,11 @@
 			VAR(VAR_DEBUGMODE) = _debugMode;
 		}
 	} else if (_game.version >= 1) {
-		VAR(VAR_VIRT_MOUSE_X) = _virtualMouse.x / 8;
-		VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y / 2;
+		// We use shifts below instead of dividing by V12_X_MULTIPLIER resp.
+		// V12_Y_MULTIPLIER to handle negative coordinates correctly.
+		// This fixes e.g. bugs #1328131 and #1537595.
+		VAR(VAR_VIRT_MOUSE_X) = _virtualMouse.x >> 3;	// V12_X_MULTIPLIER
+		VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y >> 1;	// V12_X_MULTIPLIER
 
 		// Adjust mouse coordinates as narrow rooms in NES are centered
 		if (_game.platform == Common::kPlatformNES && _NESStartStrip > 0) {


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