From 797dbfe506d5273c0385997401aa32524995df33 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 25 Jul 2012 01:16:13 +0300 Subject: SCI: Set the RemapByPercent palette initially This needs to be performed because the screen palette might not change after the call. Fixes the display of the bat in the character selection screen in the full version of QFG4 --- engines/sci/graphics/palette.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 9b8618c0ef..68104b0ac8 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -361,10 +361,17 @@ void GfxPalette::setRemappingPercent(byte color, byte percent) { // We need to defer the setup of the remapping table every time the screen // palette is changed, so that kernelFindColor() can find the correct - // colors. The actual setup of the remapping table will be performed in - // copySysPaletteToScreen(). + // colors. Set it once here, in case the palette stays the same and update + // it on each palette change by copySysPaletteToScreen(). _remappingPercentToSet = percent; + for (int i = 0; i < 256; i++) { + byte r = _sysPalette.colors[i].r * _remappingPercentToSet / 100; + byte g = _sysPalette.colors[i].g * _remappingPercentToSet / 100; + byte b = _sysPalette.colors[i].b * _remappingPercentToSet / 100; + _remappingByPercent[i] = kernelFindColor(r, g, b); + } + _remappingType[color] = kRemappingByPercent; } -- cgit v1.2.3