aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2016-01-08 15:55:24 +0200
committerFilippos Karapetis2016-01-08 15:55:24 +0200
commit04f372f004057c0d92d10a0f5f6616b5357a5b0d (patch)
tree10abde60bf8dfc1479367dab320a7c0d79cf8321 /engines
parente4e7f1825d2a732bcd96cd9f3865b59d68530554 (diff)
downloadscummvm-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.cpp17
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;
}
}