aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-06-10 23:24:02 -0400
committerPaul Gilbert2013-06-10 23:24:02 -0400
commitf9b2c62bcd9522d67efde81af95b6c5401013f21 (patch)
treee82664cfc792138b56ef8ae24f02a4cecc33561e
parentca8a47700da17ef0c4de934a5fc980ca1e9de92e (diff)
downloadscummvm-rg350-f9b2c62bcd9522d67efde81af95b6c5401013f21.tar.gz
scummvm-rg350-f9b2c62bcd9522d67efde81af95b6c5401013f21.tar.bz2
scummvm-rg350-f9b2c62bcd9522d67efde81af95b6c5401013f21.zip
VOYEUR: Fading now works correctly
-rw-r--r--engines/voyeur/events.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index f76f99ac9f..84e993effe 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -215,25 +215,25 @@ void EventsManager::startFade(CMapResource *cMap) {
_fadeCount = cMap->_steps + 1;
if (cMap->_steps > 0) {
- _fadeStatus = cMap->_fadeStatus |= 1;
+ _fadeStatus = cMap->_fadeStatus | 1;
byte *vgaP = &_vm->_graphicsManager._VGAColors[_fadeFirstCol * 3];
int mapIndex = 0;
- for (int idx = _fadeFirstCol; idx <= _fadeLastCol; ++idx) {
+ for (int idx = _fadeFirstCol; idx <= _fadeLastCol; ++idx, vgaP += 3) {
ViewPortPalEntry &palEntry = _vm->_graphicsManager._viewPortListPtr->_palette[idx];
palEntry._rEntry = vgaP[0] << 8;
- uint32 rComp = (uint16)((cMap->_entries[mapIndex * 3] << 8) - palEntry._rEntry) | 0x80;
- palEntry._rChange = rComp / cMap->_steps;
+ int rDiff = (cMap->_entries[mapIndex * 3] << 8) - palEntry._rEntry;
+ palEntry._rChange = rDiff / cMap->_steps;
palEntry._gEntry = vgaP[1] << 8;
- uint32 gComp = (uint16)((cMap->_entries[mapIndex * 3 + 1] << 8) - palEntry._gEntry) | 0x80;
- palEntry._gChange = gComp / cMap->_steps;
+ int gDiff = (cMap->_entries[mapIndex * 3 + 1] << 8) - palEntry._gEntry;
+ palEntry._gChange = gDiff / cMap->_steps;
palEntry._bEntry = vgaP[2] << 8;
- uint32 bComp = (uint16)((cMap->_entries[mapIndex * 3 + 2] << 8) -palEntry._bEntry) | 0x80;
- palEntry._bChange = bComp / cMap->_steps;
- palEntry._palIndex = bComp % cMap->_steps;
-
+ int bDiff = (cMap->_entries[mapIndex * 3 + 2] << 8) - palEntry._bEntry;
+ palEntry._bChange = bDiff / cMap->_steps;
+
+ palEntry._palIndex = idx;
if (!(cMap->_fadeStatus & 1))
++mapIndex;
}