diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-13 11:32:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-13 11:32:22 +0200 |
commit | 56e34d8d3388432d342b0c4749cfe044367df668 (patch) | |
tree | 66e8a150d835ead020250bf7e49e03924c0c5207 /main | |
parent | f513266d49ab0c075a3ab3e1f85dee6129cff1de (diff) |
render other layers with transparency in single-z-layer mode
Diffstat (limited to 'main')
-rw-r--r-- | main/draw.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/draw.cpp b/main/draw.cpp index 0e0f7c68..51031427 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -116,7 +116,7 @@ auto main_impl::get_draw_bounds() const noexcept -> draw_bounds void main_impl::draw_world() noexcept { - const auto [z_min, z_max] = app.get_z_bounds(); + const auto [z_min, z_max, z_cur, only] = app.get_z_bounds(); const auto [minx, maxx, miny, maxy] = get_draw_bounds(); const auto sz = window_size(); @@ -131,6 +131,12 @@ void main_impl::draw_world() noexcept GL::Renderer::setDepthMask(true); for (int8_t z = z_max; z >= z_min; z--) + { + if (only && z != z_cur) + _shader.set_tint({1, 1, 1, 0.75}); + else + _shader.set_tint({1, 1, 1, 1}); + for (int16_t y = maxy; y >= miny; y--) for (int16_t x = maxx; x >= minx; x--) { @@ -142,10 +148,11 @@ void main_impl::draw_world() noexcept const with_shifted_camera_offset o{_shader, ch, {minx, miny}, {maxx, maxy}}; if (check_chunk_visible(_shader.camera_offset(), sz)) { - _wall_mesh.draw(_shader, c); _floor_mesh.draw(_shader, c); + _wall_mesh.draw(_shader, c); } } + } GL::Renderer::setDepthMask(false); |