added quad primitive, shortcuts and safe entity deletion

This commit is contained in:
Erris
2026-03-02 21:27:42 +01:00
parent c189b12365
commit b7e5ceb1d1
7 changed files with 171 additions and 91 deletions

View File

@@ -133,7 +133,6 @@ namespace OpenEngine {
{
auto& tag = entity.GetComponents<TagComponent>().tag;
bool entity_marked_deletion = false;
if (renamed_entity == entity && selected_context == entity) {
char buffer[255];
std::memset(buffer, 0, sizeof(buffer));
@@ -161,8 +160,10 @@ namespace OpenEngine {
bool opened = ImGui::TreeNodeEx((void*)(uint64_t)(uint32_t)entity, flags, "%s", tag.c_str());
if (ImGui::BeginPopupContextItem()) {
if (ImGui::MenuItem("Delete entity"))
entity_marked_deletion = true;
if (ImGui::MenuItem("Delete entity")) {
scene->MarkEntityForDeletion(entity);
selected_context = {};
}
ImGui::EndPopup();
}
@@ -189,12 +190,6 @@ namespace OpenEngine {
if (opened)
ImGui::TreePop();
}
if (entity_marked_deletion) {
scene->DeleteEntity(entity);
if (selected_context == entity)
selected_context = {};
}
}
void SceneHierarchy::DrawComponents(Entity& entity)