From afb8254b6db63f09540be8bac4d6dc81a3d64bd4 Mon Sep 17 00:00:00 2001 From: verrazano Date: Sat, 8 Aug 2015 20:18:19 -0500 Subject: [PATCH] Changed primitive types to be grammatically correct. --- include/SFML/Graphics/PrimitiveType.hpp | 19 ++++++++++++------- include/SFML/Graphics/VertexArray.hpp | 2 +- src/SFML/Graphics/Shape.cpp | 4 ++-- src/SFML/Graphics/Sprite.cpp | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/SFML/Graphics/PrimitiveType.hpp b/include/SFML/Graphics/PrimitiveType.hpp index 9dae947d..0bfa0ee6 100644 --- a/include/SFML/Graphics/PrimitiveType.hpp +++ b/include/SFML/Graphics/PrimitiveType.hpp @@ -38,13 +38,18 @@ namespace sf //////////////////////////////////////////////////////////// enum PrimitiveType { - Points, ///< List of individual points - Lines, ///< List of individual lines - LinesStrip, ///< List of connected lines, a point uses the previous point to form a line - Triangles, ///< List of individual triangles - TrianglesStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle - TrianglesFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle - Quads ///< List of individual quads (deprecated, don't work with OpenGL ES) + Points, ///< List of individual points + Lines, ///< List of individual lines + LineStrip, ///< List of connected lines, a point uses the previous point to form a line + Triangles, ///< List of individual triangles + TriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle + TriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle + Quads, ///< List of individual quads (deprecated, don't work with OpenGL ES) + + // Deprecated names + LinesStrip = LineStrip, /// \deprecated Use LineStrip instead + TrianglesStrip = TriangleStrip, /// \deprecated Use TriangleStrip instead + TrianglesFan = TriangleFan /// \deprecated Use TriangleFan instead }; } // namespace sf diff --git a/include/SFML/Graphics/VertexArray.hpp b/include/SFML/Graphics/VertexArray.hpp index f0820a53..56a34d34 100644 --- a/include/SFML/Graphics/VertexArray.hpp +++ b/include/SFML/Graphics/VertexArray.hpp @@ -209,7 +209,7 @@ private: /// /// Example: /// \code -/// sf::VertexArray lines(sf::LinesStrip, 4); +/// sf::VertexArray lines(sf::LineStrip, 4); /// lines[0].position = sf::Vector2f(10, 0); /// lines[1].position = sf::Vector2f(20, 0); /// lines[2].position = sf::Vector2f(30, 5); diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index 5403b404..2472b7c2 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -163,8 +163,8 @@ m_textureRect (), m_fillColor (255, 255, 255), m_outlineColor (255, 255, 255), m_outlineThickness(0), -m_vertices (TrianglesFan), -m_outlineVertices (TrianglesStrip), +m_vertices (TriangleFan), +m_outlineVertices (TriangleStrip), m_insideBounds (), m_bounds () { diff --git a/src/SFML/Graphics/Sprite.cpp b/src/SFML/Graphics/Sprite.cpp index e24c8f27..461a55be 100644 --- a/src/SFML/Graphics/Sprite.cpp +++ b/src/SFML/Graphics/Sprite.cpp @@ -140,7 +140,7 @@ void Sprite::draw(RenderTarget& target, RenderStates states) const { states.transform *= getTransform(); states.texture = m_texture; - target.draw(m_vertices, 4, TrianglesStrip, states); + target.draw(m_vertices, 4, TriangleStrip, states); } }