Browse Source

Trade: internal API was named in an outdated way.

Long ago, during one of the few initial MeshData iterations. there was
no VertexFormat, but rather Trade::MeshAttributeType. I managed to get
rid of it mostly, except this place.
pull/537/head
Vladimír Vondruš 5 years ago
parent
commit
2b8d9c7e74
  1. 20
      src/Magnum/Trade/MeshData.h

20
src/Magnum/Trade/MeshData.h

@ -1789,7 +1789,7 @@ class MAGNUM_TRADE_EXPORT MeshData {
Containers::StridedArrayView1D<const void> attributeDataViewInternal(const MeshAttributeData& attribute) const; Containers::StridedArrayView1D<const void> attributeDataViewInternal(const MeshAttributeData& attribute) const;
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
template<class T> bool checkAttributeTypeCompatibility(const MeshAttributeData& attribute, const char* prefix) const; template<class T> bool checkVertexFormatCompatibility(const MeshAttributeData& attribute, const char* prefix) const;
#endif #endif
/* GPUs don't currently support more than 32-bit index types / vertex /* GPUs don't currently support more than 32-bit index types / vertex
@ -2138,7 +2138,7 @@ template<class T> Containers::ArrayView<T> MeshData::mutableIndices() {
} }
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
template<class T> bool MeshData::checkAttributeTypeCompatibility(const MeshAttributeData& attribute, const char* const prefix) const { template<class T> bool MeshData::checkVertexFormatCompatibility(const MeshAttributeData& attribute, const char* const prefix) const {
CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format), CORRADE_ASSERT(!isVertexFormatImplementationSpecific(attribute._format),
prefix << "can't cast data from an implementation-specific vertex format" << reinterpret_cast<void*>(vertexFormatUnwrap(attribute._format)), false); prefix << "can't cast data from an implementation-specific vertex format" << reinterpret_cast<void*>(vertexFormatUnwrap(attribute._format)), false);
CORRADE_ASSERT(Implementation::isVertexFormatCompatible<typename std::remove_extent<T>::type>(attribute._format), CORRADE_ASSERT(Implementation::isVertexFormatCompatible<typename std::remove_extent<T>::type>(attribute._format),
@ -2155,7 +2155,7 @@ template<class T, class> Containers::StridedArrayView1D<const T> MeshData::attri
if(!data.stride()[1]) return {}; if(!data.stride()[1]) return {};
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
if(!checkAttributeTypeCompatibility<T>(_attributes[id], "Trade::MeshData::attribute():")) return {}; if(!checkVertexFormatCompatibility<T>(_attributes[id], "Trade::MeshData::attribute():")) return {};
#endif #endif
return Containers::arrayCast<1, const T>(data); return Containers::arrayCast<1, const T>(data);
} }
@ -2167,7 +2167,7 @@ template<class T, class> Containers::StridedArrayView2D<const typename std::remo
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[id]; const MeshAttributeData& attribute = _attributes[id];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {}; if(!checkVertexFormatCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {};
#endif #endif
return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data); return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data);
} }
@ -2178,7 +2178,7 @@ template<class T, class> Containers::StridedArrayView1D<T> MeshData::mutableAttr
if(!data.stride()[1]) return {}; if(!data.stride()[1]) return {};
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
if(!checkAttributeTypeCompatibility<T>(_attributes[id], "Trade::MeshData::mutableAttribute():")) return {}; if(!checkVertexFormatCompatibility<T>(_attributes[id], "Trade::MeshData::mutableAttribute():")) return {};
#endif #endif
return Containers::arrayCast<1, T>(data); return Containers::arrayCast<1, T>(data);
} }
@ -2190,7 +2190,7 @@ template<class T, class> Containers::StridedArrayView2D<typename std::remove_ext
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[id]; const MeshAttributeData& attribute = _attributes[id];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {}; if(!checkVertexFormatCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {};
#endif #endif
return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data); return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data);
} }
@ -2201,7 +2201,7 @@ template<class T, class> Containers::StridedArrayView1D<const T> MeshData::attri
if(!data.stride()[1]) return {}; if(!data.stride()[1]) return {};
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
if(!checkAttributeTypeCompatibility<T>(_attributes[attributeFor(name, id)], "Trade::MeshData::attribute():")) return {}; if(!checkVertexFormatCompatibility<T>(_attributes[attributeFor(name, id)], "Trade::MeshData::attribute():")) return {};
#endif #endif
return Containers::arrayCast<1, const T>(data); return Containers::arrayCast<1, const T>(data);
} }
@ -2213,7 +2213,7 @@ template<class T, class> Containers::StridedArrayView2D<const typename std::remo
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)]; const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {}; if(!checkVertexFormatCompatibility<T>(attribute, "Trade::MeshData::attribute():")) return {};
#endif #endif
return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data); return Containers::arrayCast<2, const typename std::remove_extent<T>::type>(data);
} }
@ -2224,7 +2224,7 @@ template<class T, class> Containers::StridedArrayView1D<T> MeshData::mutableAttr
if(!data.stride()[1]) return {}; if(!data.stride()[1]) return {};
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
if(!checkAttributeTypeCompatibility<T>(_attributes[attributeFor(name, id)], "Trade::MeshData::mutableAttribute():")) return {}; if(!checkVertexFormatCompatibility<T>(_attributes[attributeFor(name, id)], "Trade::MeshData::mutableAttribute():")) return {};
#endif #endif
return Containers::arrayCast<1, T>(data); return Containers::arrayCast<1, T>(data);
} }
@ -2236,7 +2236,7 @@ template<class T, class> Containers::StridedArrayView2D<typename std::remove_ext
#endif #endif
#ifndef CORRADE_NO_ASSERT #ifndef CORRADE_NO_ASSERT
const MeshAttributeData& attribute = _attributes[attributeFor(name, id)]; const MeshAttributeData& attribute = _attributes[attributeFor(name, id)];
if(!checkAttributeTypeCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {}; if(!checkVertexFormatCompatibility<T>(attribute, "Trade::MeshData::mutableAttribute():")) return {};
#endif #endif
return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data); return Containers::arrayCast<2, typename std::remove_extent<T>::type>(data);
} }

Loading…
Cancel
Save