diff options
author | Paul Gilbert | 2013-06-07 22:07:57 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-06-07 22:07:57 -0400 |
commit | 48c18a7c1448a169cc07e21e4f2e883642e9e42a (patch) | |
tree | 9b9f0f7a3c4d509815f1dde67dbc9cd8e0115101 /engines/voyeur/events.cpp | |
parent | 8d6d3d8aa629c452daa27aa8cf49497d8cf02fce (diff) | |
download | scummvm-rg350-48c18a7c1448a169cc07e21e4f2e883642e9e42a.tar.gz scummvm-rg350-48c18a7c1448a169cc07e21e4f2e883642e9e42a.tar.bz2 scummvm-rg350-48c18a7c1448a169cc07e21e4f2e883642e9e42a.zip |
VOYEUR: Implemented decoding of viewport list palette data
Diffstat (limited to 'engines/voyeur/events.cpp')
-rw-r--r-- | engines/voyeur/events.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 02b0f7f738..a59d11ca45 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -160,26 +160,23 @@ void EventsManager::startFade(CMapResource *cMap) { if (cMap->_steps > 0) { _vm->_graphicsManager._fadeStatus = cMap->_fadeStatus | 1; - uint16 *destP = (uint16 *)(_vm->_graphicsManager._viewPortListPtr->_palette + - (_fadeFirstCol * 16)); byte *vgaP = &_vm->_graphicsManager._VGAColors[_fadeFirstCol * 3]; int mapIndex = 0; for (int idx = _fadeFirstCol; idx <= _fadeLastCol; ++idx) { - destP[0] = vgaP[0] << 8; - uint32 rComp = (uint16)((cMap->_entries[mapIndex * 3] << 8) - destP[0]) | 0x80; - destP[3] = rComp / cMap->_steps; - - destP[1] = vgaP[1] << 8; - uint32 gComp = (uint16)((cMap->_entries[mapIndex * 3 + 1] << 8) - destP[1]) | 0x80; - destP[4] = gComp / cMap->_steps; - - destP[2] = vgaP[2] << 8; - uint32 bComp = (uint16)((cMap->_entries[mapIndex * 3 + 2] << 8) - destP[2]) | 0x80; - destP[5] = bComp / cMap->_steps; - destP[6] = bComp % cMap->_steps; - - destP += 8; + ViewPortPalEntry &palEntry = _vm->_graphicsManager._viewPortListPtr->_palette[idx]; + palEntry._rEntry = vgaP[0] << 8; + uint32 rComp = (uint16)((cMap->_entries[mapIndex * 3] << 8) - palEntry._rEntry) | 0x80; + palEntry.field6 = rComp / cMap->_steps; + + palEntry._gEntry = vgaP[1] << 8; + uint32 gComp = (uint16)((cMap->_entries[mapIndex * 3 + 1] << 8) - palEntry._gEntry) | 0x80; + palEntry.field8 = gComp / cMap->_steps; + + palEntry._bEntry = vgaP[2] << 8; + uint32 bComp = (uint16)((cMap->_entries[mapIndex * 3 + 2] << 8) -palEntry._bEntry) | 0x80; + palEntry.fieldA = bComp / cMap->_steps; + palEntry.fieldC = bComp % cMap->_steps; if (!(cMap->_fadeStatus & 1)) ++mapIndex; |