From e133c7440309fa55034addcc41879bf180a0a299 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 12 Jul 2016 14:15:26 -0500 Subject: 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. --- engines/sci/graphics/palette32.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/sci') 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]; } -- cgit v1.2.3