[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.109,2.110
Max Horn
fingolfin at users.sourceforge.net
Mon Sep 27 13:49:20 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4638/scumm
Modified Files:
charset.cpp
Log Message:
Perform some more clipping -- yet another attempt at bug #1033857 :-)
Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.109
retrieving revision 2.110
diff -u -d -r2.109 -r2.110
--- charset.cpp 26 Sep 2004 16:53:51 -0000 2.109
+++ charset.cpp 27 Sep 2004 20:42:10 -0000 2.110
@@ -1327,9 +1327,24 @@
// any spots where I can test this...
if (!_ignoreCharsetMask)
warning("This might be broken -- please report where you encountered this to Fingolfin");
- int h = height;
+
+ // Perform some clipping
+ int w = MIN(width, dstSurface.w - _left);
+ int h = MIN(height, dstSurface.h - drawTop);
+ if (_left < 0) {
+ w += _left;
+ back -= _left;
+ dst -= _left;
+ }
+ if (drawTop < 0) {
+ h += drawTop;
+ back -= drawTop * backSurface.pitch;
+ dst -= drawTop * dstSurface.pitch;
+ }
+
+ // Blit the image data
do {
- memcpy(back, dst, width);
+ memcpy(back, dst, w);
back += backSurface.pitch;
dst += dstSurface.pitch;
} while (--h);
More information about the Scummvm-git-logs
mailing list