aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-05-27 23:23:26 +0000
committerMax Horn2003-05-27 23:23:26 +0000
commit73db1d6f51d7332e98a2a407c2d2f5038a67b1d8 (patch)
tree3c946d367460dfbf786e37a93ffc6da0c947b814 /scumm
parent21b41a5456f65203cdde8619703e3452de645e49 (diff)
downloadscummvm-rg350-73db1d6f51d7332e98a2a407c2d2f5038a67b1d8.tar.gz
scummvm-rg350-73db1d6f51d7332e98a2a407c2d2f5038a67b1d8.tar.bz2
scummvm-rg350-73db1d6f51d7332e98a2a407c2d2f5038a67b1d8.zip
Patch #744448: ALL: restoreBG() doesn't always completely remove the mask
svn-id: r8038
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 9131d50cf3..6451860a26 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -844,9 +844,13 @@ void Scumm::restoreBG(ScummVM::Rect rect, byte backColor) {
blit(backbuff, bgbak, width, height);
if (vs->number == 0 && _charset->_hasMask && height) {
byte *mask;
- int mask_width = (width >> 3);
+ // Note: At first sight it may look as if this could
+ // be optimized to (rect.right - rect.left) >> 3 and
+ // thus to width >> 3, but that's not the case since
+ // we are dealing with integer math here.
+ int mask_width = (rect.right >> 3) - (rect.left >> 3);
- if (width & 0x07)
+ if (rect.right & 0x07)
mask_width++;
mask = getResourceAddress(rtBuffer, 9) + rect.top * gdi._numStrips + (rect.left >> 3) + _screenStartStrip;