From 5c49898cdf535cc066f7cb2c9a8c423caf71d2b8 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 25 Apr 2015 18:56:47 -0300 Subject: [PATCH] Fixed lines drawn using the 'none' line join mode having missing sections of each line segment. --- src/modules/font/Font.cpp | 4 ++-- src/modules/graphics/opengl/Polyline.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/font/Font.cpp b/src/modules/font/Font.cpp index eab45e8d1..567e8d097 100644 --- a/src/modules/font/Font.cpp +++ b/src/modules/font/Font.cpp @@ -37,8 +37,8 @@ class DefaultFontData : public love::Data { public: - virtual void *getData() const { return Vera_ttf; } - virtual size_t getSize() const { return sizeof(Vera_ttf); } + void *getData() const override { return Vera_ttf; } + size_t getSize() const override { return sizeof(Vera_ttf); } }; Rasterizer *Font::newTrueTypeRasterizer(int size, TrueTypeRasterizer::Hinting hinting) diff --git a/src/modules/graphics/opengl/Polyline.cpp b/src/modules/graphics/opengl/Polyline.cpp index cb5cb4aa8..ad3b003f5 100644 --- a/src/modules/graphics/opengl/Polyline.cpp +++ b/src/modules/graphics/opengl/Polyline.cpp @@ -349,6 +349,7 @@ void Polyline::draw() } // Fill the index array to make 2 triangles from each quad. + // NOTE: The triangle vertex ordering here is important! for (size_t i = 0; i < numindices / 6; i++) { // First triangle. @@ -357,8 +358,8 @@ void Polyline::draw() indices[i * 6 + 2] = GLushort(i * 4 + 2); // Second triangle. - indices[i * 6 + 3] = GLushort(i * 4 + 2); - indices[i * 6 + 4] = GLushort(i * 4 + 1); + indices[i * 6 + 3] = GLushort(i * 4 + 0); + indices[i * 6 + 4] = GLushort(i * 4 + 2); indices[i * 6 + 5] = GLushort(i * 4 + 3); } }