aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp20
-rw-r--r--scumm/object.cpp36
2 files changed, 50 insertions, 6 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index c8fee3c146..ed341641f2 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1838,8 +1838,8 @@ void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom,
lp = (left >> 3) + _screenStartStrip;
if (lp < 0)
lp = 0;
- if (rp >= _realHeight)
- rp = _realHeight;
+ if (rp >= 200)
+ rp = 200;
if (lp <= rp) {
num = rp - lp + 1;
sp = &gfxUsageBits[lp];
@@ -3194,6 +3194,7 @@ void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, in
int src_x, src_y, dst_x, dst_y;
uint scaled_width, scaled_height;
int h = bd->srcheight;
+ byte *mask = NULL;
uint i;
if (h == 0 || bd->srcwidth == 0)
@@ -3217,6 +3218,11 @@ void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, in
}
}
+ // We take charset masking into consideration, because otherwise the
+ // inventory window in The Dig may overwrite text.
+
+ mask = getResourceAddress(rtBuffer, 9) + _screenStartStrip;
+
// Select which rows and columns from the original to show in the
// scaled version of the image. This is a pretty stupid way of scaling
// images, but it will have to do for now.
@@ -3267,8 +3273,11 @@ void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, in
color = *src++;
for (i = 0; i < num; i++) {
if (bd->scale_x == 255 || scale_cols[src_x]) {
- if (dst_x >= 0 && dst_x < bd->outwidth)
- *d = blend(_currentPalette, color, *d);
+ if (dst_x >= 0 && dst_x < bd->outwidth) {
+ if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
+
+ *d = blend(_currentPalette, color, *d);
+ }
d++;
dst_x++;
}
@@ -3278,7 +3287,8 @@ void Scumm::drawBomp(BompDrawData *bd, int param1, byte *dataPtr, int param2, in
for (i = 0; i < num; i++) {
if (bd->scale_x == 255 || scale_cols[src_x]) {
if (dst_x >= 0 && dst_x < bd->outwidth)
- *d = blend(_currentPalette, src[i], *d);
+ if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
+ *d = blend(_currentPalette, src[i], *d);
d++;
dst_x++;
}
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 40896990a7..1a48d8e3a4 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1268,7 +1268,41 @@ void Scumm::removeBlastObjects()
void Scumm::removeBlastObject(BlastObject *eo)
{
- restoreBG(eo->posX, eo->posY, eo->posX + eo->width, eo->posY + eo->height);
+ VirtScreen *vs = &virtscr[0];
+
+ int top, bottom, left, right;
+ int left_strip, right_strip;
+ int i;
+
+ top = eo->posY;
+ bottom = eo->posY + eo->height;
+ left = eo->posX;
+ right = eo->posX + eo->width;
+
+ if (bottom < 0 || right < 0 || top > vs->height || left > vs->width)
+ return;
+
+ if (top < 0)
+ top = 0;
+ if (bottom > vs->height)
+ bottom = vs->height;
+ if (left < 0)
+ left = 0;
+ if (right > vs->width)
+ right = vs->width;
+
+ left_strip = left >> 3;
+ right_strip = (right >> 3) + 1;
+
+ if (left_strip < 0)
+ left_strip = 0;
+ if (right_strip >= 200)
+ right_strip = 200;
+
+ for (i = left_strip; i <= right_strip; i++)
+ gdi.resetBackground(top, bottom, i);
+
+ updateDirtyRect(0, left, right, top, bottom, 0x40000000);
}
int Scumm::findFlObjectSlot()