Browse Source

MeshTools: fix more unused var warnings on a non-deprecated build.

pull/589/head
Vladimír Vondruš 4 years ago
parent
commit
da5d2fa958
  1. 7
      src/Magnum/MeshTools/Combine.cpp
  2. 9
      src/Magnum/MeshTools/Interleave.cpp

7
src/Magnum/MeshTools/Combine.cpp

@ -189,12 +189,11 @@ Trade::MeshData combineFaceAttributes(const Trade::MeshData& mesh, const Trade::
CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(meshIndexType), CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(meshIndexType),
"MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type" << reinterpret_cast<void*>(meshIndexTypeUnwrap(meshIndexType)), "MeshTools::combineFaceAttributes(): vertex mesh has an implementation-specific index type" << reinterpret_cast<void*>(meshIndexTypeUnwrap(meshIndexType)),
(Trade::MeshData{MeshPrimitive{}, 0})); (Trade::MeshData{MeshPrimitive{}, 0}));
const UnsignedInt meshIndexSize = meshIndexTypeSize(mesh.indexType()); const UnsignedInt meshIndexSize = meshIndexTypeSize(meshIndexType);
UnsignedInt faceIndexSize; UnsignedInt faceIndexSize;
if(faceAttributes.isIndexed()) { if(faceAttributes.isIndexed()) {
const MeshIndexType faceIndexType = faceAttributes.indexType(); CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(faceAttributes.indexType()),
CORRADE_ASSERT(!isMeshIndexTypeImplementationSpecific(faceIndexType), "MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << reinterpret_cast<void*>(meshIndexTypeUnwrap(faceAttributes.indexType())),
"MeshTools::combineFaceAttributes(): face mesh has an implementation-specific index type" << reinterpret_cast<void*>(meshIndexTypeUnwrap(faceIndexType)),
(Trade::MeshData{MeshPrimitive{}, 0})); (Trade::MeshData{MeshPrimitive{}, 0}));
faceIndexSize = meshIndexTypeSize(faceAttributes.indexType()); faceIndexSize = meshIndexTypeSize(faceAttributes.indexType());
} else faceIndexSize = 4; } else faceIndexSize = 4;

9
src/Magnum/MeshTools/Interleave.cpp

@ -139,9 +139,8 @@ Containers::Array<Trade::MeshAttributeData> interleavedLayout(Trade::MeshData&&
stride = 0; stride = 0;
minOffset = 0; minOffset = 0;
for(UnsignedInt i = 0, max = data.attributeCount(); i != max; ++i) { for(UnsignedInt i = 0, max = data.attributeCount(); i != max; ++i) {
const VertexFormat format = data.attributeFormat(i); CORRADE_ASSERT(!isVertexFormatImplementationSpecific(data.attributeFormat(i)),
CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), "MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << reinterpret_cast<void*>(vertexFormatUnwrap(data.attributeFormat(i))), {});
"MeshTools::interleavedLayout(): attribute" << i << "has an implementation-specific format" << reinterpret_cast<void*>(vertexFormatUnwrap(format)), {});
stride += attributeSize(data, i); stride += attributeSize(data, i);
} }
} }
@ -149,12 +148,12 @@ Containers::Array<Trade::MeshAttributeData> interleavedLayout(Trade::MeshData&&
/* Add the extra attributes and explicit padding */ /* Add the extra attributes and explicit padding */
std::size_t extraAttributeCount = 0; std::size_t extraAttributeCount = 0;
for(std::size_t i = 0; i != extra.size(); ++i) { 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()), 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, {}); "MeshTools::interleavedLayout(): negative padding" << extra[i].stride() << "in extra attribute" << i << "too large for stride" << stride, {});
stride += extra[i].stride(); stride += extra[i].stride();
} else { } else {
const VertexFormat format = extra[i].format();
CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format), CORRADE_ASSERT(!isVertexFormatImplementationSpecific(format),
"MeshTools::interleavedLayout(): extra attribute" << i << "has an implementation-specific format" << reinterpret_cast<void*>(vertexFormatUnwrap(format)), {}); "MeshTools::interleavedLayout(): extra attribute" << i << "has an implementation-specific format" << reinterpret_cast<void*>(vertexFormatUnwrap(format)), {});
stride += attributeSize(extra[i]); stride += attributeSize(extra[i]);

Loading…
Cancel
Save