diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-10 16:44:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-10 16:45:15 +0200 |
commit | 5fc2c1c191440e876a26696d8879110dacf63145 (patch) | |
tree | d55e92c605e34f36ba1850b56f8eaf0f1c004c96 /editor | |
parent | 7faafed3101f899dd1a3f12812d54448485ef735 (diff) |
editor: no need to goto start in update_world()
Diffstat (limited to 'editor')
-rw-r--r-- | editor/update.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/editor/update.cpp b/editor/update.cpp index 630d1397..0b82c099 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -190,8 +190,8 @@ void app::apply_commands(const key_set& keys) void app::update_world(float dt) { auto& world = M->world(); - const auto curframe = world.increment_frame_no(); auto [z_min, z_max] = get_z_bounds(); + world.increment_frame_no(); auto [minx, maxx, miny, maxy] = M->get_draw_bounds(); minx--; miny--; maxx++; maxy++; for (int8_t z = z_min; z <= z_max; z++) @@ -203,22 +203,9 @@ void app::update_world(float dt) continue; auto& c = *c_; const auto& es = c.entities(); -start: const auto size = es.size(); + const auto size = es.size(); for (auto i = size-1; i != (size_t)-1; i--) - { - auto& e = *es[i]; - using last_update_type = std::decay_t<decltype(e.last_update)>; - if (last_update_type(curframe) != e.last_update) [[likely]] - { - e.last_update = last_update_type(curframe); - auto status = e.update(i, dt); - if (status) - { - //Debug{} << "goto start"; - goto start; - } - } - } + (void)es[i]->update(i, dt); } } |