aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorBertrand Augereau2012-08-30 18:32:27 +0200
committerBertrand Augereau2012-08-30 18:32:27 +0200
commit10a947a0be80ea8c5c88bd3493a5057b1223ce45 (patch)
tree14ee692a0fb048b43061f18be0f75a5adc9ff22f /graphics
parent3b4d713ba114a692354f2a9dc68d7b9c3cfe5560 (diff)
downloadscummvm-rg350-10a947a0be80ea8c5c88bd3493a5057b1223ce45.tar.gz
scummvm-rg350-10a947a0be80ea8c5c88bd3493a5057b1223ce45.tar.bz2
scummvm-rg350-10a947a0be80ea8c5c88bd3493a5057b1223ce45.zip
GRAPHICS: Scope reduction of the sometimes unused alpha component in TGADecoder::readHeader
Diffstat (limited to 'graphics')
-rw-r--r--graphics/decoders/tga.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/graphics/decoders/tga.cpp b/graphics/decoders/tga.cpp
index c27cd2b20b..0b2318e127 100644
--- a/graphics/decoders/tga.cpp
+++ b/graphics/decoders/tga.cpp
@@ -178,8 +178,9 @@ bool TGADecoder::readHeader(Common::SeekableReadStream &tga, byte &imageType, by
bool TGADecoder::readColorMap(Common::SeekableReadStream &tga, byte imageType, byte pixelDepth) {
_colorMap = new byte[3 * _colorMapLength];
for (int i = 0; i < _colorMapLength * 3; i += 3) {
- byte r, g, b, a;
+ byte r, g, b;
if (_colorMapEntryLength == 32) {
+ byte a;
PixelFormat format(4, 8, 8, 8, 0, 16, 8, 0, 24);
uint32 color = tga.readUint32LE();
format.colorToARGB(color, a, r, g, b);
@@ -188,12 +189,13 @@ bool TGADecoder::readColorMap(Common::SeekableReadStream &tga, byte imageType, b
g = tga.readByte();
b = tga.readByte();
} else if (_colorMapEntryLength == 16) {
+ byte a;
PixelFormat format(2, 5, 5, 5, 0, 10, 5, 0, 15);
uint16 color = tga.readUint16LE();
format.colorToARGB(color, a, r, g, b);
} else {
warning("Unsupported image type: %d", imageType);
- r = g = b = a = 0;
+ r = g = b = 0;
}
#ifdef SCUMM_LITTLE_ENDIAN
_colorMap[i] = r;