Vertex declaration changes (#135)

* Add type to ComponentType conversion

* Change type to ComponentType conversion

* Change assert to condition, add check on particle mapper.

* Change particle life type

* Changes as requested

* Fix Travis try 1

* Changes as requested

* move IsSuitableForComponent to inl
This commit is contained in:
larnin
2017-10-02 15:21:03 +02:00
committed by Jérôme Leclercq
parent bbac0838dd
commit 40a678889d
13 changed files with 125 additions and 21 deletions

View File

@@ -1,9 +1,10 @@
// Copyright (C) 2017 Jérôme Leclercq
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Error.hpp>
#include <Nazara/Graphics/Debug.hpp>
#include <Nazara/Utility/Algorithm.hpp>
namespace Nz
{
@@ -26,7 +27,7 @@ namespace Nz
std::size_t offset;
m_declaration->GetComponent(component, &enabled, &type, &offset);
if (enabled)
if (enabled && GetComponentTypeOf<T>() == type)
{
///TODO: Check the ratio between the type of the attribute and the template type ?
return SparsePtr<T>(m_ptr + offset, m_declaration->GetStride());
@@ -57,7 +58,7 @@ namespace Nz
std::size_t offset;
m_declaration->GetComponent(component, &enabled, &type, &offset);
if (enabled)
if (enabled && GetComponentTypeOf<T>() == type)
{
///TODO: Check the ratio between the type of the attribute and the template type ?
return SparsePtr<const T>(m_ptr + offset, m_declaration->GetStride());