diff --git a/ChangeLog.md b/ChangeLog.md index e6cc81862..37b8811de 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,10 +1,7 @@ # Upcoming version: -Additions/Changes: -- - -Fixes: -- +Nazara Engine: +- VertexMapper:GetComponentPtr no longer throw an error if component is disabled or incompatible with template type, instead a null pointer is returned. # 0.4: diff --git a/include/Nazara/Utility/VertexMapper.inl b/include/Nazara/Utility/VertexMapper.inl index 93cc8c2d2..f3861541c 100644 --- a/include/Nazara/Utility/VertexMapper.inl +++ b/include/Nazara/Utility/VertexMapper.inl @@ -21,17 +21,10 @@ namespace Nz std::size_t offset; declaration->GetComponent(component, &enabled, &type, &offset); - if (enabled) - { - NazaraAssert(GetComponentTypeOf() == type, "Attribute type does not match template type"); - + if (enabled && GetComponentTypeOf() == type) return SparsePtr(static_cast(m_mapper.GetPointer()) + offset, declaration->GetStride()); - } else - { - NazaraError("Attribute 0x" + String::Number(component, 16) + " is not enabled"); return SparsePtr(); - } } inline const VertexBuffer* VertexMapper::GetVertexBuffer() const