From 1c13313ec845d43077bd7e78538358ca4e007f8a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 06:29:31 +0100 Subject: sort entities by id rather than draw order --- editor/imgui-inspect.cpp | 6 ++---- editor/update.cpp | 8 +------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'editor') diff --git a/editor/imgui-inspect.cpp b/editor/imgui-inspect.cpp index d95bc441..b1ea923c 100644 --- a/editor/imgui-inspect.cpp +++ b/editor/imgui-inspect.cpp @@ -48,16 +48,14 @@ void app::draw_inspector() auto& s2 = static_cast(s); if (auto b2 = begin_window(buf, &is_open)) { - auto idx = s.index(); bool ret = entities::inspect_type(s2); - if (ret) - e->reposition(idx); + (void)ret; } } else is_open = false; if (!is_open) - inspectors.erase(inspectors.begin() + (int)i); + inspectors.erase(inspectors.begin() + (ptrdiff_t)i); } } diff --git a/editor/update.cpp b/editor/update.cpp index 63ef1432..05226f60 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -111,7 +111,6 @@ void app::do_rotate(bool backward) auto i = e.index(); auto r = backward ? e.atlas->prev_rotation_from(e.r) : e.atlas->next_rotation_from(e.r); e.rotate(i, r); - e.reposition(i); } } } @@ -197,12 +196,7 @@ start: for (auto i = size-1; i != (size_t)-1; i--) { e.last_update = curframe; auto status = e.update(i, dt); - if (status == entity_update_status::updated_repositioning) - { - //Debug{} << "reposition after update" << e.ordinal_offset({}) << off; - e.reposition(i); - } - if (status >= entity_update_status::updated_repositioned) + if (status) { //Debug{} << "goto start"; goto start; -- cgit v1.2.3