diff --git a/ChangeLog.md b/ChangeLog.md index c795d5c19..291c62742 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -47,6 +47,7 @@ Nazara Engine: - Fix potential bug on SocketImpl::Connect (used by TcpClient::Connect) on POSIX platforms - It is now possible to initialize a StackArray with a size of zero on every platforms (this was not possible on non-Windows platforms before) - Calling PlacementDestroy on a null pointer is now a no-op (was triggering an undefined behavior) +- Fix OBJParser relative offsets handling Nazara Development Kit: - Added ImageWidget (#139) diff --git a/src/Nazara/Utility/Formats/OBJParser.cpp b/src/Nazara/Utility/Formats/OBJParser.cpp index 95d7fa6ce..d0cd5cf71 100644 --- a/src/Nazara/Utility/Formats/OBJParser.cpp +++ b/src/Nazara/Utility/Formats/OBJParser.cpp @@ -227,7 +227,7 @@ namespace Nz if (p < 0) { - p += static_cast(m_positions.size() - 1); + p += static_cast(m_positions.size()); if (p < 0) { Error("Vertex index out of range (" + String::Number(p) + " < 0"); @@ -238,7 +238,7 @@ namespace Nz if (n < 0) { - n += static_cast(m_normals.size() - 1); + n += static_cast(m_normals.size()); if (n < 0) { Error("Normal index out of range (" + String::Number(n) + " < 0"); @@ -249,7 +249,7 @@ namespace Nz if (t < 0) { - t += static_cast(m_texCoords.size() - 1); + t += static_cast(m_texCoords.size()); if (t < 0) { Error("Texture coordinates index out of range (" + String::Number(t) + " < 0");