Added TriangleIterator::Unmap()
Former-commit-id: 8ef858c5374c6701c087d0f4b1644bb6704e1131
This commit is contained in:
parent
be7afed144
commit
5eac4de406
|
|
@ -34,6 +34,8 @@ class NAZARA_API NzTriangleIterator
|
|||
void SetTangent(unsigned int i, const NzVector3f& tangent);
|
||||
void SetTexCoords(unsigned int i, const NzVector2f& texCoords);
|
||||
|
||||
void Unmap();
|
||||
|
||||
private:
|
||||
nzPrimitiveType m_primitiveType;
|
||||
nzUInt32 m_triangleIndices[3];
|
||||
|
|
|
|||
|
|
@ -29,9 +29,7 @@ bool NzTriangleIterator::Advance()
|
|||
{
|
||||
if (m_currentIndex >= m_indexCount)
|
||||
{
|
||||
///FIXME: Que faire si Advance() est appelé deux fois
|
||||
m_indexMapper.Unmap();
|
||||
m_vertexMapper.Unmap();
|
||||
Unmap();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -164,3 +162,10 @@ void NzTriangleIterator::SetTexCoords(unsigned int i, const NzVector2f& texCoord
|
|||
|
||||
m_vertexMapper.SetTexCoords(m_triangleIndices[i], texCoords);
|
||||
}
|
||||
|
||||
void NzTriangleIterator::Unmap()
|
||||
{
|
||||
// Peut très bien être appellé plusieurs fois de suite, seul le premier appel sera pris en compte
|
||||
m_indexMapper.Unmap();
|
||||
m_vertexMapper.Unmap();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -326,6 +326,9 @@ void NzVertexMapper::SetTexCoords(unsigned int i, const NzVector2f& texCoords)
|
|||
|
||||
void NzVertexMapper::Unmap()
|
||||
{
|
||||
delete m_impl;
|
||||
m_impl = nullptr;
|
||||
if (m_impl)
|
||||
{
|
||||
delete m_impl;
|
||||
m_impl = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue