Final VS fixes
Former-commit-id: 6da44f94127f61de39710a52b8b3b73ce19c1269
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
namespace Ndk
|
||||
{
|
||||
template<unsigned int N> ComponentId BuildComponentId(const char (&name)[N]);
|
||||
template<typename ComponentType> constexpr ComponentIndex GetComponentIndex();
|
||||
template<typename SystemType> constexpr SystemIndex GetSystemIndex();
|
||||
template<typename ComponentType> ComponentIndex GetComponentIndex();
|
||||
template<typename SystemType> SystemIndex GetSystemIndex();
|
||||
template<typename ComponentType, unsigned int N> ComponentIndex InitializeComponent(const char (&name)[N]);
|
||||
template<typename SystemType> SystemIndex InitializeSystem();
|
||||
template<typename ComponentType, typename C> bool IsComponent(C& component);
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace Ndk
|
||||
}
|
||||
|
||||
template<typename ComponentType>
|
||||
constexpr ComponentIndex GetComponentIndex()
|
||||
ComponentIndex GetComponentIndex()
|
||||
{
|
||||
return ComponentType::componentIndex;
|
||||
}
|
||||
|
||||
template<typename SystemType>
|
||||
constexpr SystemIndex GetSystemIndex()
|
||||
SystemIndex GetSystemIndex()
|
||||
{
|
||||
return SystemType::systemIndex;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ndk
|
||||
template<typename ComponentType>
|
||||
void BaseSystem::Excludes()
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value , "ComponentType is not a component");
|
||||
|
||||
ExcludesComponent(GetComponentIndex<ComponentType>());
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace Ndk
|
||||
template<typename ComponentType>
|
||||
void BaseSystem::Requires()
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
RequiresComponent(GetComponentIndex<ComponentType>());
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace Ndk
|
||||
template<typename ComponentType>
|
||||
void BaseSystem::RequiresAny()
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
RequiresAnyComponent(GetComponentIndex<ComponentType>());
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Ndk
|
||||
{
|
||||
m_target = renderTarget;
|
||||
if (m_target)
|
||||
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, OnRenderTargetRelease);
|
||||
m_targetReleaseSlot.Connect(m_target->OnRenderTargetRelease, this, &CameraComponent::OnRenderTargetRelease);
|
||||
else
|
||||
m_targetReleaseSlot.Disconnect();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Ndk
|
||||
m_renderables.emplace_back(m_transformMatrix);
|
||||
Renderable& r = m_renderables.back();
|
||||
r.renderable = std::move(renderable);
|
||||
r.renderableInvalidationSlot.Connect(r.renderable->OnRenderableInvalidateInstanceData, std::bind(InvalidateRenderableData, this, std::placeholders::_1, std::placeholders::_2, m_renderables.size()-1));
|
||||
r.renderableInvalidationSlot.Connect(r.renderable->OnRenderableInvalidateInstanceData, std::bind(&GraphicsComponent::InvalidateRenderableData, this, std::placeholders::_1, std::placeholders::_2, m_renderables.size()-1));
|
||||
}
|
||||
|
||||
inline void GraphicsComponent::EnsureTransformMatrixUpdate() const
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Ndk
|
||||
template<typename ComponentType, typename... Args>
|
||||
ComponentType& Entity::AddComponent(Args&&... args)
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
// Allocation et affectation du component
|
||||
std::unique_ptr<ComponentType> ptr(new ComponentType(std::forward<Args>(args)...));
|
||||
@@ -34,7 +34,7 @@ namespace Ndk
|
||||
ComponentType& Entity::GetComponent()
|
||||
{
|
||||
///DOC: Le component doit être présent
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
ComponentIndex index = GetComponentIndex<ComponentType>();
|
||||
return static_cast<ComponentType&>(GetComponent(index));
|
||||
@@ -68,7 +68,7 @@ namespace Ndk
|
||||
template<typename ComponentType>
|
||||
bool Entity::HasComponent() const
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>(), "ComponentType is not a component");
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
ComponentIndex index = GetComponentIndex<ComponentType>();
|
||||
return HasComponent(index);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Ndk
|
||||
template<typename SystemType, typename... Args>
|
||||
SystemType& World::AddSystem(Args&&... args)
|
||||
{
|
||||
static_assert(std::is_base_of<BaseSystem, SystemType>(), "SystemType is not a component");
|
||||
static_assert(std::is_base_of<BaseSystem, SystemType>::value, "SystemType is not a component");
|
||||
|
||||
// Allocation et affectation du component
|
||||
std::unique_ptr<SystemType> ptr(new SystemType(std::forward(args)...));
|
||||
@@ -73,7 +73,7 @@ namespace Ndk
|
||||
SystemType& World::GetSystem()
|
||||
{
|
||||
///DOC: Le système doit être présent
|
||||
static_assert(std::is_base_of<BaseSystem, SystemType>(), "SystemType is not a system");
|
||||
static_assert(std::is_base_of<BaseSystem, SystemType>::value, "SystemType is not a system");
|
||||
|
||||
SystemIndex index = GetSystemIndex<SystemType>();
|
||||
return static_cast<SystemType&>(GetSystem(index));
|
||||
|
||||
Reference in New Issue
Block a user