diff --git a/include/Nazara/Math/Matrix4.hpp b/include/Nazara/Math/Matrix4.hpp index cf9eeaaaf..53f88e239 100644 --- a/include/Nazara/Math/Matrix4.hpp +++ b/include/Nazara/Math/Matrix4.hpp @@ -106,7 +106,7 @@ class NzMatrix4 static NzMatrix4 Identity(); static NzMatrix4 LookAt(const NzVector3& eye, const NzVector3& target, const NzVector3& up = NzVector3::Up()); - static NzMatrix4 Ortho(T left, T top, T width, T height, T zNear = -1.0, T zFar = 1.0); + static NzMatrix4 Ortho(T left, T right, T top, T bottom, T zNear = -1.0, T zFar = 1.0); static NzMatrix4 Perspective(T angle, T ratio, T zNear, T zFar); static NzMatrix4 Rotate(const NzQuaternion& rotation); static NzMatrix4 Scale(const NzVector3& scale); diff --git a/include/Nazara/Utility/Buffer.hpp b/include/Nazara/Utility/Buffer.hpp index 66a0cdfe6..a5a7fe9df 100644 --- a/include/Nazara/Utility/Buffer.hpp +++ b/include/Nazara/Utility/Buffer.hpp @@ -25,7 +25,7 @@ class NAZARA_API NzBuffer : public NzResource, NzNonCopyable NzBuffer(nzBufferType type, unsigned int length, nzUInt8 typeSize, nzBufferStorage storage = nzBufferStorage_Software, nzBufferUsage usage = nzBufferUsage_Static); ~NzBuffer(); - bool CopyContent(NzBuffer& buffer); + bool CopyContent(const NzBuffer& buffer); bool Create(unsigned int length, nzUInt8 typeSize, nzBufferStorage storage = nzBufferStorage_Software, nzBufferUsage usage = nzBufferUsage_Static); void Destroy(); diff --git a/src/Nazara/Utility/Buffer.cpp b/src/Nazara/Utility/Buffer.cpp index b0ab50086..ee2c9a9f9 100644 --- a/src/Nazara/Utility/Buffer.cpp +++ b/src/Nazara/Utility/Buffer.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,7 @@ NzBuffer::~NzBuffer() Destroy(); } -bool NzBuffer::CopyContent(NzBuffer& buffer) +bool NzBuffer::CopyContent(const NzBuffer& buffer) { #if NAZARA_UTILITY_SAFE if (!m_impl) @@ -69,18 +70,9 @@ bool NzBuffer::CopyContent(NzBuffer& buffer) } #endif - void* ptr = buffer.Map(nzBufferAccess_ReadOnly); - if (!ptr) - { - NazaraError("Failed to map source buffer"); - return false; - } + NzBufferMapper mapper(buffer, nzBufferAccess_ReadOnly); - bool r = Fill(ptr, 0, buffer.GetLength()); - - buffer.Unmap(); - - return r; + return Fill(mapper.GetPointer(), 0, buffer.GetLength()); } bool NzBuffer::Create(unsigned int length, nzUInt8 typeSize, nzBufferStorage storage, nzBufferUsage usage)