From adfa5e1b861c4b55720b497412e940cbb95a7afe Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 6 Mar 2011 12:44:11 -0500 Subject: SCI: Fix Mac SCI1.1 view decompression A regression from d2ad7898d9 --- engines/sci/graphics/view.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'engines/sci/graphics/view.cpp') 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(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(runLength, pixelCount - pixelNr)); + pixelNr += runLength; + break; + case 0xC0: // fill with transparent + pixelNr += runLength; + break; + } } } } -- cgit v1.2.3