Optimized VertexDeclaration::GetElement
Former-commit-id: a56498837ae2f6101e0641aab23b2d1d0f9130f3
This commit is contained in:
parent
8132812c23
commit
93a1738c55
|
|
@ -244,7 +244,6 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int elementPos = m_sharedImpl->elementPos[stream][usage];
|
int elementPos = m_sharedImpl->elementPos[stream][usage];
|
||||||
|
|
||||||
#if NAZARA_UTILITY_SAFE
|
#if NAZARA_UTILITY_SAFE
|
||||||
if (elementPos == -1)
|
if (elementPos == -1)
|
||||||
{
|
{
|
||||||
|
|
@ -253,6 +252,10 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (usageIndex == 0) // Si l'usage index vaut zéro, alors nous sommes certains d'être sur le bon élément (Majorité des cas)
|
||||||
|
return &m_sharedImpl->elements[elementPos];
|
||||||
|
else
|
||||||
|
{
|
||||||
elementPos += usageIndex;
|
elementPos += usageIndex;
|
||||||
|
|
||||||
#if NAZARA_UTILITY_SAFE
|
#if NAZARA_UTILITY_SAFE
|
||||||
|
|
@ -274,6 +277,7 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return &element;
|
return &element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int NzVertexDeclaration::GetElementCount() const
|
unsigned int NzVertexDeclaration::GetElementCount() const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue