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,4 +1,4 @@
// Copyright (C) 2017 Jérôme Leclercq
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
@@ -41,6 +41,12 @@ namespace Nz
return false;
}
if (vertexDeclaration == nullptr)
{
NazaraError("The vertex declaration can't be null");
return false;
}
return true;
}
@@ -101,6 +107,7 @@ namespace Nz
NazaraAssert(m_impl, "Mesh should be created first");
NazaraAssert(m_impl->animationType == AnimationType_Static, "Submesh building only works for static meshes");
NazaraAssert(params.IsValid(), "Invalid parameters");
NazaraAssert(params.vertexDeclaration->HasComponentOfType<Vector3f>(VertexComponent_Position), "The vertex declaration doesn't have a Vector3 position component");
Boxf aabb;
IndexBufferRef indexBuffer;
@@ -109,7 +116,7 @@ namespace Nz
Matrix4f matrix(primitive.matrix);
matrix *= params.matrix;
VertexDeclaration* declaration = VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent);
VertexDeclaration* declaration = params.vertexDeclaration;
switch (primitive.type)
{