diff options
author | Matthew Hoops | 2011-02-01 03:50:29 +0000 |
---|---|---|
committer | Matthew Hoops | 2011-02-01 03:50:29 +0000 |
commit | 1ac0680a77df8ee59ba2435362bb620ac2bf6e97 (patch) | |
tree | 4cc0987cdd54621ce04d892498629baf4860669a /engines | |
parent | ac4bf4ffb88a9ded5176df32ac5ea2f2790c432d (diff) | |
download | scummvm-rg350-1ac0680a77df8ee59ba2435362bb620ac2bf6e97.tar.gz scummvm-rg350-1ac0680a77df8ee59ba2435362bb620ac2bf6e97.tar.bz2 scummvm-rg350-1ac0680a77df8ee59ba2435362bb620ac2bf6e97.zip |
SCI: Fix SCI1.1+ Mac views with uint16 rle lengths (thanks, Walter)
svn-id: r55705
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/view.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index a25ae805d5..603169a931 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -449,12 +449,24 @@ void GfxView::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCou literalPtr = _resourceData + celInfo->offsetLiteral; if (celInfo->offsetRLE) { if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1) { + // KQ6 uses byte lengths, all others use uint16 + // The SCI devs must have quickly realized that a max of 255 pixels wide + // was not very good for 320 or 640 width games. + bool hasByteLengths = (g_sci->getGameId() == GID_KQ6); + // compression for SCI1.1+ Mac while (pixelNo < pixelCount) { uint32 pixelLine = pixelNo; - runLength = *rlePtr++; - pixelNo += runLength; - runLength = *rlePtr++; + + if (hasByteLengths) { + pixelNo += *rlePtr++; + runLength = *rlePtr++; + } else { + pixelNo += READ_BE_UINT16(rlePtr); + runLength = READ_BE_UINT16(rlePtr + 2); + rlePtr += 4; + } + while (runLength-- && pixelNo < pixelCount) { outPtr[pixelNo] = *literalPtr++; if (outPtr[pixelNo] == 255) |