[Issue Report]: Player is rendered in front of the near side of the Cathedral entrance in the town
Operating System
Mac
DevilutionX version
1.5.5
Describe
When the player enters the Cathedral in Tristram, the near/front side of the Cathedral entrance does not correctly occlude the player during the animation.
The player sprite is rendered on top of part of the entrance that should visually be in the foreground.
To Reproduce
- Go to the Cathedral in the town
- Click on the Cathedral entrance: "Down to dungeon"
- During the walking animation, you can see the z-ordering issue just before the dungeon starts loading.
Expected Behavior
When the player walks into the Cathedral entrance, the near side of the entrance should be rendered after the player sprite, so the player correctly disappears behind the arch. The ground at the bottom of the level piece must remain behind the player.
Additional context
Current version (z-ordering issue):
Used tile:
Possible solution:
Add cathedralarch.clx 64x256 px image to the levels/towndata/:
in the LoadLvlGFX() function add an extra .clx file to the pSpecialCels.
In InitTownPieces() function, assign this frame to the dSpecial[25][30] special tileset.
Then render the special tileset using the traditional way. For the tree leaves rendering, I would introduce a new dOverlay other special tileset and render it the same way they are rendered now.:
if (tilePosition.x > 0 && tilePosition.y > 0 && targetBufferPosition.y > TILE_HEIGHT) {
// Tree leaves should always cover player when entering or leaving the tile,
// So delay the rendering until after the next row is being drawn.
// This could probably have been better solved by sprites in screen space.
const int8_t bArch = dSpecial[tilePosition.x - 1][tilePosition.y - 1] - 1;
if (bArch >= 0)
ClxDraw(out, targetBufferPosition + Displacement { 0, -TILE_HEIGHT }, (*pSpecialCels)[bArch]);
}Expected behavior:
If this solution is acceptable, I’d be happy to implement it and create a PR.
Source: diasurgical/DevilutionX