From da5d2fa958f22844adaec90e894e85270ed0a631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Sep 2022 09:34:55 +0200 Subject: [PATCH] MeshTools: fix more unused var warnings on a non-deprecated build. --- src/Magnum/MeshTools/Combine.cpp | 7 +++---- src/Magnum/MeshTools/Interleave.cpp | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Magnum/MeshTools/Combine.cpp b/src/Magnum/MeshTools/Combine.cpp index fcf08792f..0accd4459 100644 --- a/src/Magnum/MeshTools/Combine.cpp +++ b/src/Magnum/MeshTools/Combine.cpp @@ -189,12 +189,11 @@ Trade::MeshData combineFaceAttributes(const Trade::MeshData& mesh, const Trade:: CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(meshIndexType), "MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(meshIndexType)), (Trade::MeshData{MeshPrimitive{}, 0})); - const UnsignedInt meshIndexSize = meshIndexTypeSize(mesh.indexType()); + const UnsignedInt meshIndexSize = meshIndexTypeSize(meshIndexType); UnsignedInt faceIndexSize; if(faceAttributes.isIndexed()) { - const MeshIndexType faceIndexType = faceAttributes.indexType(); - CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(faceIndexType), - "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(faceIndexType)), + CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(faceAttributes.indexType()), + "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << reinterpret_cast(meshIndexTypeUnwrap(faceAttributes.indexType())), (Trade::MeshData{MeshPrimitive{}, 0})); faceIndexSize = meshIndexTypeSize(faceAttributes.indexType()); } else faceIndexSize = 4; diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp index 497623b9f..5cf734497 100644 --- a/src/Magnum/MeshTools/Interleave.cpp +++ b/src/Magnum/MeshTools/Interleave.cpp @@ -139,9 +139,8 @@ Containers::Array interleavedLayout(Trade::MeshData&& stride = 0; minOffset = 0; for(UnsignedInt i = 0, max = data.attributeCount(); i != max; ++i) { - const VertexFormat format = data.attributeFormat(i); - CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), - "MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); + CORRADE_ASSERT(!isVertexFormatImplementationSpecific(data.attributeFormat(i)), + "MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(data.attributeFormat(i))), {}); stride += attributeSize(data, i); } } @@ -149,12 +148,12 @@ Containers::Array interleavedLayout(Trade::MeshData&& /* Add the extra attributes and explicit padding */ std::size_t extraAttributeCount = 0; for(std::size_t i = 0; i != extra.size(); ++i) { - if(extra[i].format() == VertexFormat{}) { + const VertexFormat format = extra[i].format(); + if(format == VertexFormat{}) { CORRADE_ASSERT(extra[i].stride() > 0 || stride >= std::size_t(-extra[i].stride()), "MeshTools::interleavedLayout(): negative padding" << extra[i].stride() << "in extra attribute" << i << "too large for stride" << stride, {}); stride += extra[i].stride(); } else { - const VertexFormat format = extra[i].format(); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), "MeshTools::interleavedLayout(): extra attribute" << i << "has an implementation-specific format" << reinterpret_cast(vertexFormatUnwrap(format)), {}); stride += attributeSize(extra[i]);