From a79330e6d8003aa07d0a77b45ed70fc31f53308a Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 4 Feb 2010 11:54:48 +0000 Subject: SCI: fix support for cels that are larger than 64k (sierra logo animation in sq6) svn-id: r47873 --- engines/sci/graphics/view.cpp | 10 +++++----- engines/sci/graphics/view.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 4080af821d..90f708e5c5 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -284,11 +284,11 @@ void View::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z } } -void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) { +void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCount) { CelInfo *celInfo = getCelInfo(loopNo, celNo); byte *rlePtr; byte *literalPtr; - uint16 pixelNo = 0, runLength; + uint32 pixelNo = 0, runLength; byte pixel; if (celInfo->offsetEGA) { @@ -297,7 +297,7 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) while (pixelNo < pixelCount) { pixel = *literalPtr++; runLength = pixel >> 4; - memset(outPtr + pixelNo, pixel & 0x0F, MIN(runLength, pixelCount - pixelNo)); + memset(outPtr + pixelNo, pixel & 0x0F, MIN(runLength, pixelCount - pixelNo)); pixelNo += runLength; } return; @@ -332,7 +332,7 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) outPtr[pixelNo++] = *rlePtr++; break; case 0x80: // fill with color - memset(outPtr + pixelNo, *rlePtr++, MIN(runLength, pixelCount - pixelNo)); + memset(outPtr + pixelNo, *rlePtr++, MIN(runLength, pixelCount - pixelNo)); pixelNo += runLength; break; case 0xC0: // fill with transparent @@ -355,7 +355,7 @@ void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) outPtr[pixelNo++] = *literalPtr++; break; case 0x80: // fill with color - memset(outPtr + pixelNo, *literalPtr++, MIN(runLength, pixelCount - pixelNo)); + memset(outPtr + pixelNo, *literalPtr++, MIN(runLength, pixelCount - pixelNo)); pixelNo += runLength; break; case 0xC0: // fill with transparent diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index f4c1521614..4f84d6a2ef 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -72,7 +72,7 @@ public: private: void initData(GuiResourceId resourceId); - void unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount); + void unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCount); void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey); ResourceManager *_resMan; -- cgit v1.2.3