Browse Source

Text: fix unused variable warnings in a no-assert build.

pull/168/head
Vladimír Vondruš 2 years ago
parent
commit
f64e1ac2c3
  1. 3
      src/Magnum/Text/AbstractGlyphCache.cpp
  2. 3
      src/Magnum/Text/DistanceFieldGlyphCache.cpp

3
src/Magnum/Text/AbstractGlyphCache.cpp

@ -314,10 +314,9 @@ UnsignedInt AbstractGlyphCache::addGlyph(const UnsignedInt fontId, const Unsigne
"Text::AbstractGlyphCache::addGlyph(): glyph" << fontGlyphId << "in font" << fontId << "already added at index" << state.fontGlyphMapping[fontOffset + fontGlyphId], {});
/** @todo expand once rotations (and thus negative rectangle sizes) are
supported */
const Range2Di rectanglePadded = rectangle.padded(state.padding);
#ifndef CORRADE_NO_ASSERT
const Range2Dui rectangleu{rectangle};
const Range2Dui rectanglePaddedu{rectanglePadded};
const Range2Dui rectanglePaddedu{rectangle.padded(state.padding)};
#endif
CORRADE_ASSERT(UnsignedInt(layer) < UnsignedInt(state.image.size().z()) && (rectangleu.min() <= rectangleu.max()).all() && (rectanglePaddedu.min() <= Vector2ui{state.image.size().xy()}).all() && (rectanglePaddedu.max() <= Vector2ui{state.image.size().xy()}).all(),
"Text::AbstractGlyphCache::addGlyph(): layer" << layer << "and rectangle" << Debug::packed << rectangle << "out of range for size" << Debug::packed << state.image.size() << "and padding" << Debug::packed << state.padding, {});

3
src/Magnum/Text/DistanceFieldGlyphCache.cpp

@ -123,6 +123,9 @@ void DistanceFieldGlyphCache::doSetImage(const Vector2i& offset, const ImageView
support border clamp, (c) required the input texture to have
certain wrapping mode set */
CORRADE_INTERNAL_ASSERT(image.storage().skip().xy() == offset);
#ifdef CORRADE_NO_ASSERT
static_cast<void>(offset);
#endif
const Vector2i paddedMin = Math::max(Vector2i{0},
image.storage().skip().xy() - padding());
const Vector2i paddedMax = Math::min(size().xy(),

Loading…
Cancel
Save