From b0cf75722e8652636c2b5e3ee512b7252eb3bb98 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 8 Jul 2004 10:47:44 +0000 Subject: Experimental fix for bugs #795938 and #929242. In both cases, text is apparently printed before cameraMoved() has had the chance to update xstart of virtscr[0]. All this change does is to call cameraMoved() from setCameraAt(). svn-id: r14177 --- scumm/camera.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scumm/camera.cpp') diff --git a/scumm/camera.cpp b/scumm/camera.cpp index 47bd246858..5fb48ee8e4 100644 --- a/scumm/camera.cpp +++ b/scumm/camera.cpp @@ -77,11 +77,18 @@ void ScummEngine_v7::setCameraAt(int pos_x, int pos_y) { assert(camera._cur.x >= (_screenWidth / 2) && camera._cur.y >= (_screenHeight / 2)); - if ((camera._cur.x != old.x || camera._cur.y != old.y) - && VAR(VAR_SCROLL_SCRIPT)) { - VAR(VAR_CAMERA_POS_X) = camera._cur.x; - VAR(VAR_CAMERA_POS_Y) = camera._cur.y; - runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0); + if (camera._cur.x != old.x || camera._cur.y != old.y) { + if (VAR(VAR_SCROLL_SCRIPT)) { + VAR(VAR_CAMERA_POS_X) = camera._cur.x; + VAR(VAR_CAMERA_POS_Y) = camera._cur.y; + runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0); + } + + // Even though cameraMoved() is called automatically, we may + // need to know at once that the camera has moved, or text may + // be printed at the wrong coordinates. See bugs #795938 and + // #929242 + cameraMoved(); } } -- cgit v1.2.3