[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.37.2.4,1.37.2.5
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Sun Jul 18 10:14:02 CEST 2004
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22875
Modified Files:
Tag: branch-0-6-0
screen.cpp
Log Message:
Backported fix for bug #917427; the masking bug outside Nico's apartment.
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.37.2.4
retrieving revision 1.37.2.5
diff -u -d -r1.37.2.4 -r1.37.2.5
--- screen.cpp 13 Mar 2004 12:38:12 -0000 1.37.2.4
+++ screen.cpp 18 Jul 2004 17:13:21 -0000 1.37.2.5
@@ -451,19 +451,19 @@
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 * lGridSizeX]))
- level++;
- if (level < _roomDefTable[_currentScreen].totalLayers - 1) {
- uint16 *grid = _layerGrid[level] + gridX + blkx + gridY * lGridSizeX;
- 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);
- } else
- break;
- grid -= lGridSizeX;
+ // A sprite can be masked by several layers at the same time,
+ // so we have to check them all. See bug #917427.
+ for (int16 level = _roomDefTable[_currentScreen].totalLayers - 2; level >= 0; level--) {
+ if (_layerGrid[level][gridX + blkx + gridY * lGridSizeX]) {
+ uint16 *grid = _layerGrid[level] + gridX + blkx + gridY * lGridSizeX;
+ 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);
+ } else
+ break;
+ grid -= lGridSizeX;
+ }
}
}
}
More information about the Scummvm-git-logs
mailing list