diff --git a/Nuake/src/Scene/Scene.cpp b/Nuake/src/Scene/Scene.cpp index 2ae9bc3a..a48f3e6b 100644 --- a/Nuake/src/Scene/Scene.cpp +++ b/Nuake/src/Scene/Scene.cpp @@ -469,7 +469,6 @@ namespace Nuake } entity.Destroy(); - m_Registry.shrink_to_fit(); } bool Scene::EntityExists(const std::string& name) @@ -638,11 +637,12 @@ namespace Nuake // This will turn the deserialized entity ids into actual Entities. // This has to be done after the whole scene has been deserialized - // to make sure we can fetch the id in the scene. Otherwise, we could - m_Registry.each([this](auto e) { + // to make sure we can fetch the id in the scene. Otherwise, we could + for (const entt::entity& e : m_Registry.view()) + { auto entity = Entity{ e, this }; entity.PostDeserialize(); - }); + }; return true; } diff --git a/Nuake/src/Scene/Scene.h b/Nuake/src/Scene/Scene.h index 47cd63cf..aa3e6ff7 100644 --- a/Nuake/src/Scene/Scene.h +++ b/Nuake/src/Scene/Scene.h @@ -2,7 +2,7 @@ #include "src/Core/Core.h" #include "src/Core/Maths.h" -#include "entt/entt.hpp" +#include #include "src/Rendering/Camera.h" #include "Lighting/Environment.h"