diff options
author | Torbjörn Andersson | 2004-07-08 10:47:44 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-07-08 10:47:44 +0000 |
commit | b0cf75722e8652636c2b5e3ee512b7252eb3bb98 (patch) | |
tree | 5a52af3216dd1d03837c9e27c5d4794c957d3e31 /scumm/camera.cpp | |
parent | a52cac70690cb0a2a14ea1fef6a3aec1096fd7c6 (diff) | |
download | scummvm-rg350-b0cf75722e8652636c2b5e3ee512b7252eb3bb98.tar.gz scummvm-rg350-b0cf75722e8652636c2b5e3ee512b7252eb3bb98.tar.bz2 scummvm-rg350-b0cf75722e8652636c2b5e3ee512b7252eb3bb98.zip |
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
Diffstat (limited to 'scumm/camera.cpp')
-rw-r--r-- | scumm/camera.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
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(); } } |