Optimized VertexDeclaration::GetElement

Former-commit-id: a56498837ae2f6101e0641aab23b2d1d0f9130f3
This commit is contained in:
Lynix 2012-10-29 10:00:57 +01:00
parent 8132812c23
commit 93a1738c55
1 changed files with 24 additions and 20 deletions

View File

@ -244,7 +244,6 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
#endif
int elementPos = m_sharedImpl->elementPos[stream][usage];
#if NAZARA_UTILITY_SAFE
if (elementPos == -1)
{
@ -253,6 +252,10 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
}
#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;
#if NAZARA_UTILITY_SAFE
@ -274,6 +277,7 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
#endif
return &element;
}
}
unsigned int NzVertexDeclaration::GetElementCount() const