From 5daa12fed0449a7811fc25ec62236bc060a56fa7 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 9 Sep 2025 16:05:14 -0400 Subject: pke: first-pass promote pke_level over pke_scene Major runtime ownership overhaul (scene -> level). Major ecs 'marked for removal' overhaul, ensuring that entities and their components are actually being removed when levels are unloaded. --- src/static-ui.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/static-ui.cpp') diff --git a/src/static-ui.cpp b/src/static-ui.cpp index f80c000..b4bdc5c 100644 --- a/src/static-ui.cpp +++ b/src/static-ui.cpp @@ -575,17 +575,15 @@ void pke_ui_tick(double delta) { // This currently only calls tear-down for boxes on the root list. // Leaving this as-is for the time being because you can control the // visibility of child boxes with flags and don't need to completely remove them. - for (u = 0; u < EntitiesToBeRemoved.next; ++u) { - if (EntitiesToBeRemoved[u] == box) { - pke_ui_teardown_box_recursive(box); - for (ii = 0; i + ii + 1 < pke_ui_master.r_root_boxes; ++ii) { - pke_ui_master.root_boxes[i + ii] = pke_ui_master.root_boxes[i + ii + 1]; - } - pke_ui_master.h_root_boxes -= 1; - i -= 1; - pke_ui_master.should_update_buffer = true; - goto skip_calc; + if (box->isMarkedForRemoval == true) { + pke_ui_teardown_box_recursive(box); + for (ii = 0; i + ii + 1 < pke_ui_master.r_root_boxes; ++ii) { + pke_ui_master.root_boxes[i + ii] = pke_ui_master.root_boxes[i + ii + 1]; } + pke_ui_master.h_root_boxes -= 1; + i -= 1; + pke_ui_master.should_update_buffer = true; + goto skip_calc; } pke_ui_calc_px(arr, tmp_txtr_arr, nullptr, box); pke_ui_recalc_sizes_recursive(arr, tmp_txtr_arr, box); -- cgit v1.2.3