Add initial ECS support
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2021 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequisites.hpp
|
||||
|
||||
#include <Nazara/Utility/Components/NodeComponent.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
void NodeComponent::SetParent(entt::registry& registry, entt::entity entity, bool keepDerived)
|
||||
{
|
||||
NodeComponent* nodeComponent = registry.try_get<NodeComponent>(entity);
|
||||
NazaraAssert(nodeComponent, "entity doesn't have a NodeComponent");
|
||||
|
||||
Node::SetParent(nodeComponent, keepDerived);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <Nazara/Utility/Utility.hpp>
|
||||
#include <Nazara/Core/CallOnExit.hpp>
|
||||
#include <Nazara/Core/Core.hpp>
|
||||
#include <Nazara/Core/ECS.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Utility/Animation.hpp>
|
||||
#include <Nazara/Utility/Buffer.hpp>
|
||||
@@ -39,6 +40,8 @@ namespace Nz
|
||||
Utility::Utility(Config /*config*/) :
|
||||
ModuleBase("Utility", this)
|
||||
{
|
||||
ECS::RegisterComponents();
|
||||
|
||||
if (!Buffer::Initialize())
|
||||
throw std::runtime_error("failed to initialize buffers");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user