This commit is contained in:
Jérôme Leclercq
2017-10-20 16:36:45 +02:00
5 changed files with 241 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ namespace Nz
* If the declaration has a Vector3f Normals component enabled, Normals are generated.
* If the declaration has a Vector3f Tangents component enabled, Tangents are generated.
*/
VertexDeclaration* vertexDeclaration = VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent);
VertexDeclarationConstRef vertexDeclaration = VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent);
bool IsValid() const;
};

View File

@@ -21,17 +21,10 @@ namespace Nz
std::size_t offset;
declaration->GetComponent(component, &enabled, &type, &offset);
if (enabled)
{
NazaraAssert(GetComponentTypeOf<T>() == type, "Attribute type does not match template type");
if (enabled && GetComponentTypeOf<T>() == type)
return SparsePtr<T>(static_cast<UInt8*>(m_mapper.GetPointer()) + offset, declaration->GetStride());
}
else
{
NazaraError("Attribute 0x" + String::Number(component, 16) + " is not enabled");
return SparsePtr<T>();
}
}
inline const VertexBuffer* VertexMapper::GetVertexBuffer() const