aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2016-07-12 14:15:26 -0500
committerColin Snover2016-07-12 14:43:56 -0500
commite133c7440309fa55034addcc41879bf180a0a299 (patch)
tree4df0bf64c86f9cfb129e1429d261780d34186784 /engines/sci
parentefc12ffc5c905f38f1ea7889d4d9d6c14647441d (diff)
downloadscummvm-rg350-e133c7440309fa55034addcc41879bf180a0a299.tar.gz
scummvm-rg350-e133c7440309fa55034addcc41879bf180a0a299.tar.bz2
scummvm-rg350-e133c7440309fa55034addcc41879bf180a0a299.zip
SCI32: Fix unnecessary palette updates
Some games load palettes that include color 255, but this is hardcoded to white in SSCI, so just ignore it during merges since it is ignored when the hardware palette is updated anyway.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/palette32.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index 1260a962f0..2a98c237b0 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -128,8 +128,8 @@ GfxPalette32::GfxPalette32(ResourceManager *resMan)
_version(1),
_needsUpdate(false),
_currentPalette(),
- _sourcePalette(_currentPalette),
- _nextPalette(_currentPalette),
+ _sourcePalette(),
+ _nextPalette(),
// Clut
_clutTable(nullptr),
// Palette varying
@@ -162,7 +162,10 @@ GfxPalette32::~GfxPalette32() {
}
inline void mergePaletteInternal(Palette *const to, const Palette *const from) {
- for (int i = 0, len = ARRAYSIZE(to->colors); i < len; ++i) {
+ // The last color is always white, so it is not copied.
+ // (Some palettes try to set the last color, which causes
+ // churning in the palettes when they are merged)
+ for (int i = 0, len = ARRAYSIZE(to->colors) - 1; i < len; ++i) {
if (from->colors[i].used) {
to->colors[i] = from->colors[i];
}