From d789df894552bf73709628f09a0282b462df797e Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 14 May 2012 00:49:10 -0400 Subject: GRAPHICS: Add palette start index and color count functions to ImageDecoder --- graphics/decoders/pict.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'graphics/decoders/pict.cpp') diff --git a/graphics/decoders/pict.cpp b/graphics/decoders/pict.cpp index bdb733a87d..7eddd3b893 100644 --- a/graphics/decoders/pict.cpp +++ b/graphics/decoders/pict.cpp @@ -38,6 +38,7 @@ namespace Graphics { PICTDecoder::PICTDecoder() { _outputSurface = 0; + _paletteColorCount = 0; } PICTDecoder::~PICTDecoder() { @@ -50,6 +51,8 @@ void PICTDecoder::destroy() { delete _outputSurface; _outputSurface = 0; } + + _paletteColorCount = 0; } #define OPCODE(a, b, c) _opcodes.push_back(PICTOpcode(a, &PICTDecoder::b, c)) @@ -298,9 +301,9 @@ void PICTDecoder::unpackBitsRect(Common::SeekableReadStream &stream, bool hasPal // See http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-267.html stream.readUint32BE(); // seed stream.readUint16BE(); // flags - uint16 colorCount = stream.readUint16BE() + 1; + _paletteColorCount = stream.readUint16BE() + 1; - for (uint32 i = 0; i < colorCount; i++) { + for (uint32 i = 0; i < _paletteColorCount; i++) { stream.readUint16BE(); _palette[i * 3] = stream.readUint16BE() >> 8; _palette[i * 3 + 1] = stream.readUint16BE() >> 8; -- cgit v1.2.3