[Scummvm-cvs-logs] SF.net SVN: scummvm:[45497] scummvm/trunk/engines/draci
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Thu Oct 29 02:55:06 CET 2009
Revision: 45497
http://scummvm.svn.sourceforge.net/scummvm/?rev=45497&view=rev
Author: spalek
Date: 2009-10-29 01:55:06 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
Fix several palette fading bugs.
Modified Paths:
--------------
scummvm/trunk/engines/draci/game.cpp
scummvm/trunk/engines/draci/game.h
scummvm/trunk/engines/draci/screen.cpp
scummvm/trunk/engines/draci/script.cpp
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2009-10-29 01:10:10 UTC (rev 45496)
+++ scummvm/trunk/engines/draci/game.cpp 2009-10-29 01:55:06 UTC (rev 45497)
@@ -243,15 +243,15 @@
if (_fadePhase > 0 && (_vm->_system->getMillis() - _fadeTick) >= kFadingTimeUnit) {
_fadeTick = _vm->_system->getMillis();
--_fadePhase;
- const BAFile *startPal = _vm->_paletteArchive->getFile(_currentRoom._palette);
- const BAFile *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette()) : NULL;
- _vm->_screen->interpolatePalettes(startPal->_data, endPal->_data, 0, kNumColours, _fadePhases - _fadePhase, _fadePhases);
+ const byte *startPal = _currentRoom._palette >= 0 ? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data : NULL;
+ const byte *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette())->_data : NULL;
+ _vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColours, _fadePhases - _fadePhase, _fadePhases);
if (_loopSubstatus == kSubstatusFade && _fadePhase == 0) {
setExitLoop(true);
// Rewrite the palette index of the current
// room. This is necessary when two fadings
// are called after each other, such as in the
- // intro. We rely on that getScheduledPalette() >= 0.
+ // intro.
_currentRoom._palette = getScheduledPalette();
}
}
Modified: scummvm/trunk/engines/draci/game.h
===================================================================
--- scummvm/trunk/engines/draci/game.h 2009-10-29 01:10:10 UTC (rev 45496)
+++ scummvm/trunk/engines/draci/game.h 2009-10-29 01:55:06 UTC (rev 45497)
@@ -200,7 +200,7 @@
int _roomNum;
byte _music;
WalkingMap _walkingMap;
- byte _palette;
+ int _palette;
int _numOverlays;
int _init, _look, _use, _canUse;
bool _imInit, _imLook, _imUse;
Modified: scummvm/trunk/engines/draci/screen.cpp
===================================================================
--- scummvm/trunk/engines/draci/screen.cpp 2009-10-29 01:10:10 UTC (rev 45496)
+++ scummvm/trunk/engines/draci/screen.cpp 2009-10-29 01:55:06 UTC (rev 45497)
@@ -55,7 +55,7 @@
*/
void Screen::setPalette(const byte *data, uint16 start, uint16 num) {
Common::MemoryReadStream pal(data ? data : _blackPalette, 3 * kNumColours);
- pal.seek(start * 4);
+ pal.seek(start * 3);
// Copy the palette
for (uint16 i = start; i < start + num; ++i) {
@@ -77,8 +77,8 @@
void Screen::interpolatePalettes(const byte *first, const byte *second, uint16 start, uint16 num, int index, int number) {
Common::MemoryReadStream firstPal(first ? first : _blackPalette, 3 * kNumColours);
Common::MemoryReadStream secondPal(second ? second : _blackPalette, 3 * kNumColours);
- firstPal.seek(start * 4);
- secondPal.seek(start * 4);
+ firstPal.seek(start * 3);
+ secondPal.seek(start * 3);
// Interpolate the palettes
for (uint16 i = start; i < start + num; ++i) {
Modified: scummvm/trunk/engines/draci/script.cpp
===================================================================
--- scummvm/trunk/engines/draci/script.cpp 2009-10-29 01:10:10 UTC (rev 45496)
+++ scummvm/trunk/engines/draci/script.cpp 2009-10-29 01:55:06 UTC (rev 45497)
@@ -869,7 +869,7 @@
}
// Immediately update the palette
_vm->_screen->copyToScreen();
- _vm->_system->delayMillis(100);
+ _vm->_system->delayMillis(20);
}
void Script::quitGame(Common::Queue<int> ¶ms) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list