[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.50,1.51
James Brown
ender at users.sourceforge.net
Wed Nov 6 00:11:07 CET 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv15303/scumm
Modified Files:
gfx.cpp
Log Message:
Apply restore-bg part of patch 629043
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- gfx.cpp 6 Nov 2002 07:28:38 -0000 1.50
+++ gfx.cpp 6 Nov 2002 08:10:57 -0000 1.51
@@ -1762,8 +1762,8 @@
void Scumm::restoreBG(int left, int top, int right, int bottom)
{
VirtScreen *vs;
- int topline, height, width, widthmod;
- byte *backbuff, *bgbak, *mask;
+ int topline, height, width;
+ byte *backbuff, *bgbak;
if (left == right || top == bottom)
return;
@@ -1798,21 +1798,25 @@
backbuff = vs->screenPtr + height;
bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height;
- mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip;
- if (vs->number == 0) {
- // FIXME: hardcoded value
- mask += vs->topline * 216;
- }
height = bottom - top;
width = right - left;
- widthmod = (width >> 2) + 2;
if (vs->alloctwobuffers && _currentRoom != 0 /*&& _vars[VAR_V5_DRAWFLAGS]&2 */ ) {
blit(backbuff, bgbak, width, height);
if (vs->number == 0 && charset._hasMask && height) {
+ byte *mask;
+ int mask_width = (width >> 3);
+
+ if (width & 0x07)
+ mask_width++;
+
+ mask = getResourceAddress(rtBuffer, 9) + top * gdi._numStrips + (left >> 3) + _screenStartStrip;
+ if (vs->number == 0)
+ mask += vs->topline * gdi._numStrips;
+
do {
- memset(mask, 0, widthmod);
+ memset(mask, 0, mask_width);
mask += gdi._numStrips;
} while (--height);
}
More information about the Scummvm-git-logs
mailing list