diff options
Diffstat (limited to 'draw')
| -rw-r--r-- | draw/ground.cpp | 2 | ||||
| -rw-r--r-- | draw/wall.cpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/draw/ground.cpp b/draw/ground.cpp index 515729b1..b049f96d 100644 --- a/draw/ground.cpp +++ b/draw/ground.cpp @@ -13,6 +13,8 @@ void ground_mesh::draw(tile_shader& shader, chunk& c) { constexpr int quad_index_count = 6; const auto [mesh_, ids, size] = c.ensure_ground_mesh(); + if (size == 0) + return; struct { ground_atlas* atlas = nullptr; size_t pos = 0; } last; GL::MeshView mesh{mesh_}; 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; |
