aboutsummaryrefslogtreecommitdiff
path: root/graphics/decoders/pict.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2012-05-14 00:49:10 -0400
committerMatthew Hoops2012-05-14 09:56:56 -0400
commitd789df894552bf73709628f09a0282b462df797e (patch)
tree221de03284a568a9db5f54a88754bdb0aa3b8241 /graphics/decoders/pict.cpp
parentc3f0a426fcbe2c8991b29c0e4bda1e7f0c9263b9 (diff)
downloadscummvm-rg350-d789df894552bf73709628f09a0282b462df797e.tar.gz
scummvm-rg350-d789df894552bf73709628f09a0282b462df797e.tar.bz2
scummvm-rg350-d789df894552bf73709628f09a0282b462df797e.zip
GRAPHICS: Add palette start index and color count functions to ImageDecoder
Diffstat (limited to 'graphics/decoders/pict.cpp')
-rw-r--r--graphics/decoders/pict.cpp7
1 files changed, 5 insertions, 2 deletions
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;