diff options
author | Filippos Karapetis | 2016-01-08 15:55:24 +0200 |
---|---|---|
committer | Filippos Karapetis | 2016-01-08 15:55:24 +0200 |
commit | 04f372f004057c0d92d10a0f5f6616b5357a5b0d (patch) | |
tree | 10abde60bf8dfc1479367dab320a7c0d79cf8321 /engines | |
parent | e4e7f1825d2a732bcd96cd9f3865b59d68530554 (diff) | |
download | scummvm-rg350-04f372f004057c0d92d10a0f5f6616b5357a5b0d.tar.gz scummvm-rg350-04f372f004057c0d92d10a0f5f6616b5357a5b0d.tar.bz2 scummvm-rg350-04f372f004057c0d92d10a0f5f6616b5357a5b0d.zip |
SCI: Fix the logic in applyFade()
Note that this is still unused, as it is normally called from
kSetShowStyle()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/palette32.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index 54f52d1d6d..bf5e9b3c2a 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -313,19 +313,16 @@ void GfxPalette32::cycleAllOff() { } void GfxPalette32::applyFade() { - // TODO: Create and update a _nextPalette, not a single _sysPalette, to - // conform to the way the actual SCI32 engine works (writes to a - // next-frame-palette and then copies to the current palette on frameout) - Color *color = _sysPalette.colors; - uint8 *fadeAmount = _fadeTable; for (int i = 0; i < 256; ++i) { - if (*fadeAmount == 100) { + if (_fadeTable[i] == 100) continue; - } - color->r = ((int) color->r * ((int) *fadeAmount)) / 100; - color->g = ((int) color->r * ((int) *fadeAmount)) / 100; - color->b = ((int) color->r * ((int) *fadeAmount)) / 100; + // TODO: Create and update a _nextPalette, not a single _sysPalette, to + // conform to the way the actual SCI32 engine works (writes to a + // next-frame-palette and then copies to the current palette on frameout) + _sysPalette.colors->r *= _fadeTable[i] / 100; + _sysPalette.colors->g *= _fadeTable[i] / 100; + _sysPalette.colors->b *= _fadeTable[i] / 100; } } |