Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stairs rendering in Caves and Hell #7439

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/engine/render/scrollrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ constexpr auto RightFrameDisplacement = Displacement { DunFrameWidth, 0 };

[[nodiscard]] DVL_ALWAYS_INLINE bool IsFloor(Point tilePosition)
{
return !TileHasAny(tilePosition, TileProperties::Solid);
return !TileHasAny(tilePosition, TileProperties::Solid | TileProperties::BlockMissile);
}

[[nodiscard]] DVL_ALWAYS_INLINE bool IsWall(Point tilePosition)
Expand Down
4 changes: 4 additions & 0 deletions Source/levels/gendung.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ void LoadLevelSOLData()
break;
case DTYPE_CAVES:
LoadFileInMem("levels\\l3data\\l3.sol", SOLData);
// The graphics for tile 48 sub-tile 171 frame 461 are partly incorrect, as they
// have a few pixels that should belong to the solid tile 49 instead.
// Marks the sub-tile as "BlockMissile" to avoid treating it as a floor during rendering.
SOLData[170] |= TileProperties::BlockMissile;
break;
case DTYPE_HELL:
LoadFileInMem("levels\\l4data\\l4.sol", SOLData);
Expand Down
3 changes: 2 additions & 1 deletion Source/levels/reencode_dun_cels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ struct DunFrameInfo {

[[nodiscard]] bool isFloor() const
{
return !HasAnyOf(properties, TileProperties::Solid)
// The BlockMissile check is for stairs in L3 and L4, e.g. tile 46 sub-tile 141 frame 386 in L4.
return !HasAnyOf(properties, TileProperties::Solid | TileProperties::BlockMissile)
&& (microTileIndex == 0 || microTileIndex == 1);
}
[[nodiscard]] bool isFloorLeft() const { return microTileIndex == 0; }
Expand Down
Loading