From faf483d156bf82ac25a9fdf6d0c57679973716a3 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 23 Oct 2013 13:52:04 -0300 Subject: [PATCH] Fixed error message when an invalid vertex index is given to Mesh:setVertex, Mesh:getVertex, and Mesh:setVertexMap (resolves issue #772) --- src/modules/graphics/opengl/Mesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/opengl/Mesh.cpp b/src/modules/graphics/opengl/Mesh.cpp index f0c9cd5e9..f9a7afc18 100644 --- a/src/modules/graphics/opengl/Mesh.cpp +++ b/src/modules/graphics/opengl/Mesh.cpp @@ -79,7 +79,7 @@ void Mesh::setVertices(const std::vector &verts) void Mesh::setVertex(size_t index, const Vertex &v) { if (index >= vertex_count) - throw love::Exception("Invalid vertex index: %ld", index); + throw love::Exception("Invalid vertex index: %ld", index + 1); VertexBuffer::Bind vbo_bind(*vbo); @@ -92,7 +92,7 @@ void Mesh::setVertex(size_t index, const Vertex &v) Vertex Mesh::getVertex(size_t index) const { if (index >= vertex_count) - throw love::Exception("Invalid vertex index: %ld", index); + throw love::Exception("Invalid vertex index: %ld", index + 1); VertexBuffer::Bind vbo_bind(*vbo); @@ -111,7 +111,7 @@ void Mesh::setVertexMap(const std::vector &map) for (size_t i = 0; i < map.size(); i++) { if (map[i] >= vertex_count) - throw love::Exception("Invalid vertex map value: %d", map[i]); + throw love::Exception("Invalid vertex map value: %d", map[i] + 1); } size_t size = sizeof(uint32) * map.size();