aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-20 00:45:59 -0500
committerMatthew Hoops2011-02-20 00:45:59 -0500
commit5091f846a78c82d619b41530ff670de04bc05387 (patch)
tree8071ff0e1f4029cdfdd1b20ecd994b183f6b9a90
parent098581b3b5ec22f2e50075414f74f378ad24c2ae (diff)
downloadscummvm-rg350-5091f846a78c82d619b41530ff670de04bc05387.tar.gz
scummvm-rg350-5091f846a78c82d619b41530ff670de04bc05387.tar.bz2
scummvm-rg350-5091f846a78c82d619b41530ff670de04bc05387.zip
GRAPHICS: Switch PICT's palette from RGBA to RGB
-rw-r--r--engines/sci/graphics/maciconbar.cpp8
-rw-r--r--graphics/pict.cpp8
-rw-r--r--graphics/pict.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp
index 77491aa995..d6251641a3 100644
--- a/engines/sci/graphics/maciconbar.cpp
+++ b/engines/sci/graphics/maciconbar.cpp
@@ -45,7 +45,7 @@ void GfxMacIconBar::addIcon(reg_t obj) {
void GfxMacIconBar::drawIcons() {
// Draw the icons to the bottom of the screen
- byte *pal = new byte[256 * 4];
+ byte *pal = new byte[256 * 3];
Graphics::PictDecoder *pict = new Graphics::PictDecoder(Graphics::PixelFormat::createFormatCLUT8());
uint32 lastX = 0;
@@ -79,9 +79,9 @@ void GfxMacIconBar::remapColors(Graphics::Surface *surf, byte *palette) {
for (uint16 i = 0; i < surf->w * surf->h; i++) {
byte color = *pixels;
- byte r = palette[color * 4];
- byte g = palette[color * 4 + 1];
- byte b = palette[color * 4 + 2];
+ byte r = palette[color * 3];
+ byte g = palette[color * 3 + 1];
+ byte b = palette[color * 3 + 2];
*pixels++ = g_sci->_gfxPalette->findMacIconBarColor(r, g, b);
}
diff --git a/graphics/pict.cpp b/graphics/pict.cpp
index 9079223237..ca4aac751d 100644
--- a/graphics/pict.cpp
+++ b/graphics/pict.cpp
@@ -127,7 +127,7 @@ Surface *PictDecoder::decodeImage(Common::SeekableReadStream *stream, byte *pale
// If we got a palette throughout this nonsense, go and grab it
if (palette && _isPaletted)
- memcpy(palette, _palette, 256 * 4);
+ memcpy(palette, _palette, 256 * 3);
return _outputSurface;
}
@@ -180,9 +180,9 @@ void PictDecoder::decodeDirectBitsRect(Common::SeekableReadStream *stream, bool
for (uint32 i = 0; i < colorCount; i++) {
stream->readUint16BE();
- _palette[i * 4] = stream->readUint16BE() >> 8;
- _palette[i * 4 + 1] = stream->readUint16BE() >> 8;
- _palette[i * 4 + 2] = stream->readUint16BE() >> 8;
+ _palette[i * 3] = stream->readUint16BE() >> 8;
+ _palette[i * 3 + 1] = stream->readUint16BE() >> 8;
+ _palette[i * 3 + 2] = stream->readUint16BE() >> 8;
}
}
diff --git a/graphics/pict.h b/graphics/pict.h
index e4bde8a466..a683a23bf6 100644
--- a/graphics/pict.h
+++ b/graphics/pict.h
@@ -70,7 +70,7 @@ private:
Common::Rect _imageRect;
PixelFormat _pixelFormat;
JPEG *_jpeg;
- byte _palette[256 * 4];
+ byte _palette[256 * 3];
bool _isPaletted;
Graphics::Surface *_outputSurface;