aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-07-05 17:50:57 -0500
committerColin Snover2017-07-06 19:12:40 -0500
commit12d24d5b46cc4017b159040da6f42c9cfde5cbf7 (patch)
tree77c26819425b861aeed3a2cd4e51eaa1e2bfabd6 /engines/sci
parent3f0e061eaa272c3f6bc284d8e837870e132d9dcc (diff)
downloadscummvm-rg350-12d24d5b46cc4017b159040da6f42c9cfde5cbf7.tar.gz
scummvm-rg350-12d24d5b46cc4017b159040da6f42c9cfde5cbf7.tar.bz2
scummvm-rg350-12d24d5b46cc4017b159040da6f42c9cfde5cbf7.zip
SCI32: Fix bad palette entries when built without USE_RGB_COLOR
This is only a problem for the Windows games that need some palette entries to be ignored.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/palette32.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index 339461d157..d7f6710e12 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -527,6 +527,12 @@ void GfxPalette32::updateHardware() {
}
}
+#ifndef USE_RGB_COLOR
+ // When creating a raw palette on the stack, any skipped area of the palette
+ // needs to be blacked out or else it will contain garbage memory
+ memset(bpal + (maxIndex + 1) * 3, 0, (255 - maxIndex - 1) * 3);
+#endif
+
if (g_sci->getPlatform() != Common::kPlatformMacintosh) {
// The last color must always be white
bpal[255 * 3 ] = 255;