Added VertexMapper constructor
Removed useless headers Former-commit-id: e8925f48eec9c52dc4f2ad7bf6a61deb755bc0ee
This commit is contained in:
@@ -3,19 +3,24 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
#include <Nazara/Utility/VertexDeclaration.hpp>
|
||||
|
||||
template <typename T>
|
||||
NzSparsePtr<T> NzVertexMapper::GetComponentPtr(nzVertexComponent component)
|
||||
{
|
||||
// On récupère la déclaration depuis le buffer
|
||||
const NzVertexDeclaration* declaration = m_mapper.GetBuffer()->GetVertexDeclaration();
|
||||
|
||||
// Ensuite le composant qui nous intéresse
|
||||
bool enabled;
|
||||
nzComponentType type;
|
||||
unsigned int offset;
|
||||
m_declaration->GetComponent(component, &enabled, &type, &offset);
|
||||
declaration->GetComponent(component, &enabled, &type, &offset);
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
///TODO: Vérifier le rapport entre le type de l'attribut et le type template ?
|
||||
return NzSparsePtr<T>(static_cast<nzUInt8*>(m_mapper.GetPointer()) + offset, m_declaration->GetStride());
|
||||
return NzSparsePtr<T>(static_cast<nzUInt8*>(m_mapper.GetPointer()) + offset, declaration->GetStride());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user