[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.37.2.2,1.37.2.3
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Mon Mar 1 00:13:02 CET 2004
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8196
Modified Files:
Tag: branch-0-6-0
screen.cpp
Log Message:
When scrolling, force a full redraw not only when the scroll offset changes
but also on the first frame where it doesn't. This is necessary because
parallax layers may be drawn on the *old* scroll offset (for reasons
unknown to me).
To see the bug, walk right from the first screen until you reach the tree.
Notice how the part of the tree you walk behind gets redrawn slightly to
the left.
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.37.2.2
retrieving revision 1.37.2.3
diff -u -d -r1.37.2.2 -r1.37.2.3
--- screen.cpp 1 Mar 2004 04:03:31 -0000 1.37.2.2
+++ screen.cpp 1 Mar 2004 07:53:35 -0000 1.37.2.3
@@ -70,6 +70,11 @@
Logic::_scriptVars[SCROLL_FLAG] = 1;
_fullRefresh = true;
} else if (Logic::_scriptVars[SCROLL_FLAG] == 1) {
+ // Because parallax layers may be drawn on the old scroll offset, we
+ // want a full refresh not only when the scroll offset changes, but
+ // also on the frame where they become the same.
+ if (_oldScrollX != Logic::_scriptVars[SCROLL_OFFSET_X] || _oldScrollY != Logic::_scriptVars[SCROLL_OFFSET_Y])
+ _fullRefresh = true;
_oldScrollX = Logic::_scriptVars[SCROLL_OFFSET_X];
_oldScrollY = Logic::_scriptVars[SCROLL_OFFSET_Y];
int32 distX = inRange(-MAX_SCROLL_DISTANCE, _oldScrollX - offsetX, MAX_SCROLL_DISTANCE);
More information about the Scummvm-git-logs
mailing list