From 56e34d8d3388432d342b0c4749cfe044367df668 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 13 Apr 2023 11:32:22 +0200 Subject: render other layers with transparency in single-z-layer mode --- editor/draw.cpp | 4 +++- editor/update.cpp | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'editor') diff --git a/editor/draw.cpp b/editor/draw.cpp index 2944eae6..6ee32738 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -66,7 +66,9 @@ void app::draw_cursor() void app::draw_collision_boxes() { - const auto [z_min, z_max] = get_z_bounds(); + auto [z_min, z_max, z_cur, only] = get_z_bounds(); + if (only) + z_min = z_max = z_cur; const auto [minx, maxx, miny, maxy] = M->get_draw_bounds(); const auto sz = M->window_size(); auto& world = M->world(); diff --git a/editor/update.cpp b/editor/update.cpp index 9384cc17..d5eb2039 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -237,10 +237,7 @@ void app::set_cursor() auto app::get_z_bounds() -> z_bounds { - if (_render_all_z_levels) - return { chunk_z_min, chunk_z_max }; - else - return { _z_level, _z_level }; + return { chunk_z_min, chunk_z_max, _z_level, !_render_all_z_levels }; } void app::update(float dt) -- cgit v1.2.3