[Scummvm-cvs-logs] scummvm master -> 28b91136cd98353f48cb7d2501f49d8d30828889
bluegr
bluegr at gmail.com
Fri Jan 8 16:16:54 CET 2016
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:
28b91136cd SCI: Fix the math in applyFade(), and simplify setFade()
Commit: 28b91136cd98353f48cb7d2501f49d8d30828889
https://github.com/scummvm/scummvm/commit/28b91136cd98353f48cb7d2501f49d8d30828889
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-01-08T17:16:09+02:00
Commit Message:
SCI: Fix the math in applyFade(), and simplify setFade()
Changed paths:
engines/sci/graphics/palette32.cpp
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp
index f7bf61f..95c4f99 100644
--- a/engines/sci/graphics/palette32.cpp
+++ b/engines/sci/graphics/palette32.cpp
@@ -320,17 +320,15 @@ 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)
- _sysPalette.colors[i].r *= _fadeTable[i] / 100;
- _sysPalette.colors[i].g *= _fadeTable[i] / 100;
- _sysPalette.colors[i].b *= _fadeTable[i] / 100;
+ _sysPalette.colors[i].r = (_sysPalette.colors[i].r * _fadeTable[i]) / 100;
+ _sysPalette.colors[i].g = (_sysPalette.colors[i].g * _fadeTable[i]) / 100;
+ _sysPalette.colors[i].b = (_sysPalette.colors[i].b * _fadeTable[i]) / 100;
}
}
void GfxPalette32::setFade(uint8 percent, uint16 fromColor, uint16 toColor) {
- uint8 *fadeAmount = _fadeTable;
- for (int i = fromColor, len = toColor - fromColor + 1; i < len; ++i) {
- *fadeAmount++ = percent;
- }
+ for (int i = fromColor; i <= toColor; i++)
+ _fadeTable[i] = percent;
}
void GfxPalette32::fadeOff() {
More information about the Scummvm-git-logs
mailing list