diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 15:43:59 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 15:43:59 +0100 |
| commit | 23eae734c5e8a49c02e48fe0b401d610abfee9c8 (patch) | |
| tree | 02311af36b8c2a10f8b69543b7b38e498bd42bd8 /editor | |
| parent | 2e0c0009806860e4e8ac24663afdc5d926d1213f (diff) | |
a
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/imgui.cpp | 7 | ||||
| -rw-r--r-- | editor/inspect-types.cpp | 2 | ||||
| -rw-r--r-- | editor/update.cpp | 6 |
3 files changed, 7 insertions, 8 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 4ce19403..05396414 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -154,12 +154,11 @@ void app::do_popup_menu() if (auto b1 = begin_popup(SCENERY_POPUP_NAME)) { auto iter = sc->iter(); - auto& c = sc->chunk(); - if (ImGui::MenuItem("Activate", nullptr, false, sc->can_activate(iter, c))) - sc->activate(iter, c); + if (ImGui::MenuItem("Activate", nullptr, false, sc->can_activate(iter))) + sc->activate(iter); if (auto next_rot = sc->atlas->next_rotation_from(sc->r); ImGui::MenuItem("Rotate", nullptr, false, next_rot != sc->r)) - sc->rotate(iter, c, next_rot); + sc->rotate(iter, next_rot); ImGui::Separator(); diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp index 9b14c132..ead95c08 100644 --- a/editor/inspect-types.cpp +++ b/editor/inspect-types.cpp @@ -32,7 +32,7 @@ struct entity_accessors<scenery> { }, entity::type<rotation>::field{"rotation"_s, [](const scenery& x) { return x.r; }, - [](scenery& x, rotation r) { x.rotate(x.iter(), x.chunk(), r); }, + [](scenery& x, rotation r) { x.rotate(x.iter(), r); }, }, entity::type<std::uint16_t>::field{"frame"_s, [](const scenery& x) { return x.frame; }, diff --git a/editor/update.cpp b/editor/update.cpp index 24fd3086..dd985b88 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -69,7 +69,7 @@ void app::do_mouse_up_down(std::uint8_t button, bool is_down, int mods) if (button == mouse_button_left) { if (auto* cl = find_clickable_scenery(*cursor.pixel)) - return (void)cl->e->activate(cl->e->iter(), cl->e->chunk()); + return (void)cl->e->activate(cl->e->iter()); } // TODO it should open on mouseup if still on the same item as on mousedown else if (button == mouse_button_right) @@ -110,7 +110,7 @@ void app::do_rotate(bool backward) auto r = backward ? e.atlas->prev_rotation_from(e.r) : e.atlas->next_rotation_from(e.r); if (r != e.r) { - e.rotate(e.iter(), e.chunk(), r); + e.rotate(e.iter(), r); e.chunk().mark_scenery_modified(); } } @@ -192,7 +192,7 @@ void app::update_world(float dt) { auto iter = es.cbegin() + std::ptrdiff_t(i); auto& e = *es[i]; - c.with_scenery_update(e, [&] { return e.update(iter, c, dt); }); + c.with_scenery_update(e, [&] { return e.update(iter, dt); }); } } } |
