diff options
author | Max Horn | 2007-02-15 11:56:17 +0000 |
---|---|---|
committer | Max Horn | 2007-02-15 11:56:17 +0000 |
commit | c584d2f33244834a2b8655dda050e55318c043d2 (patch) | |
tree | 6fd95323a46e0a6af94981d501679f6d531bfe25 /engines/scumm | |
parent | 88f4604400d27b45f7e5bdbe439f67465b419d7b (diff) | |
download | scummvm-rg350-c584d2f33244834a2b8655dda050e55318c043d2.tar.gz scummvm-rg350-c584d2f33244834a2b8655dda050e55318c043d2.tar.bz2 scummvm-rg350-c584d2f33244834a2b8655dda050e55318c043d2.zip |
Fix for bug #1328131 (MANIACNES: Inventory hotspots can be misaligned) and its dup #1537595 (MANIACNES: Heavy script bug)
svn-id: r25603
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/scumm.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index f2268c2a1a..c25603c48d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1917,7 +1917,7 @@ void ScummEngine::scummLoop_updateScummVars() { 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 @@ void ScummEngine::scummLoop_updateScummVars() { 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) { |