aboutsummaryrefslogtreecommitdiff
path: root/sword1/screen.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-22 11:51:27 +0000
committerRobert Göffringmann2003-12-22 11:51:27 +0000
commit7fec7cc1aeb3bcbdfb6c2d3dcbc614bb17742eb3 (patch)
tree0ac93ee686a3be948a15318fc4135bd502631fa6 /sword1/screen.cpp
parent7ab78ea26a7d42ea208df7057cefe65128731a02 (diff)
downloadscummvm-rg350-7fec7cc1aeb3bcbdfb6c2d3dcbc614bb17742eb3.tar.gz
scummvm-rg350-7fec7cc1aeb3bcbdfb6c2d3dcbc614bb17742eb3.tar.bz2
scummvm-rg350-7fec7cc1aeb3bcbdfb6c2d3dcbc614bb17742eb3.zip
another change to verticalMask(). this should fix the remaining sprite priority issues
svn-id: r11853
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r--sword1/screen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/sword1/screen.cpp b/sword1/screen.cpp
index 2e0cf14836..77be61d510 100644
--- a/sword1/screen.cpp
+++ b/sword1/screen.cpp
@@ -291,8 +291,6 @@ void SwordScreen::draw(void) {
}
} else
memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
-
-
for (uint8 cnt = 0; cnt < _backLength; cnt++)
processImage(_backList[cnt]);
@@ -411,22 +409,24 @@ void SwordScreen::verticalMask(uint16 x, uint16 y, uint16 bWidth, uint16 bHeight
bHeight = _gridSizeY - y;
uint16 gridY = y + SCREEN_TOP_EDGE / SCRNGRID_Y; // imaginary screen on top
+ gridY += bHeight - 1; // we start from the bottom edge
uint16 gridX = x + SCREEN_LEFT_EDGE / SCRNGRID_X; // imaginary screen left
uint16 lGridSizeX = _gridSizeX + 2 * (SCREEN_LEFT_EDGE / SCRNGRID_X); // width of the grid for the imaginary screen
for (uint16 blkx = 0; blkx < bWidth; blkx++) {
uint16 level = 0;
while ((level < _roomDefTable[_currentScreen].totalLayers - 1) &&
- (!_layerGrid[level][gridX + blkx + (gridY + bHeight - 1)* lGridSizeX]))
+ (!_layerGrid[level][gridX + blkx + gridY * lGridSizeX]))
level++;
if (level < _roomDefTable[_currentScreen].totalLayers - 1) {
uint16 *grid = _layerGrid[level] + gridX + blkx + gridY * lGridSizeX;
- for (uint16 blky = 0; blky < bHeight; blky++) {
+ for (int16 blky = bHeight - 1; blky >= 0; blky--) {
if (*grid) {
uint8 *blkData = _layerBlocks[level + 1] + (READ_LE_UINT16(grid) - 1) * 128;
blitBlockClear(x + blkx, y + blky, blkData);
- }
- grid += lGridSizeX;
+ } else
+ break;
+ grid -= lGridSizeX;
}
}
}