diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-10 23:35:48 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-10 23:35:48 +0100 |
commit | 9aba8139b728d3b25f5763ddc134b09e5a2e1948 (patch) | |
tree | 37f18eee33ba98b79c5980961a0f12fbc9017b51 /src/chunk-walls.cpp | |
parent | 4e46a8101b2063457ac0c56770e58cd0bedf52ea (diff) |
w
Diffstat (limited to 'src/chunk-walls.cpp')
-rw-r--r-- | src/chunk-walls.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp index 01cc39b6..6e9fd51b 100644 --- a/src/chunk-walls.cpp +++ b/src/chunk-walls.cpp @@ -190,9 +190,19 @@ GL::Mesh chunk::make_wall_mesh() { CORRADE_ASSUME(G < Group_::COUNT); - if (G == Group_::corner_L && D != Direction_::N || - G == Group_::corner_R && D != Direction_::W) [[unlikely]] - continue; + switch (G) + { + case Wall::Group_::corner_L: + if (D != Direction_::N || !_walls->atlases[k+1]) + continue; + break; + case Wall::Group_::corner_R: + if (D != Direction_::W || !_walls->atlases[k-1]) + continue; + break; + default: + break; + } const auto& group = dir.*member; if (!group.is_defined) @@ -225,7 +235,8 @@ GL::Mesh chunk::make_wall_mesh() auto index_view = make_indexes(N); GL::Mesh mesh{GL::MeshPrimitive::Triangles}; - mesh.addVertexBuffer(GL::Buffer{vertex_view}, 0, tile_shader::Position{}, tile_shader::TextureCoordinates{}, tile_shader::Depth{}) + mesh.addVertexBuffer(GL::Buffer{vertex_view}, 0, + tile_shader::Position{}, tile_shader::TextureCoordinates{}, tile_shader::Depth{}) .setIndexBuffer(GL::Buffer{index_view}, 0, GL::MeshIndexType::UnsignedShort) .setCount(int32_t(6 * N)); fm_debug_assert((size_t)mesh.count() == N*6); |