diff --git a/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.cpp b/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.cpp index fc667ad7..c2e8a62e 100644 --- a/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.cpp +++ b/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.cpp @@ -280,10 +280,22 @@ void PrefabEditorWindow::Draw() DrawEntityTree(prefab->Root); + + ImGui::PopStyleVar(); } ImGui::EndTable(); + if (QueueDeletion.GetHandle() != -1) + { + virtualScene->DestroyEntity(QueueDeletion); + + // Clear Selection + Selection = EditorSelection(); + + QueueDeletion = Nuake::Entity{ (entt::entity)-1, scene.get() }; + } + } ImGui::EndChild(); ImGui::PopStyleVar(); @@ -511,7 +523,7 @@ void PrefabEditorWindow::DrawEntityTree(Nuake::Entity e) if (!isRenaming && Selection.Type == EditorSelectionType::Entity && Input::IsKeyPressed(Key::DELETE_KEY)) { - //QueueDeletion = Selection.Entity; + QueueDeletion = Selection.Entity; } if (ImGui::BeginPopupContextItem()) @@ -534,7 +546,7 @@ void PrefabEditorWindow::DrawEntityTree(Nuake::Entity e) if (ImGui::Selectable("Remove")) { - //QueueDeletion = e; + QueueDeletion = e; } if (entity.GetComponent().HasParent && ImGui::Selectable("Move to root")) diff --git a/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.h b/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.h index e9a866b5..c376a3c0 100644 --- a/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.h +++ b/Editor/src/Windows/PrefabEditor/PrefabEditorWindow.h @@ -10,6 +10,7 @@ namespace Nuake class Scene; class FrameBuffer; class Texture; + class Entity; } class PrefabEditorWindow @@ -36,6 +37,7 @@ private: EditorSelectionPanel SelectionPanel; EditorSelection Selection; + Nuake::Entity QueueDeletion; private: void DrawViewportWindow(); diff --git a/Nuake/src/Rendering/SceneRenderer.cpp b/Nuake/src/Rendering/SceneRenderer.cpp index 2936c6e4..fc1c076a 100644 --- a/Nuake/src/Rendering/SceneRenderer.cpp +++ b/Nuake/src/Rendering/SceneRenderer.cpp @@ -863,6 +863,7 @@ namespace Nuake Renderer::Flush(gBufferShader, true); } + glDisable(GL_CULL_FACE); // Sprites { ZoneScopedN("Render Sprites"); diff --git a/Nuake/src/Scene/Components/SpriteComponent.cpp b/Nuake/src/Scene/Components/SpriteComponent.cpp index 369e0a92..0e0cb3d0 100644 --- a/Nuake/src/Scene/Components/SpriteComponent.cpp +++ b/Nuake/src/Scene/Components/SpriteComponent.cpp @@ -13,7 +13,6 @@ namespace Nuake Billboard(false), LockYRotation(false) { - } bool SpriteComponent::LoadSprite() @@ -74,6 +73,8 @@ namespace Nuake PositionFacing = j["PositionFacing"]; } + LoadSprite(); + return true; } } \ No newline at end of file