[Scummvm-cvs-logs] SF.net SVN: scummvm:[38320] scummvm/trunk/engines/sword1
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Sun Feb 15 23:33:19 CET 2009
Revision: 38320
http://scummvm.svn.sourceforge.net/scummvm/?rev=38320&view=rev
Author: wjpalenstijn
Date: 2009-02-15 22:33:18 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
defer BS1 palette update from newScreen to updateScreen, based on patch by eriktorbjorn for bug #2599963. Maybe suitable for branch-0-13-0 after more testing.
Modified Paths:
--------------
scummvm/trunk/engines/sword1/screen.cpp
scummvm/trunk/engines/sword1/screen.h
Modified: scummvm/trunk/engines/sword1/screen.cpp
===================================================================
--- scummvm/trunk/engines/sword1/screen.cpp 2009-02-15 22:32:57 UTC (rev 38319)
+++ scummvm/trunk/engines/sword1/screen.cpp 2009-02-15 22:33:18 UTC (rev 38320)
@@ -55,6 +55,7 @@
_backLength = _foreLength = _sortLength = 0;
_fadingStep = 0;
_currentScreen = 0xFFFF;
+ _updatePalette = false;
}
Screen::~Screen(void) {
@@ -169,7 +170,7 @@
}
bool Screen::showScrollFrame(void) {
- if ((!_fullRefresh) || Logic::_scriptVars[NEW_PALETTE])
+ if ((!_fullRefresh) || Logic::_scriptVars[NEW_PALETTE] || _updatePalette)
return false; // don't draw an additional frame if we aren't scrolling or have to change the palette
if ((_oldScrollX == Logic::_scriptVars[SCROLL_OFFSET_X]) &&
(_oldScrollY == Logic::_scriptVars[SCROLL_OFFSET_Y]))
@@ -187,10 +188,14 @@
if (Logic::_scriptVars[NEW_PALETTE]) {
_fadingStep = 1;
_fadingDirection = FADE_UP;
- fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], true);
- fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], true);
+ _updatePalette = true;
Logic::_scriptVars[NEW_PALETTE] = 0;
}
+ if (_updatePalette) {
+ fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], false);
+ fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], false);
+ _updatePalette = false;
+ }
if (_fadingStep) {
fadePalette();
_system->setPalette(_currentPalette, 0, 256);
@@ -336,8 +341,7 @@
if (_roomDefTable[_currentScreen].parallax[1])
_parallax[1] = (uint8*)_resMan->openFetchRes(_roomDefTable[_currentScreen].parallax[1]);
- fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], SwordEngine::_systemVars.wantFade);
- fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], SwordEngine::_systemVars.wantFade);
+ _updatePalette = true;
_fullRefresh = true;
}
Modified: scummvm/trunk/engines/sword1/screen.h
===================================================================
--- scummvm/trunk/engines/sword1/screen.h 2009-02-15 22:32:57 UTC (rev 38319)
+++ scummvm/trunk/engines/sword1/screen.h 2009-02-15 22:33:18 UTC (rev 38320)
@@ -137,6 +137,7 @@
uint8 _rleBuffer[RLE_BUFFER_SIZE];
uint8 _shrinkBuffer[SHRINK_BUFFER_SIZE];
bool _fullRefresh;
+ bool _updatePalette;
uint16 _oldScrollX, _oldScrollY; // for drawing additional frames
uint32 _foreList[MAX_FORE];
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