[Scummvm-cvs-logs] scummvm master -> 797dbfe506d5273c0385997401aa32524995df33
bluegr
md5 at scummvm.org
Wed Jul 25 00:18:16 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
797dbfe506 SCI: Set the RemapByPercent palette initially
Commit: 797dbfe506d5273c0385997401aa32524995df33
https://github.com/scummvm/scummvm/commit/797dbfe506d5273c0385997401aa32524995df33
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-24T15:16:13-07:00
Commit Message:
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
Changed paths:
engines/sci/graphics/palette.cpp
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 9b8618c..68104b0 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;
}
More information about the Scummvm-git-logs
mailing list