aboutsummaryrefslogtreecommitdiff
path: root/sword1/screen.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2004-01-07 19:08:59 +0000
committerRobert Göffringmann2004-01-07 19:08:59 +0000
commit63fbde359adfae8a545977f7a5092216b696368a (patch)
treedf1cc6c0a7eee7facb37a23e3234eea5e5a6b796 /sword1/screen.cpp
parent821bbed1e052205746d9bc2118120a7d31a2a2a1 (diff)
downloadscummvm-rg350-63fbde359adfae8a545977f7a5092216b696368a.tar.gz
scummvm-rg350-63fbde359adfae8a545977f7a5092216b696368a.tar.bz2
scummvm-rg350-63fbde359adfae8a545977f7a5092216b696368a.zip
implemented drawing of additional scrolling frames
svn-id: r12223
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r--sword1/screen.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/sword1/screen.cpp b/sword1/screen.cpp
index ce80b3298c..2f3915ba19 100644
--- a/sword1/screen.cpp
+++ b/sword1/screen.cpp
@@ -119,6 +119,21 @@ bool SwordScreen::stillFading(void) {
return (_fadingStep != 0);
}
+bool SwordScreen::showScrollFrame(void) {
+ if ((!_fullRefresh) || SwordLogic::_scriptVars[NEW_PALETTE] || (!SwordLogic::_scriptVars[SCROLL_FLAG]))
+ return false; // don't draw an additional frame if we aren't scrolling or have to change the palette
+ if ((_oldScrollX == SwordLogic::_scriptVars[SCROLL_OFFSET_X]) &&
+ (_oldScrollY == SwordLogic::_scriptVars[SCROLL_OFFSET_Y]))
+ return false; // check again if we *really* are scrolling.
+
+ uint16 avgScrlX = (uint16)(_oldScrollX + SwordLogic::_scriptVars[SCROLL_OFFSET_X]) / 2;
+ uint16 avgScrlY = (uint16)(_oldScrollY + SwordLogic::_scriptVars[SCROLL_OFFSET_Y]) / 2;
+
+ _system->copy_rect(_screenBuf + avgScrlY * _scrnSizeX + avgScrlX, _scrnSizeX, 0, 40, SCREEN_WIDTH, SCREEN_DEPTH);
+ _system->update_screen();
+ return true;
+}
+
void SwordScreen::updateScreen(void) {
if (SwordLogic::_scriptVars[NEW_PALETTE]) {
_fadingStep = 1;
@@ -653,7 +668,9 @@ void SwordScreen::decompressRLE0(uint8 *src, uint32 compSize, uint8 *dest) {
void SwordScreen::fadePalette(void) {
if (_fadingStep == 16)
memcpy(_currentPalette, _targetPalette, 256 * 4);
- else
+ else if ((_fadingStep == 1) && (_fadingDirection == FADE_DOWN)) {
+ memset(_currentPalette, 0, 4 * 256);
+ } else
for (uint16 cnt = 0; cnt < 256 * 4; cnt++)
_currentPalette[cnt] = (_targetPalette[cnt] * _fadingStep) >> 4;