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
|
||||
|
||||
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
|
||||
|
|
@ -275,6 +278,7 @@ const NzVertexElement* NzVertexDeclaration::GetElement(nzElementStream stream, n
|
|||
|
||||
return &element;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int NzVertexDeclaration::GetElementCount() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue