From 04f372f004057c0d92d10a0f5f6616b5357a5b0d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 8 Jan 2016 15:55:24 +0200 Subject: SCI: Fix the logic in applyFade() Note that this is still unused, as it is normally called from kSetShowStyle() --- engines/sci/graphics/palette32.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'engines/sci/graphics/palette32.cpp') 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; } } -- cgit v1.2.3