From 8f94a7717fab385fc4c1ea3e215745adeae6adc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Aug 2019 21:40:18 +0200 Subject: [PATCH] Primitives: constify. --- src/Magnum/Primitives/Implementation/Spheroid.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Primitives/Implementation/Spheroid.cpp b/src/Magnum/Primitives/Implementation/Spheroid.cpp index 7868c45fc..9af9a762d 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.cpp +++ b/src/Magnum/Primitives/Implementation/Spheroid.cpp @@ -112,15 +112,15 @@ void Spheroid::bottomFaceRing() { } void Spheroid::faceRings(UnsignedInt count, UnsignedInt offset) { - UnsignedInt vertexSegments = segments + (textureCoords == TextureCoords::Generate ? 1 : 0); + const UnsignedInt vertexSegments = segments + (textureCoords == TextureCoords::Generate ? 1 : 0); for(UnsignedInt i = 0; i != count; ++i) { for(UnsignedInt j = 0; j != segments; ++j) { - UnsignedInt bottomLeft = i*vertexSegments+j+offset; - UnsignedInt bottomRight = ((j != segments-1 || textureCoords == TextureCoords::Generate) ? + const UnsignedInt bottomLeft = i*vertexSegments+j+offset; + const UnsignedInt bottomRight = ((j != segments-1 || textureCoords == TextureCoords::Generate) ? i*vertexSegments+j+1+offset : i*segments+offset); - UnsignedInt topLeft = bottomLeft+vertexSegments; - UnsignedInt topRight = bottomRight+vertexSegments; + const UnsignedInt topLeft = bottomLeft+vertexSegments; + const UnsignedInt topRight = bottomRight+vertexSegments; indices.push_back(bottomLeft); indices.push_back(bottomRight); @@ -133,7 +133,7 @@ void Spheroid::faceRings(UnsignedInt count, UnsignedInt offset) { } void Spheroid::topFaceRing() { - UnsignedInt vertexSegments = segments + (textureCoords == TextureCoords::Generate ? 1 : 0); + const UnsignedInt vertexSegments = segments + (textureCoords == TextureCoords::Generate ? 1 : 0); for(UnsignedInt j = 0; j != segments; ++j) { /* Bottom left vertex */