From 3244a79d4675cc50b1e7b4ac05687a9acfcffaf1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 16 May 2003 23:54:58 +0000 Subject: V2 camera fix (again thanks MadMoose) svn-id: r7587 --- scumm/gfx.cpp | 10 ++++++++-- scumm/scummvm.cpp | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 64ad0fb8eb..3cb08329b0 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -2050,7 +2050,10 @@ void Scumm::setCameraAt(int pos_x, int pos_y) { camera._cur.x = (short) VAR(VAR_CAMERA_MAX_X); if (VAR_SCROLL_SCRIPT != 0xFF && VAR(VAR_SCROLL_SCRIPT)) { - VAR(VAR_CAMERA_POS_X) = camera._cur.x; + if (_features & GF_AFTER_V2) + VAR(VAR_CAMERA_POS_X) = camera._cur.x / 8; + else + VAR(VAR_CAMERA_POS_X) = camera._cur.x; runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0); } @@ -2274,7 +2277,10 @@ void Scumm::moveCamera() { cameraMoved(); if (VAR_SCROLL_SCRIPT != 0xFF && VAR(VAR_SCROLL_SCRIPT) && pos != camera._cur.x) { - VAR(VAR_CAMERA_POS_X) = camera._cur.x; + if (_features & GF_AFTER_V2) + VAR(VAR_CAMERA_POS_X) = camera._cur.x / 8; + else + VAR(VAR_CAMERA_POS_X) = camera._cur.x; runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0); } } diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index f988ed0f89..15a007b24b 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -877,6 +877,8 @@ int Scumm::scummLoop(int delta) { if (_features & GF_AFTER_V7) { VAR(VAR_CAMERA_POS_X) = camera._cur.x; VAR(VAR_CAMERA_POS_Y) = camera._cur.y; + } else if (_features & GF_AFTER_V2) { + VAR(VAR_CAMERA_POS_X) = camera._cur.x / 8; } else { VAR(VAR_CAMERA_POS_X) = camera._cur.x; } -- cgit v1.2.3