Browse Source

TextureTools,Trade: fix unused var warning on a non-deprecated build.

... by actually using that variable outside of asserts.
pull/589/head
Vladimír Vondruš 4 years ago
parent
commit
fe6a387515
  1. 2
      src/Magnum/TextureTools/Atlas.cpp
  2. 28
      src/Magnum/Trade/SceneData.cpp

2
src/Magnum/TextureTools/Atlas.cpp

@ -83,7 +83,7 @@ Containers::Pair<Int, Containers::Array<Vector3i>> atlasArrayPowerOfTwo(const Ve
CORRADE_ASSERT(size.product() && size.x() == size.y() && (size & (size - Vector2i{1})).isZero(), CORRADE_ASSERT(size.product() && size.x() == size.y() && (size & (size - Vector2i{1})).isZero(),
"TextureTools::atlasArrayPowerOfTwo(): expected size" << i << "to be a non-zero power-of-two square, got" << Debug::packed << size, {}); "TextureTools::atlasArrayPowerOfTwo(): expected size" << i << "to be a non-zero power-of-two square, got" << Debug::packed << size, {});
sortedSizes[i].xy() = sizes[i]; sortedSizes[i].xy() = size;
sortedSizes[i].z() = i; sortedSizes[i].z() = i;
} }

28
src/Magnum/Trade/SceneData.cpp

@ -584,14 +584,14 @@ SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mapp
checked against a map and only custom fields are checked in an checked against a map and only custom fields are checked in an
O(n^2) way with the assumption there isn't many of them (and that O(n^2) way with the assumption there isn't many of them (and that
they'll gradually become builtin). */ they'll gradually become builtin). */
if(!isSceneFieldCustom(_fields[i]._name)) { if(!isSceneFieldCustom(field._name)) {
CORRADE_INTERNAL_ASSERT(UnsignedInt(_fields[i]._name) < fieldsPresent.Size); CORRADE_INTERNAL_ASSERT(UnsignedInt(field._name) < fieldsPresent.Size);
CORRADE_ASSERT(!fieldsPresent[UnsignedInt(_fields[i]._name)], CORRADE_ASSERT(!fieldsPresent[UnsignedInt(field._name)],
"Trade::SceneData: duplicate field" << _fields[i]._name, ); "Trade::SceneData: duplicate field" << field._name, );
fieldsPresent.set(UnsignedInt(_fields[i]._name), true); fieldsPresent.set(UnsignedInt(field._name), true);
} else for(std::size_t j = 0; j != i; ++j) { } else for(std::size_t j = 0; j != i; ++j) {
CORRADE_ASSERT(_fields[j]._name != _fields[i]._name, CORRADE_ASSERT(_fields[j]._name != field._name,
"Trade::SceneData: duplicate field" << _fields[i]._name, ); "Trade::SceneData: duplicate field" << field._name, );
} }
/* Check that both the mapping and field view fits into the provided /* Check that both the mapping and field view fits into the provided
@ -634,21 +634,21 @@ SceneData::SceneData(const SceneMappingType mappingType, const UnsignedLong mapp
/* Remember TRS and mesh/material fields to figure out whether the /* Remember TRS and mesh/material fields to figure out whether the
scene is 2D or 3D and check their object mapping consistency outside scene is 2D or 3D and check their object mapping consistency outside
of the loop below */ of the loop below */
if(_fields[i]._name == SceneField::Transformation) { if(field._name == SceneField::Transformation) {
transformationField = i; transformationField = i;
} else if(_fields[i]._name == SceneField::Translation) { } else if(field._name == SceneField::Translation) {
translationField = i; translationField = i;
} else if(_fields[i]._name == SceneField::Rotation) { } else if(field._name == SceneField::Rotation) {
rotationField = i; rotationField = i;
} else if(_fields[i]._name == SceneField::Scaling) { } else if(field._name == SceneField::Scaling) {
scalingField = i; scalingField = i;
} }
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
else if(_fields[i]._name == SceneField::Mesh) { else if(field._name == SceneField::Mesh) {
meshField = i; meshField = i;
} else if(_fields[i]._name == SceneField::MeshMaterial) { } else if(field._name == SceneField::MeshMaterial) {
meshMaterialField = i; meshMaterialField = i;
} else if(_fields[i]._name == SceneField::Skin) { } else if(field._name == SceneField::Skin) {
skinField = i; skinField = i;
} }
#endif #endif

Loading…
Cancel
Save