diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-09-09 16:05:14 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-09-09 16:05:14 -0400 |
| commit | 5daa12fed0449a7811fc25ec62236bc060a56fa7 (patch) | |
| tree | 5af5ff1c4de2ab49dd4d1db9934b3b4ee34a54c2 /src/static-ui.cpp | |
| parent | c40277cd665e04d300ea839a1dd2ff675655f5fb (diff) | |
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.
Diffstat (limited to 'src/static-ui.cpp')
| -rw-r--r-- | src/static-ui.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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); |
