[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.340,2.341
Max Horn
fingolfin at users.sourceforge.net
Sun Sep 26 13:38:03 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30981
Modified Files:
gfx.cpp
Log Message:
Properly fix actor redrawing in V7_SMOOTH_SCROLLING_HACK mode
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.340
retrieving revision 2.341
diff -u -d -r2.340 -r2.341
--- gfx.cpp 26 Sep 2004 18:09:48 -0000 2.340
+++ gfx.cpp 26 Sep 2004 20:32:57 -0000 2.341
@@ -323,27 +323,26 @@
if (virt == kMainVirtScreen && dirtybit) {
#ifdef V7_SMOOTH_SCROLLING_HACK
- if (_version >= 7) {
- // FIXME / HACK: This is a hack to fix an actor redraw glitch
- // in V7_SMOOTH_SCROLLING_HACK mode. Right now I have no idea
- // why this hack is needed, but for now it works well enough.
- lp = left / 8 + _screenStartStrip - 1;
- //lp = (left + vs->xstart) / 8;
- } else
-#endif
+ // TODO / FIXME: I *think* the next (commented out) line is
+ // what we should be doing; but if I enable it instead of the
+ // old way to compute lp, we get redraw glitches. Not sure why
+ // (maybe my logic is simply flawed, I just don't see how).
+ //lp = (left + vs->xstart) / 8;
lp = left / 8 + _screenStartStrip;
+#else
+ lp = left / 8 + _screenStartStrip;
+#endif
if (lp < 0)
lp = 0;
- if (_version >= 7) {
#ifdef V7_SMOOTH_SCROLLING_HACK
- rp = (right + vs->xstart) / 8;
+ rp = (right + vs->xstart) / 8;
#else
- rp = right / 8 + _screenStartStrip;
+ rp = right / 8 + _screenStartStrip;
#endif
+ if (_version >= 7) {
if (rp > 409)
rp = 409;
} else {
- rp = right / 8 + _screenStartStrip;
if (rp >= 200)
rp = 200;
}
@@ -1755,8 +1754,8 @@
if (bottom > vs->bdirty[strip])
vs->bdirty[strip] = bottom;
- bgbak_ptr = vs->getBackPixels(strip * 8, top);
- backbuff_ptr = vs->getPixels(strip * 8, top);
+ bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8;
+ backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8;
numLinesToProcess = bottom - top;
if (numLinesToProcess) {
More information about the Scummvm-git-logs
mailing list