Browse Source

Trade: no need to type that much.

pull/537/head
Vladimír Vondruš 5 years ago
parent
commit
206c4d7a9e
  1. 4
      src/Magnum/Trade/MeshData.cpp
  2. 4
      src/Magnum/Trade/MeshData.h

4
src/Magnum/Trade/MeshData.cpp

@ -367,7 +367,7 @@ Containers::StridedArrayView1D<const void> MeshData::attributeDataViewInternal(c
Containers::StridedArrayView2D<const char> MeshData::attribute(const UnsignedInt id) const {
CORRADE_ASSERT(id < _attributes.size(),
"Trade::MeshData::attribute(): index" << id << "out of range for" << _attributes.size() << "attributes", nullptr);
"Trade::MeshData::attribute(): index" << id << "out of range for" << _attributes.size() << "attributes", {});
const MeshAttributeData& attribute = _attributes[id];
/* Build a 2D view using information about attribute type size */
return Containers::arrayCast<2, const char>(
@ -381,7 +381,7 @@ Containers::StridedArrayView2D<char> MeshData::mutableAttribute(const UnsignedIn
CORRADE_ASSERT(_vertexDataFlags & DataFlag::Mutable,
"Trade::MeshData::mutableAttribute(): vertex data not mutable", {});
CORRADE_ASSERT(id < _attributes.size(),
"Trade::MeshData::mutableAttribute(): index" << id << "out of range for" << _attributes.size() << "attributes", nullptr);
"Trade::MeshData::mutableAttribute(): index" << id << "out of range for" << _attributes.size() << "attributes", {});
const MeshAttributeData& attribute = _attributes[id];
/* Build a 2D view using information about attribute type size */
const auto out = Containers::arrayCast<2, const char>(

4
src/Magnum/Trade/MeshData.h

@ -2121,7 +2121,7 @@ template<class T> Containers::ArrayView<const T> MeshData::indices() const {
if(!data.stride()[1]) return {};
#endif
CORRADE_ASSERT(Implementation::meshIndexTypeFor<T>() == _indexType,
"Trade::MeshData::indices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor<T>(), nullptr);
"Trade::MeshData::indices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor<T>(), {});
return Containers::arrayCast<1, const T>(data).asContiguous();
}
@ -2133,7 +2133,7 @@ template<class T> Containers::ArrayView<T> MeshData::mutableIndices() {
if(!data.stride()[1]) return {};
#endif
CORRADE_ASSERT(Implementation::meshIndexTypeFor<T>() == _indexType,
"Trade::MeshData::mutableIndices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor<T>(), nullptr);
"Trade::MeshData::mutableIndices(): indices are" << _indexType << "but requested" << Implementation::meshIndexTypeFor<T>(), {});
return Containers::arrayCast<1, T>(data).asContiguous();
}

Loading…
Cancel
Save