aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2009-06-04 09:30:12 +0000
committerTravis Howell2009-06-04 09:30:12 +0000
commitbf212d7b2f4f3b8851a6cd44c4c922cf0f46f94b (patch)
tree3e826a5ba0265147d138c0889ba4e4b9de479988
parent3a64d35dfd9126d7912c4d4496030f7ed120d660 (diff)
downloadscummvm-rg350-bf212d7b2f4f3b8851a6cd44c4c922cf0f46f94b.tar.gz
scummvm-rg350-bf212d7b2f4f3b8851a6cd44c4c922cf0f46f94b.tar.bz2
scummvm-rg350-bf212d7b2f4f3b8851a6cd44c4c922cf0f46f94b.zip
Fix regression in copyWizImageWithMask, which caused corruption in readtime.
svn-id: r41157
-rw-r--r--engines/scumm/he/wiz_he.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 1c3867b980..ff58623479 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -450,7 +450,7 @@ void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int d
if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
return;
}
- dstw = dstw / 8;
+ dstPitch /= 8;
dst += dstRect.top * dstPitch + dstRect.left / 8;
const uint8 *dataPtr, *dataPtrNext;
@@ -1447,9 +1447,11 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int
case 1:
if (flags & 0x80) {
dst = _vm->getMaskBuffer(0, 0, 1);
+ dstPitch = _vm->_bitDepth;
copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 2);
} else if (flags & 0x100) {
dst = _vm->getMaskBuffer(0, 0, 1);
+ dstPitch /= _vm->_bitDepth;
copyWizImageWithMask(dst, wizd, dstPitch, cw, ch, x1, y1, width, height, &rScreen, 0, 1);
} else {
copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth);