diff options
author | Alyssa Milburn | 2011-07-16 20:05:30 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-16 20:05:30 +0200 |
commit | 6f80bce8167536153592a1f70144362972ae5157 (patch) | |
tree | bc51cd364e9b30f3b4c1d60cf7b249f43a905068 | |
parent | 1cf09e3fbf5e64183e82b8845f083ed05bc3149d (diff) | |
download | scummvm-rg350-6f80bce8167536153592a1f70144362972ae5157.tar.gz scummvm-rg350-6f80bce8167536153592a1f70144362972ae5157.tar.bz2 scummvm-rg350-6f80bce8167536153592a1f70144362972ae5157.zip |
COMPOSER: Add the remaining bitmap decompressors (SLW8 is still buggy).
-rw-r--r-- | engines/composer/composer.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index cbb80d47d5..b47a2fec72 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -1392,6 +1392,50 @@ void ComposerEngine::decompressBitmap(uint16 type, Common::SeekableReadStream *s assert(size == width * height); stream->read(buffer, size); break; + case kBitmapSpp32: + byte lookup[16]; + stream->read(lookup, 16); + while (size--) { + uint in = stream->readByte(); + byte lowBits = in & 0xF; + byte highBits = (in & 0xF0) >> 4; + if (highBits == 0xf) { + // run of a single color + uint count = (uint)stream->readByte() + 3; + size--; + memset(buffer, lookup[lowBits], count); + buffer += count; + } else { + // two pixels + *buffer++ = lookup[highBits]; + *buffer++ = lookup[lowBits]; + } + } + break; + case kBitmapSLW8: + while (size--) { + byte val = stream->readByte(); + if (val != 0xff) { + *buffer++ = val; + continue; + } + uint count = stream->readByte(); + size--; + + uint16 step; + if (!(count & 0x80)) { + step = stream->readByte(); + size--; + } else { + count = (count ^ 0x80); + step = stream->readUint16LE(); + size -= 2; + } + count += 4; + memcpy(buffer, buffer - step - 1, count); + buffer += count; + } + break; case kBitmapRLESLWM: { uint32 bufSize = stream->readUint32LE(); |