aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-06 12:44:11 -0500
committerMatthew Hoops2011-03-06 12:46:01 -0500
commitadfa5e1b861c4b55720b497412e940cbb95a7afe (patch)
tree88f46b12cfa1eff77d4c26ccf5139ff43b5adc6f /engines/sci/graphics
parent6a8fadeec83822b100c4eaaa511eabb285dd4765 (diff)
downloadscummvm-rg350-adfa5e1b861c4b55720b497412e940cbb95a7afe.tar.gz
scummvm-rg350-adfa5e1b861c4b55720b497412e940cbb95a7afe.tar.bz2
scummvm-rg350-adfa5e1b861c4b55720b497412e940cbb95a7afe.zip
SCI: Fix Mac SCI1.1 view decompression
A regression from d2ad7898d9
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/view.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 27fad19eca..a6c0805f65 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -456,23 +456,24 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
pixelNr = pixelLine + width;
}
- }
- // decompression for data that has two separate streams (probably SCI 1.1 view)
- while (pixelNr < pixelCount) {
- curByte = *rlePtr++;
- runLength = curByte & 0x3F;
- switch (curByte & 0xC0) {
- case 0: // copy bytes as-is
- while (runLength-- && pixelNr < pixelCount)
- outPtr[pixelNr++] = *literalPtr++;
- break;
- case 0x80: // fill with color
- memset(outPtr + pixelNr, *literalPtr++, MIN<uint16>(runLength, pixelCount - pixelNr));
- pixelNr += runLength;
- break;
- case 0xC0: // fill with transparent
- pixelNr += runLength;
- break;
+ } else {
+ // decompression for data that has two separate streams (probably SCI 1.1 view)
+ while (pixelNr < pixelCount) {
+ curByte = *rlePtr++;
+ runLength = curByte & 0x3F;
+ switch (curByte & 0xC0) {
+ case 0: // copy bytes as-is
+ while (runLength-- && pixelNr < pixelCount)
+ outPtr[pixelNr++] = *literalPtr++;
+ break;
+ case 0x80: // fill with color
+ memset(outPtr + pixelNr, *literalPtr++, MIN<uint16>(runLength, pixelCount - pixelNr));
+ pixelNr += runLength;
+ break;
+ case 0xC0: // fill with transparent
+ pixelNr += runLength;
+ break;
+ }
}
}
}