[Scummvm-cvs-logs] CVS: scummvm/scumm camera.cpp,2.25,2.26

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Thu Jul 8 03:48:10 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22680

Modified Files:
	camera.cpp 
Log Message:
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().


Index: camera.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/camera.cpp,v
retrieving revision 2.25
retrieving revision 2.26
diff -u -d -r2.25 -r2.26
--- camera.cpp	29 Jun 2004 10:23:15 -0000	2.25
+++ camera.cpp	8 Jul 2004 10:47:44 -0000	2.26
@@ -77,11 +77,18 @@
 
 	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();
 	}
 }
 





More information about the Scummvm-git-logs mailing list