[Scummvm-cvs-logs] SF.net SVN: scummvm:[49619] scummvm/trunk/engines/parallaction/walk.cpp
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Jun 13 08:55:40 CEST 2010
Revision: 49619
http://scummvm.svn.sourceforge.net/scummvm/?rev=49619&view=rev
Author: peres001
Date: 2010-06-13 06:55:40 +0000 (Sun, 13 Jun 2010)
Log Message:
-----------
Keep the balloon from getting stuck in an infinite loop when floating near the borders of the screen.
See the detailed explanation in walk.cpp.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/walk.cpp
Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp 2010-06-13 06:55:24 UTC (rev 49618)
+++ scummvm/trunk/engines/parallaction/walk.cpp 2010-06-13 06:55:40 UTC (rev 49619)
@@ -626,6 +626,19 @@
int xStep = (scale * 16) / 100 + 1;
int yStep = (scale * 10) / 100 + 1;
+
+ /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a
+ Character) is controlled by the user (for movement, via this walking code) and by the scripts
+ (to simulate the balloon floating in the air, in a neverending loop that alters the position
+ coordinates).
+ When the two step sizes are equal in magnitude and opposite in direction, then the walk code
+ enters an infinite loop without giving control back to the user (this happens quite frequently
+ when navigating the balloon near the borders of the screen, where the calculated step is
+ forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr)
+ uses increments of 3 for both x and y, we tweak the calculated steps accordingly here. */
+ if (xStep == 3) xStep--;
+ if (yStep == 3) yStep--;
+
debugC(9, kDebugWalk, "calculated step: (%i, %i)", xStep, yStep);
s._fieldC = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list