Final VS fixes

Former-commit-id: 6da44f94127f61de39710a52b8b3b73ce19c1269
This commit is contained in:
Lynix
2015-06-14 16:18:37 +02:00
parent 32a217ea1b
commit f4c3ec51ed
24 changed files with 57 additions and 39 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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>());
}

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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));

View File

@@ -47,7 +47,7 @@ namespace Ndk
void CameraComponent::OnAttached()
{
if (m_entity->HasComponent<NodeComponent>())
m_nodeInvalidationSlot.Connect(m_entity->GetComponent<NodeComponent>().OnNodeInvalidation, this, OnNodeInvalidated);
m_nodeInvalidationSlot.Connect(m_entity->GetComponent<NodeComponent>().OnNodeInvalidation, this, &CameraComponent::OnNodeInvalidated);
InvalidateViewMatrix();
}
@@ -57,7 +57,7 @@ namespace Ndk
if (IsComponent<NodeComponent>(component))
{
NodeComponent& nodeComponent = static_cast<NodeComponent&>(component);
m_nodeInvalidationSlot.Connect(nodeComponent.OnNodeInvalidation, this, OnNodeInvalidated);
m_nodeInvalidationSlot.Connect(nodeComponent.OnNodeInvalidation, this, &CameraComponent::OnNodeInvalidated);
InvalidateViewMatrix();
}

View File

@@ -21,7 +21,7 @@ namespace Ndk
void GraphicsComponent::OnAttached()
{
if (m_entity->HasComponent<NodeComponent>())
m_nodeInvalidationSlot.Connect(m_entity->GetComponent<NodeComponent>().OnNodeInvalidation, this, OnNodeInvalidated);
m_nodeInvalidationSlot.Connect(m_entity->GetComponent<NodeComponent>().OnNodeInvalidation, this, &GraphicsComponent::OnNodeInvalidated);
InvalidateTransformMatrix();
}
@@ -31,7 +31,7 @@ namespace Ndk
if (IsComponent<NodeComponent>(component))
{
NodeComponent& nodeComponent = static_cast<NodeComponent&>(component);
m_nodeInvalidationSlot.Connect(nodeComponent.OnNodeInvalidation, this, OnNodeInvalidated);
m_nodeInvalidationSlot.Connect(nodeComponent.OnNodeInvalidation, this, &GraphicsComponent::OnNodeInvalidated);
InvalidateTransformMatrix();
}