From 38efeacfd21be1c44d51b18fe9a11b0624a77cda Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 12 Apr 2023 18:58:52 +0200 Subject: aaaa --- main/draw.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main/draw.cpp') 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); } -- cgit v1.2.3