diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-08-26 20:43:03 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-09-20 16:08:45 +0200 |
| commit | 1efe1e05181a9131cbcf114122513fc91e65014f (patch) | |
| tree | 36ded0d6dc87bcf8b55e7c2800ebb2be177222a1 /draw/wall.cpp | |
| parent | a0b26eea80f4703c632a60efcc4115e826e36506 (diff) | |
src/chunk: don't allocate empty ground/wall/scenery meshes
Diffstat (limited to 'draw/wall.cpp')
| -rw-r--r-- | draw/wall.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/draw/wall.cpp b/draw/wall.cpp index 1c9c80cc..cbe90b23 100644 --- a/draw/wall.cpp +++ b/draw/wall.cpp @@ -16,6 +16,9 @@ wall_mesh::wall_mesh() = default; void wall_mesh::draw(tile_shader& shader, chunk& c) { const auto [mesh_, ids, size] = c.ensure_wall_mesh(); + if (size == 0) + return; + struct { wall_atlas* atlas = nullptr; size_t pos = 0; } last; GL::MeshView mesh{mesh_}; [[maybe_unused]] size_t draw_count = 0; |
