[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.h,1.88,1.89 gfx.cpp,2.355,2.356 camera.cpp,2.29,2.30
Max Horn
fingolfin at users.sourceforge.net
Fri Oct 1 13:46:20 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26877
Modified Files:
gfx.h gfx.cpp camera.cpp
Log Message:
Smooth scrolling seems to work very well, so I am promoting it now from hack-status to a fully official feature ;-)
Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- gfx.h 30 Sep 2004 23:30:59 -0000 1.88
+++ gfx.h 1 Oct 2004 20:39:47 -0000 1.89
@@ -295,20 +295,6 @@
};
-// We now have mostly working smooth scrolling code in place for V7+ games
-// (i.e. The Dig, Full Throttle and COMI). It seems to work very well so far.
-// One area which still may need some work are the AKOS codecs (except for
-// codec 1, which I already updated): their masking code may need adjustments,
-// similar to the treatment codec 1 received.
-//
-// To understand how we achieve smooth scrolling, first note that with it, the
-// virtual screen strips don't match the display screen strips anymore. To
-// overcome that problem, we simply use a screen pitch that is 8 pixel wider
-// than the actual screen width, and always draw one strip more than needed to
-// the backbuf (of course we have to treat the right border seperately). This
-#define V7_SMOOTH_SCROLLING_HACK
-
-
} // End of namespace Scumm
#endif
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.355
retrieving revision 2.356
diff -u -d -r2.355 -r2.356
--- gfx.cpp 30 Sep 2004 23:30:58 -0000 2.355
+++ gfx.cpp 1 Oct 2004 20:40:03 -0000 2.356
@@ -231,12 +231,22 @@
_textSurface.bytesPerPixel = 1;
_numStrips = _vm->_screenWidth / 8;
-#ifdef V7_SMOOTH_SCROLLING_HACK
+
// Increase the number of screen strips by one; needed for smooth scrolling
if (_vm->_version >= 7) {
+ // We now have mostly working smooth scrolling code in place for V7+ games
+ // (i.e. The Dig, Full Throttle and COMI). It seems to work very well so far.
+ // One area which still may need some work are the AKOS codecs (except for
+ // codec 1, which I already updated): their masking code may need adjustments,
+ // similar to the treatment codec 1 received.
+ //
+ // To understand how we achieve smooth scrolling, first note that with it, the
+ // virtual screen strips don't match the display screen strips anymore. To
+ // overcome that problem, we simply use a screen pitch that is 8 pixel wider
+ // than the actual screen width, and always draw one strip more than needed to
+ // the backbuf (of course we have to treat the right border seperately). This
_numStrips += 1;
}
-#endif
}
void ScummEngine::initVirtScreen(VirtScreenNumber slot, int number, int top, int width, int height, bool twobufs,
@@ -261,13 +271,13 @@
vs->backBuf = NULL;
vs->bytesPerPixel = 1;
vs->pitch = width;
-#ifdef V7_SMOOTH_SCROLLING_HACK
+
if (_version >= 7) {
// Increase the pitch by one; needed to accomodate the extra
// screen strip which we use to implement smooth scrolling.
+ // See Gdi::init()
vs->pitch += 8;
}
-#endif
size = vs->pitch * vs->h;
if (scrollable) {
@@ -324,18 +334,11 @@
bottom = vs->h;
if (virt == kMainVirtScreen && dirtybit) {
-#ifdef V7_SMOOTH_SCROLLING_HACK
- // 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;
+
rp = (right + vs->xstart) / 8;
if (_version >= 7) {
if (rp > 409)
Index: camera.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/camera.cpp,v
retrieving revision 2.29
retrieving revision 2.30
diff -u -d -r2.29 -r2.30
--- camera.cpp 26 Sep 2004 18:09:06 -0000 2.29
+++ camera.cpp 1 Oct 2004 20:40:03 -0000 2.30
@@ -335,11 +335,7 @@
screenLeft = _screenStartStrip * 8;
}
-#ifdef V7_SMOOTH_SCROLLING_HACK
virtscr[0].xstart = screenLeft;
-#else
- virtscr[0].xstart = _screenStartStrip * 8;
-#endif
}
void ScummEngine::panCameraTo(int x, int y) {
More information about the Scummvm-git-logs
mailing list