[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.318,2.319 base-costume.cpp,2.18,2.19
Max Horn
fingolfin at users.sourceforge.net
Fri Sep 24 00:37:05 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28735
Modified Files:
gfx.cpp base-costume.cpp
Log Message:
More V7_SMOOTH_SCROLLING_HACK hackery
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.318
retrieving revision 2.319
diff -u -d -r2.318 -r2.319
--- gfx.cpp 22 Sep 2004 17:57:09 -0000 2.318
+++ gfx.cpp 24 Sep 2004 07:36:28 -0000 2.319
@@ -231,6 +231,16 @@
_textSurface.bytesPerPixel = 1;
_numStrips = _vm->_screenWidth / 8;
+#ifdef V7_SMOOTH_SCROLLING_HACK
+ if (_vm->_version >= 7)
+ _numStrips += 1;
+ // TODO: Just increasing _numStrips isn't sufficient, and will cause
+ // problems in some cases. For example in In rooms which are *exactly* of
+ // width equal to _screenWidth, we now may cause an out-of-bounds access.
+ // One possible soution might be to replace _numStrips by a method
+ // Gdi::getNumStrips() which then returns the proper value, computed
+ // dynamically.
+#endif
}
@@ -256,6 +266,10 @@
vs->backBuf = NULL;
vs->bytesPerPixel = 1;
vs->pitch = width;
+#ifdef V7_SMOOTH_SCROLLING_HACK
+ if (_version >= 7)
+ vs->pitch += 8;
+#endif
size = vs->pitch * vs->h;
if (scrollable) {
@@ -438,7 +452,7 @@
return;
assert(top >= 0 && bottom <= vs->h); // Paranoia checks
- assert(x >= 0 && width <= vs->w);
+ assert(x >= 0 && width <= vs->pitch);
assert(_textSurface.pixels);
assert(_compositeBuf);
@@ -577,7 +591,7 @@
if (findResource(MKID('BMAP'), room) != NULL) {
if (_fullRedraw) {
_bgNeedsRedraw = false;
- gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip, _screenWidth);
+ gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip, virtscr[0].w);
}
cont = false;
} else if (findResource(MKID('SMAP'), room) == NULL) {
Index: base-costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/base-costume.cpp,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -d -r2.18 -r2.19
--- base-costume.cpp 8 Sep 2004 21:14:12 -0000 2.18
+++ base-costume.cpp 24 Sep 2004 07:36:29 -0000 2.19
@@ -34,7 +34,7 @@
else
_outptr = vs.getPixels(0, 0);
- _outwidth = vs.w;
+ _outwidth = vs.pitch;
_outheight = vs.h;
_numStrips = _outwidth / 8;
More information about the Scummvm-git-logs
mailing list