From 6d3c8d07866b94beba2bf6fd00cde3d1678e3355 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 4 Aug 2023 23:46:37 -0600 Subject: [PATCH] Remove templates where not necessary --- src/SFML/Graphics/Shader.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index 918d9864f..f9ee3b277 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -120,12 +120,11 @@ bool getStreamContents(sf::InputStream& stream, std::vector& buffer) } // Transforms an array of 2D vectors into a contiguous array of scalars -template -std::vector flatten(const sf::Vector2* vectorArray, std::size_t length) +std::vector flatten(const sf::Vector2f* vectorArray, std::size_t length) { const std::size_t vectorSize = 2; - std::vector contiguous(vectorSize * length); + std::vector contiguous(vectorSize * length); for (std::size_t i = 0; i < length; ++i) { contiguous[vectorSize * i] = vectorArray[i].x; @@ -136,12 +135,11 @@ std::vector flatten(const sf::Vector2* vectorArray, std::size_t length) } // Transforms an array of 3D vectors into a contiguous array of scalars -template -std::vector flatten(const sf::Vector3* vectorArray, std::size_t length) +std::vector flatten(const sf::Vector3f* vectorArray, std::size_t length) { const std::size_t vectorSize = 3; - std::vector contiguous(vectorSize * length); + std::vector contiguous(vectorSize * length); for (std::size_t i = 0; i < length; ++i) { contiguous[vectorSize * i] = vectorArray[i].x; @@ -153,12 +151,11 @@ std::vector flatten(const sf::Vector3* vectorArray, std::size_t length) } // Transforms an array of 4D vectors into a contiguous array of scalars -template -std::vector flatten(const sf::priv::Vector4* vectorArray, std::size_t length) +std::vector flatten(const sf::Glsl::Vec4* vectorArray, std::size_t length) { const std::size_t vectorSize = 4; - std::vector contiguous(vectorSize * length); + std::vector contiguous(vectorSize * length); for (std::size_t i = 0; i < length; ++i) { contiguous[vectorSize * i] = vectorArray[i].x;