(VertexMapper) Updated interface

Added access parameter
Removed useless GetVertexCount method


Former-commit-id: 670d16ed9668eb5df476a592929ed9c364b1f11a
This commit is contained in:
Lynix
2015-01-26 17:11:00 +01:00
parent ab538e0e2d
commit 5e3fdbca89
4 changed files with 11 additions and 22 deletions

View File

@@ -10,7 +10,7 @@
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/Debug.hpp>
NzVertexMapper::NzVertexMapper(NzSubMesh* subMesh)
NzVertexMapper::NzVertexMapper(NzSubMesh* subMesh, nzBufferAccess access)
{
NzErrorFlags flags(nzErrorFlag_ThrowException, true);
@@ -37,26 +37,17 @@ NzVertexMapper::NzVertexMapper(NzSubMesh* subMesh)
NazaraInternalError("Animation type not handled (0x" + NzString::Number(subMesh->GetAnimationType(), 16) + ')');
}
m_vertexCount = subMesh->GetVertexCount();
m_mapper.Map(buffer, nzBufferAccess_ReadWrite);
m_mapper.Map(buffer, access);
}
NzVertexMapper::NzVertexMapper(NzVertexBuffer* vertexBuffer, unsigned int vertexCount)
NzVertexMapper::NzVertexMapper(NzVertexBuffer* vertexBuffer, nzBufferAccess access)
{
NzErrorFlags flags(nzErrorFlag_ThrowException, true);
m_mapper.Map(vertexBuffer, nzBufferAccess_ReadWrite);
m_vertexCount = vertexCount;
m_mapper.Map(vertexBuffer, access);
}
NzVertexMapper::~NzVertexMapper() = default;
unsigned int NzVertexMapper::GetVertexCount() const
{
return m_vertexCount;
}
void NzVertexMapper::Unmap()
{
m_mapper.Unmap();