Skip to content

Commit

Permalink
dun_render_benchmark: Do not crash on foliage
Browse files Browse the repository at this point in the history
When sampling the tiles to benchmark on, simply skip potential foliage
tiles.
  • Loading branch information
glebm committed Sep 5, 2024
1 parent 299b6bf commit 88cddb0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/dun_render_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ void InitOnce()
for (size_t i = 0; i < 700; ++i) {
for (size_t j = 0; j < 10; ++j) {
if (const LevelCelBlock levelCelBlock = DPieceMicros[i].mt[j]; levelCelBlock.hasValue()) {
if ((j == 0 || j == 1) && levelCelBlock.type() == TileType::TransparentSquare) {
// This could actually be re-encoded foliage, which is a triangle followed by TransparentSquare.
// Simply skip it.
continue;
}
Tiles[levelCelBlock.type()].push_back(levelCelBlock);
}
}
Expand Down

0 comments on commit 88cddb0

Please sign in to comment.