@@ -307,7 +307,7 @@ void DirectX::ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indi
307307 uint16_t iv20; // index of v20
308308
309309 // Function that, when given the index of two vertices, creates a new vertex at the midpoint of those vertices.
310- auto const divideEdge = [&](uint16_t i0, uint16_t i1, XMFLOAT3& outVertex, uint16_t & outIndex)
310+ const auto divideEdge = [&](uint16_t i0, uint16_t i1, XMFLOAT3& outVertex, uint16_t & outIndex)
311311 {
312312 const UndirectedEdge edge = makeUndirectedEdge (i0, i1);
313313
@@ -372,8 +372,8 @@ void DirectX::ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indi
372372 vertices.reserve (vertexPositions.size ());
373373 for (const auto & it : vertexPositions)
374374 {
375- auto const normal = XMVector3Normalize (XMLoadFloat3 (&it));
376- auto const pos = XMVectorScale (normal, radius);
375+ const auto normal = XMVector3Normalize (XMLoadFloat3 (&it));
376+ const auto pos = XMVectorScale (normal, radius);
377377
378378 XMFLOAT3 normalFloat3;
379379 XMStoreFloat3 (&normalFloat3, normal);
@@ -385,7 +385,7 @@ void DirectX::ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indi
385385 const float u = longitude / XM_2PI + 0 .5f ;
386386 const float v = latitude / XM_PI;
387387
388- auto const texcoord = XMVectorSet (1 .0f - u, v, 0 .0f , 0 .0f );
388+ const auto texcoord = XMVectorSet (1 .0f - u, v, 0 .0f , 0 .0f );
389389 vertices.push_back (VertexPositionNormalTexture (pos, normal, texcoord));
390390 }
391391
@@ -468,7 +468,7 @@ void DirectX::ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indi
468468 // onto a single point. In general there's no real way to do that right. But to match the behavior of non-geodesic
469469 // spheres, we need to duplicate the pole vertex for every triangle that uses it. This will introduce seams near the
470470 // poles, but reduce stretching.
471- auto const fixPole = [&](size_t poleIndex)
471+ const auto fixPole = [&](size_t poleIndex)
472472 {
473473 const auto & poleVertex = vertices[poleIndex];
474474 bool overwrittenPoleVertex = false ; // overwriting the original pole vertex saves us one vertex
0 commit comments