diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-12 18:58:52 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-12 19:08:03 +0200 |
commit | 38efeacfd21be1c44d51b18fe9a11b0624a77cda (patch) | |
tree | ad6b8632d302836e968db0115a3357694c948d5c /main | |
parent | ee38547c4f22ed48572a605ca71f26bd374a90ba (diff) |
aaaa
Diffstat (limited to 'main')
-rw-r--r-- | main/draw.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/main/draw.cpp b/main/draw.cpp index db3bbd0c..a4291b7d 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -126,10 +126,9 @@ void main_impl::draw_world() noexcept #endif GL::Renderer::enable(GL::Renderer::Feature::DepthTest); - for (int8_t z = z_max; z >= z_min; z--) - { - GL::Renderer::setDepthMask(true); + GL::Renderer::setDepthMask(true); + for (int8_t z = z_max; z >= z_min; z--) for (int16_t y = maxy; y >= miny; y--) for (int16_t x = maxx; x >= minx; x--) { @@ -141,13 +140,15 @@ void main_impl::draw_world() noexcept const with_shifted_camera_offset o{_shader, pos, {minx, miny}, {maxx, maxy}}; if (check_chunk_visible(_shader.camera_offset(), sz)) { + _wall_mesh.draw(_shader, c); _floor_mesh.draw(_shader, c); } } - GL::Renderer::setDepthMask(false); + GL::Renderer::setDepthMask(false); + for (int8_t z = z_max; z >= z_min; z--) for (int16_t y = maxy; y >= miny; y--) for (int16_t x = maxx; x >= minx; x--) { @@ -160,9 +161,9 @@ void main_impl::draw_world() noexcept if (check_chunk_visible(_shader.camera_offset(), sz)) _anim_mesh.draw(_shader, sz, c, _clickable_scenery); } - } GL::Renderer::setDepthMask(true); + GL::Renderer::disable(GL::Renderer::Feature::DepthTest); } |