diff options
author | Max Horn | 2002-12-31 16:44:55 +0000 |
---|---|---|
committer | Max Horn | 2002-12-31 16:44:55 +0000 |
commit | 8bbbf4cbaf34b6671e62c5ffa57450bc0272230c (patch) | |
tree | e6ed1455637ea2ab84037455bc0a8d4a2851af13 /scumm | |
parent | 250304c7ee11293283b64a31cca92caf282878ad (diff) | |
download | scummvm-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')
-rw-r--r-- | scumm/actor.cpp | 2 | ||||
-rw-r--r-- | scumm/gfx.cpp | 29 |
2 files changed, 14 insertions, 17 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 43b9cd1731..2442e8fa73 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -989,7 +989,7 @@ void Actor::drawActorCostume() ar.clipping = forceClip; if (ar.clipping == 100) { ar.clipping = _vm->getMaskFromBox(walkbox); - if (ar.clipping > (byte)_vm->gdi._numZBuffer) + if (ar.clipping > _vm->gdi._numZBuffer) ar.clipping = _vm->gdi._numZBuffer; } 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); } } } |