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
This commit is contained in:
Torbjörn Andersson 2004-07-08 10:47:44 +00:00
parent a52cac7069
commit b0cf75722e

View File

@ -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();
}
}