Switch from Nz prefix to namespace Nz
What a huge commit Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
This commit is contained in:
@@ -5,28 +5,31 @@
|
||||
#include <Nazara/Utility/VertexDeclaration.hpp>
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
|
||||
template <typename T>
|
||||
NzSparsePtr<T> NzVertexMapper::GetComponentPtr(nzVertexComponent component)
|
||||
namespace Nz
|
||||
{
|
||||
// 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;
|
||||
declaration->GetComponent(component, &enabled, &type, &offset);
|
||||
|
||||
if (enabled)
|
||||
template <typename T>
|
||||
SparsePtr<T> VertexMapper::GetComponentPtr(VertexComponent component)
|
||||
{
|
||||
///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, declaration->GetStride());
|
||||
}
|
||||
else
|
||||
{
|
||||
NazaraError("Attribute 0x" + NzString::Number(component, 16) + " is not enabled");
|
||||
return NzSparsePtr<T>();
|
||||
// On récupère la déclaration depuis le buffer
|
||||
const VertexDeclaration* declaration = m_mapper.GetBuffer()->GetVertexDeclaration();
|
||||
|
||||
// Ensuite le composant qui nous intéresse
|
||||
bool enabled;
|
||||
ComponentType type;
|
||||
unsigned int 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 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Utility/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user