diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-09 16:17:25 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-09 16:17:25 +0100 |
commit | 977994ed4e9cea8352601f025fde6fa831f72cb9 (patch) | |
tree | 4901cf5f9d375ecfd383e66f366de46b0f82aba7 /src | |
parent | 03bce5306284e7a3fa5d0a6f158d4e91c5b61cf8 (diff) |
.
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk-walls.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp index eca7a29f..aa581c0f 100644 --- a/src/chunk-walls.cpp +++ b/src/chunk-walls.cpp @@ -239,10 +239,6 @@ GL::Mesh chunk::make_wall_mesh() } } - auto quad = get_quad(D, G, Depth); - for (auto& v : quad) - v += center; - if (pillar_ok) { if (dir.top.is_defined) @@ -276,7 +272,7 @@ GL::Mesh chunk::make_wall_mesh() v[j] = { quad[j], texcoords[j], depth }; } } - else if (corner_ok) + if (corner_ok) { if (dir.corner.is_defined) { @@ -334,6 +330,9 @@ GL::Mesh chunk::make_wall_mesh() const auto texcoords = Quads::texcoords_at(frame.offset, frame.size, atlas->image_size()); const auto depth_offset = depth_offset_for_group(G); const auto depth = tile_shader::depth_value(pos, depth_offset); + auto quad = get_quad(D, G, Depth); + for (auto& v : quad) + v += center; auto& v = vertexes[i]; for (uint8_t j = 0; j < 4; j++) v[j] = { quad[j], texcoords[j], depth }; |