Cleanup
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
#include "HydraActor.h"
|
||||
#include "HydraActorManager.h"
|
||||
#include "../engine/HydraEngine.h"
|
||||
#include "../ecs/HydraECS.h"
|
||||
void HydraActor::Delete()
|
||||
{
|
||||
GetEngine()->ECS()->DestroyEntity(GetID());
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class CLASS_DEFINE HydraActor : public HydraObject
|
||||
std::vector<HydraID> m_children;
|
||||
std::vector<uint32_t> m_component_types;
|
||||
uint32_t m_components_waiting = 0;
|
||||
void Delete();
|
||||
friend class HydraActorManager;
|
||||
friend class HydraDeleteActorTask;
|
||||
protected:
|
||||
@@ -27,7 +28,8 @@ class CLASS_DEFINE HydraActor : public HydraObject
|
||||
virtual void DeferredInitialiseComponents() {};
|
||||
HydraID GetID() {return m_id;}
|
||||
virtual void FixedTick(float delta_t) {};
|
||||
virtual void Destroy()= 0;
|
||||
|
||||
virtual void _Cleanup(){};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ void HydraActorManager::DeleteActor(HydraID actorID)
|
||||
if(m_actors[actorID] != nullptr)
|
||||
{
|
||||
|
||||
m_actors[actorID]->Destroy();
|
||||
m_actors[actorID]->Delete();
|
||||
_SetActorDeleted(actorID);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../ecs/components/HydraDirectionalShadowSourceComponent.h"
|
||||
|
||||
#include "../buffer/HydraLightBufferManager.h"
|
||||
#include "../buffer/HydraLightBuffer.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,3 @@ void HydraDirectionalLightActor::InitialiseComponents()
|
||||
HydraDirectionalShadowSourceComponent shadow_component = {};
|
||||
ecs->AddComponent<HydraDirectionalShadowSourceComponent>(GetID(), shadow_component);
|
||||
}
|
||||
|
||||
void HydraDirectionalLightActor::Destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class CLASS_DEFINE HydraDirectionalLightActor : public HydraActor
|
||||
|
||||
public:
|
||||
virtual void InitialiseComponents() override;
|
||||
virtual void Destroy() override;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class CLASS_DEFINE HydraGLTFActor : public HydraActor
|
||||
|
||||
public:
|
||||
virtual void InitialiseComponents() override {}
|
||||
virtual void Destroy() override {}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "../ecs/components/HydraPointShadowSourceComponent.h"
|
||||
#include "../ecs/components/HydraLightComponent.h"
|
||||
#include "../buffer/HydraLightBufferManager.h"
|
||||
#include "../buffer/HydraLightBuffer.h"
|
||||
|
||||
|
||||
|
||||
void HydraPointLightActor::InitialiseComponents()
|
||||
@@ -32,7 +32,3 @@ void HydraPointLightActor::InitialiseComponents()
|
||||
ecs->AddComponent<HydraPointShadowSourceComponent>(GetID(), shadow_component);
|
||||
}
|
||||
|
||||
void HydraPointLightActor::Destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class CLASS_DEFINE HydraPointLightActor : public HydraActor
|
||||
|
||||
public:
|
||||
virtual void InitialiseComponents() override;
|
||||
virtual void Destroy() override;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../ecs/components/HydraSpotShadowSourceComponent.h"
|
||||
|
||||
#include "../buffer/HydraLightBufferManager.h"
|
||||
#include "../buffer/HydraLightBuffer.h"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,3 @@ void HydraSpotLightActor::InitialiseComponents()
|
||||
ecs->AddComponent<HydraSpotShadowSourceComponent>(GetID(), shadow_component);
|
||||
}
|
||||
|
||||
void HydraSpotLightActor::Destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class CLASS_DEFINE HydraSpotLightActor : public HydraActor
|
||||
|
||||
public:
|
||||
virtual void InitialiseComponents() override;
|
||||
virtual void Destroy() override;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user