diff options
author | Max Horn | 2004-04-04 01:11:27 +0000 |
---|---|---|
committer | Max Horn | 2004-04-04 01:11:27 +0000 |
commit | e3e9ba99ee12afcfb9e099bf438716d8247ae7c6 (patch) | |
tree | c7c4f394c82fc07f13e4b9818d4f35350587cb85 /scumm | |
parent | a4e424a4fe8f339e765d761661e30c7d4d5a5e7c (diff) | |
download | scummvm-rg350-e3e9ba99ee12afcfb9e099bf438716d8247ae7c6.tar.gz scummvm-rg350-e3e9ba99ee12afcfb9e099bf438716d8247ae7c6.tar.bz2 scummvm-rg350-e3e9ba99ee12afcfb9e099bf438716d8247ae7c6.zip |
Fix for bug #885466 (FT: Text gets drawn under moving bits), by making AKOS codec 16 honor the charset mask
svn-id: r13455
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 54 | ||||
-rw-r--r-- | scumm/akos.h | 3 |
2 files changed, 17 insertions, 40 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 0e7cc805c9..7f786ee585 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -882,36 +882,12 @@ void AkosRenderer::akos16DecodeLine(byte *buf, int32 numbytes, int32 dir) { } } -void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency) { - byte *tmp_buf = akos16.buffer; - - if (dir < 0) { - dest -= (t_width - 1); - tmp_buf += (t_width - 1); - } - - akos16SetupBitReader(src); - - if (numskip_before != 0) { - akos16SkipData(numskip_before); - } - - assert(t_height > 0); - assert(t_width > 0); - while (t_height--) { - akos16DecodeLine(tmp_buf, t_width, dir); - bompApplyShadow(_shadow_mode, _shadow_table, akos16.buffer, dest, t_width, transparency); - - if (numskip_after != 0) { - akos16SkipData(numskip_after); - } - dest += pitch; - } -} - -void AkosRenderer::akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte * maskptr, int32 bitpos_start) { +void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, + int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf) { byte *tmp_buf = akos16.buffer; int maskpitch; + byte *maskptr = 0, *charsetMask = 0; + const byte maskbit = revBitMask[maskLeft & 7]; if (dir < 0) { dest -= (t_width - 1); @@ -925,19 +901,27 @@ void AkosRenderer::akos16DecompressMask(byte *dest, int32 pitch, const byte *src } maskpitch = _numStrips; + + charsetMask = _vm->getMaskBuffer(maskLeft, maskTop, 0); + if (zBuf != 0) + maskptr = _vm->getMaskBuffer(maskLeft, maskTop, zBuf); assert(t_height > 0); assert(t_width > 0); while (t_height--) { akos16DecodeLine(tmp_buf, t_width, dir); - bompApplyMask(akos16.buffer, maskptr, (byte)bitpos_start, t_width, transparency); + bompApplyMask(akos16.buffer, charsetMask, maskbit, t_width, transparency); + if (maskptr) { + bompApplyMask(akos16.buffer, maskptr, maskbit, t_width, transparency); + maskptr += maskpitch; + } bompApplyShadow(_shadow_mode, _shadow_table, akos16.buffer, dest, t_width, transparency); if (numskip_after != 0) { akos16SkipData(numskip_after); } dest += pitch; - maskptr += maskpitch; + charsetMask += maskpitch; } } @@ -1040,15 +1024,9 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { int32 numskip_before = skip_x + (skip_y * _width); int32 numskip_after = _width - cur_x; - byte *dest = _outptr + width_unk + height_unk * _outwidth; + byte *dst = _outptr + width_unk + height_unk * _outwidth; - if (_zbuf == 0) { - akos16Decompress(dest, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency); - } else { - byte *ptr = _vm->getMaskBuffer(clip.left, clip.top, _zbuf); - akos16DecompressMask(dest, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, ptr, clip.left / 8); - } - + akos16Decompress(dst, pitch, _srcptr, cur_x, out_height, dir, numskip_before, numskip_after, transparency, clip.left, clip.top, _zbuf); return 0; } diff --git a/scumm/akos.h b/scumm/akos.h index 1715fb89d4..c38622b2f4 100644 --- a/scumm/akos.h +++ b/scumm/akos.h @@ -96,8 +96,7 @@ protected: void akos16SetupBitReader(const byte *src); void akos16SkipData(int32 numskip); void akos16DecodeLine(byte *buf, int32 numbytes, int32 dir); - void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency); - void akos16DecompressMask(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, byte *maskptr, int32 bitpos_start); + void akos16Decompress(byte *dest, int32 pitch, const byte *src, int32 t_width, int32 t_height, int32 dir, int32 numskip_before, int32 numskip_after, byte transparency, int maskLeft, int maskTop, int zBuf); }; } // End of namespace Scumm |