summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-08 11:16:28 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-08 19:40:24 +0200
commit457cdf24489c20f0f9b9b9877bf9e875aa643f91 (patch)
tree5c01a4cbe3935784e30b3a2a2912e62aa00ef29a /editor
parentb25edf465d08750fb5f93068cd8b8d5cd9d0dcec (diff)
wip
Diffstat (limited to 'editor')
-rw-r--r--editor/imgui.cpp5
-rw-r--r--editor/scenery-editor.cpp3
-rw-r--r--editor/vobj-editor.cpp3
3 files changed, 8 insertions, 3 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp
index 3867d227..9f43eda1 100644
--- a/editor/imgui.cpp
+++ b/editor/imgui.cpp
@@ -338,7 +338,7 @@ void app::do_popup_menu()
{
const auto [id, target] = _popup_target;
auto& w = M->world();
- auto eʹ = w.find_object(id);
+ const auto eʹ = w.find_object(id);
if (target == popup_target_type::none || !eʹ)
{
@@ -388,7 +388,10 @@ void app::do_popup_menu()
ImGui::MenuItem("Rotate", nullptr, false, next_rot != e.r && e.can_rotate(next_rot)))
e.rotate(i, next_rot);
if (ImGui::MenuItem("Delete", nullptr, false))
+ {
+ //e.on_destroy(eʹ, false);
e.chunk().remove_object(e.index());
+ }
}
else
_popup_target = {};
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp
index 07cdbd7c..7a99bbb0 100644
--- a/editor/scenery-editor.cpp
+++ b/editor/scenery-editor.cpp
@@ -92,8 +92,9 @@ start:
while (auto id = a.get_object_colliding_with_cursor())
{
for (auto i = 0uz; i < sz; i++)
- if (es[i]->id == id)
+ if (const auto eʹ = es[i]; eʹ->id == id)
{
+ //eʹ->on_destroy(eʹ, false);
c.remove_object(i);
goto start;
}
diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp
index f644ca1c..52365fd5 100644
--- a/editor/vobj-editor.cpp
+++ b/editor/vobj-editor.cpp
@@ -53,8 +53,9 @@ start: while (auto id = a.get_object_colliding_with_cursor())
{
for (auto i = (int)(es.size()-1); i >= 0; i--)
{
- if (es[i]->id == id)
+ if (const auto eʹ = es[i]; eʹ->id == id)
{
+ //eʹ->on_destroy(eʹ);
c.remove_object((unsigned)i);
goto start;
}