aboutsummaryrefslogtreecommitdiff
path: root/scumm/gfx.cpp
diff options
context:
space:
mode:
authorMax Horn2002-12-31 16:44:55 +0000
committerMax Horn2002-12-31 16:44:55 +0000
commit8bbbf4cbaf34b6671e62c5ffa57450bc0272230c (patch)
treee6ed1455637ea2ab84037455bc0a8d4a2851af13 /scumm/gfx.cpp
parent250304c7ee11293283b64a31cca92caf282878ad (diff)
downloadscummvm-rg350-8bbbf4cbaf34b6671e62c5ffa57450bc0272230c.tar.gz
scummvm-rg350-8bbbf4cbaf34b6671e62c5ffa57450bc0272230c.tar.bz2
scummvm-rg350-8bbbf4cbaf34b6671e62c5ffa57450bc0272230c.zip
cleanup; fixed z masking in COMI
svn-id: r6294
Diffstat (limited to 'scumm/gfx.cpp')
-rw-r--r--scumm/gfx.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 8f311f8ce5..750c7fd928 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -833,7 +833,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
// might fail. Still, doing this properly would have the advantage of catching
// invalid/damaged data files, and allow us to exit gracefully instead of segfaulting.
for (i = 1; i < numzbuf; i++) {
- zplane_list[i] = zplnOffsChunkStart + READ_LE_UINT32(zplnOffsChunkStart + 4 + i*4) + 12;
+ zplane_list[i] = zplnOffsChunkStart + READ_LE_UINT32(zplnOffsChunkStart + 4 + i*4) + 16;
}
// A small hack to skip to the BSTR->WRAP->OFFS chunk
@@ -961,6 +961,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
} else {
decompressMaskImg(_mask_ptr_dest, z_plane_ptr, h);
}
+
} else {
if (!(useOrDecompress && (flag & dbAllowMaskOr)))
for (int height = 0; height < h; height++)
@@ -1184,8 +1185,8 @@ void Gdi::clear8Col(byte *dst, int height)
void Gdi::decompressMaskImg(byte *dst, byte *src, int height)
{
byte b, c;
-
- while (1) {
+
+ while (height) {
b = *src++;
if (b & 0x80) {
@@ -1195,16 +1196,14 @@ void Gdi::decompressMaskImg(byte *dst, byte *src, int height)
do {
*dst = c;
dst += _numStrips;
- if (!--height)
- return;
- } while (--b);
+ --height;
+ } while (--b && height);
} else {
do {
*dst = *src++;
dst += _numStrips;
- if (!--height)
- return;
- } while (--b);
+ --height;
+ } while (--b && height);
}
}
}
@@ -1213,7 +1212,7 @@ void Gdi::decompressMaskImgOr(byte *dst, byte *src, int height)
{
byte b, c;
- while (1) {
+ while (height) {
b = *src++;
if (b & 0x80) {
@@ -1223,16 +1222,14 @@ void Gdi::decompressMaskImgOr(byte *dst, byte *src, int height)
do {
*dst |= c;
dst += _numStrips;
- if (!--height)
- return;
- } while (--b);
+ --height;
+ } while (--b && height);
} else {
do {
*dst |= *src++;
dst += _numStrips;
- if (!--height)
- return;
- } while (--b);
+ --height;
+ } while (--b && height);
}
}
}