aboutsummaryrefslogtreecommitdiff
path: root/sword1/screen.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-21 17:34:44 +0000
committerRobert Göffringmann2003-12-21 17:34:44 +0000
commit44887cc33d3ac01a846526ec56cb0559d2f6b45b (patch)
treeaa63f4325f43dfa85f24fbcc61e23cd02971c6d2 /sword1/screen.cpp
parented991734a32e4d484fee81be6efeab0b4747926e (diff)
downloadscummvm-rg350-44887cc33d3ac01a846526ec56cb0559d2f6b45b.tar.gz
scummvm-rg350-44887cc33d3ac01a846526ec56cb0559d2f6b45b.tar.bz2
scummvm-rg350-44887cc33d3ac01a846526ec56cb0559d2f6b45b.zip
fixed parallax drawing for room 54
svn-id: r11828
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r--sword1/screen.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/sword1/screen.cpp b/sword1/screen.cpp
index 4075aebeb8..08dfc4488e 100644
--- a/sword1/screen.cpp
+++ b/sword1/screen.cpp
@@ -276,13 +276,24 @@ void SwordScreen::quitScreen(void) {
_resMan->resClose(_roomDefTable[_currentScreen].parallax[1]);
}
-void SwordScreen::recreate() {
- memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
-}
-
-void SwordScreen::spritesAndParallax(void) {
- if ((_currentScreen == 54) && _parallax[0])
- renderParallax(_parallax[0]); // rm54 has a BACKGROUND parallax layer in parallax[0]
+void SwordScreen::draw(void) {
+ if (_currentScreen == 54) {
+ // rm54 has a BACKGROUND parallax layer in parallax[0]
+ if (_parallax[0])
+ renderParallax(_parallax[0]);
+ uint8 *src = _layerBlocks[0];
+ uint8 *dest = _screenBuf;
+ for (uint16 cnty = 0; cnty < _scrnSizeY; cnty++)
+ for (uint16 cntx = 0; cntx < _scrnSizeX; cntx++) {
+ if (*src)
+ *dest = *src;
+ dest++;
+ src++;
+ }
+ } else
+ memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
+
+
for (uint8 cnt = 0; cnt < _backLength; cnt++)
processImage(_backList[cnt]);
@@ -454,7 +465,7 @@ void SwordScreen::renderParallax(uint8 *data) {
for (uint16 cnty = 0; cnty < SCREEN_DEPTH; cnty++) {
uint8 *src = data + READ_LE_UINT32(header->lineIndexes + cnty + scrlY);
- uint8 *dest = _screenBuf + SwordLogic::_scriptVars[SCROLL_OFFSET_X] + cnty * _scrnSizeX;
+ uint8 *dest = _screenBuf + SwordLogic::_scriptVars[SCROLL_OFFSET_X] + (cnty + SwordLogic::_scriptVars[SCROLL_OFFSET_Y]) * _scrnSizeX;
uint16 remain = scrlX;
uint16 xPos = 0;
bool copyFirst = false;