Fixed last commit
Former-commit-id: 5034392dbdab232be71f8537638ed75c1c81eab8
This commit is contained in:
parent
02f5385eaf
commit
520643140c
|
|
@ -37,7 +37,7 @@ class NAZARA_API NzIndexBuffer : public NzResource
|
||||||
|
|
||||||
bool SetStorage(nzBufferStorage storage);
|
bool SetStorage(nzBufferStorage storage);
|
||||||
|
|
||||||
bool Unmap() const;
|
void Unmap() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NzBuffer* m_buffer;
|
NzBuffer* m_buffer;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class NAZARA_API NzVertexBuffer : public NzResource
|
||||||
|
|
||||||
bool SetStorage(nzBufferStorage storage);
|
bool SetStorage(nzBufferStorage storage);
|
||||||
|
|
||||||
bool Unmap() const;
|
void Unmap() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NzBuffer* m_buffer;
|
NzBuffer* m_buffer;
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,7 @@ void NzDebugDrawer::Draw(const NzCubef& cube)
|
||||||
vertex->position.Set(max.x, min.y, max.z);
|
vertex->position.Set(max.x, min.y, max.z);
|
||||||
vertex++;
|
vertex++;
|
||||||
|
|
||||||
if (!vertexBuffer->Unmap())
|
vertexBuffer->Unmap();
|
||||||
NazaraWarning("Failed to unmap buffer");
|
|
||||||
|
|
||||||
const NzShader* oldShader = NzRenderer::GetShader();
|
const NzShader* oldShader = NzRenderer::GetShader();
|
||||||
|
|
||||||
|
|
@ -199,8 +198,7 @@ void NzDebugDrawer::Draw(const NzSkeleton* skeleton)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vertexBuffer->Unmap())
|
vertexBuffer->Unmap();
|
||||||
NazaraWarning("Failed to unmap buffer");
|
|
||||||
|
|
||||||
if (vertexCount > 0)
|
if (vertexCount > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,7 @@ bool NzBuffer::CopyContent(NzBuffer& buffer)
|
||||||
|
|
||||||
bool r = Fill(ptr, 0, buffer.GetLength());
|
bool r = Fill(ptr, 0, buffer.GetLength());
|
||||||
|
|
||||||
if (!buffer.Unmap())
|
buffer.Unmap();
|
||||||
NazaraWarning("Failed to unmap source buffer");
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -324,7 +323,7 @@ void NzBuffer::Unmap() const
|
||||||
if (!m_impl)
|
if (!m_impl)
|
||||||
{
|
{
|
||||||
NazaraError("Buffer not valid");
|
NazaraError("Buffer not valid");
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,15 +217,15 @@ bool NzIndexBuffer::SetStorage(nzBufferStorage storage)
|
||||||
return m_buffer->SetStorage(storage);
|
return m_buffer->SetStorage(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NzIndexBuffer::Unmap() const
|
void NzIndexBuffer::Unmap() const
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILITY_SAFE
|
#if NAZARA_UTILITY_SAFE
|
||||||
if (!m_buffer)
|
if (!m_buffer)
|
||||||
{
|
{
|
||||||
NazaraError("Impossible to unlock sequential buffers");
|
NazaraError("Impossible to unlock sequential buffers");
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return m_buffer->Unmap();
|
m_buffer->Unmap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -357,8 +357,7 @@ bool NzMD5MeshParser::Parse(NzMesh* mesh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!indexBuffer->Unmap())
|
indexBuffer->Unmap();
|
||||||
NazaraWarning("Failed to unmap index buffer");
|
|
||||||
|
|
||||||
// Vertex buffer
|
// Vertex buffer
|
||||||
std::unique_ptr<NzVertexBuffer> vertexBuffer(new NzVertexBuffer(NzMesh::GetDeclaration(), vertexCount, m_parameters.storage, nzBufferUsage_Dynamic));
|
std::unique_ptr<NzVertexBuffer> vertexBuffer(new NzVertexBuffer(NzMesh::GetDeclaration(), vertexCount, m_parameters.storage, nzBufferUsage_Dynamic));
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ bool NzVertexBuffer::SetStorage(nzBufferStorage storage)
|
||||||
return m_buffer->SetStorage(storage);
|
return m_buffer->SetStorage(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NzVertexBuffer::Unmap() const
|
void NzVertexBuffer::Unmap() const
|
||||||
{
|
{
|
||||||
return m_buffer->Unmap();
|
m_buffer->Unmap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue