aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2012-07-25 01:16:13 +0300
committerFilippos Karapetis2012-07-25 01:16:13 +0300
commit797dbfe506d5273c0385997401aa32524995df33 (patch)
tree6b3f8ba9f397bcf9beabe0347504f3cb9cb441a8
parent537b1969bf896ee4e72e9d042e4b7f41c921d38c (diff)
downloadscummvm-rg350-797dbfe506d5273c0385997401aa32524995df33.tar.gz
scummvm-rg350-797dbfe506d5273c0385997401aa32524995df33.tar.bz2
scummvm-rg350-797dbfe506d5273c0385997401aa32524995df33.zip
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
-rw-r--r--engines/sci/graphics/palette.cpp11
1 files changed, 9 insertions, 2 deletions
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;
}