From 2c27831b0a638a8964305f6f9d78c128414d8d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 18 Apr 2023 09:32:24 +0200 Subject: [PATCH] MeshTools,Trade: clarify why offset-only attributes can't be used. Instead of saying "which is not supported" in each assert, which is vague and might imply that "it eventually will be supported", document the actual reason in a single place, which is the MeshAttributeData docs. --- src/Magnum/MeshTools/Combine.cpp | 2 +- src/Magnum/MeshTools/Duplicate.cpp | 2 +- src/Magnum/MeshTools/Interleave.cpp | 2 +- src/Magnum/MeshTools/Test/CombineTest.cpp | 2 +- src/Magnum/MeshTools/Test/DuplicateTest.cpp | 2 +- src/Magnum/MeshTools/Test/InterleaveTest.cpp | 2 +- src/Magnum/Trade/MeshData.h | 8 +++++--- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Magnum/MeshTools/Combine.cpp b/src/Magnum/MeshTools/Combine.cpp index a598d32fb..e8373aa3c 100644 --- a/src/Magnum/MeshTools/Combine.cpp +++ b/src/Magnum/MeshTools/Combine.cpp @@ -239,7 +239,7 @@ Trade::MeshData combineFaceAttributes(const Trade::MeshData& mesh, Containers::A #ifndef CORRADE_NO_ASSERT for(std::size_t i = 0; i != faceAttributes.size(); ++i) CORRADE_ASSERT(!faceAttributes[i].isOffsetOnly(), - "MeshTools::combineFaceAttributes(): face attribute" << i << "is offset-only, which is not supported", + "MeshTools::combineFaceAttributes(): face attribute" << i << "is offset-only", (Trade::MeshData{MeshPrimitive::Triangles, 0})); #endif diff --git a/src/Magnum/MeshTools/Duplicate.cpp b/src/Magnum/MeshTools/Duplicate.cpp index 209019862..4b985b285 100644 --- a/src/Magnum/MeshTools/Duplicate.cpp +++ b/src/Magnum/MeshTools/Duplicate.cpp @@ -116,7 +116,7 @@ Trade::MeshData duplicate(const Trade::MeshData& mesh, const Containers::ArrayVi /* Asserting here even though data() has another assert since that one would be too confusing in this context */ CORRADE_ASSERT(!extra[i].isOffsetOnly(), - "MeshTools::duplicate(): extra attribute" << i << "is offset-only, which is not supported", + "MeshTools::duplicate(): extra attribute" << i << "is offset-only", (Trade::MeshData{MeshPrimitive::Triangles, 0})); /* Copy the attribute in, if it is non-empty, otherwise keep the diff --git a/src/Magnum/MeshTools/Interleave.cpp b/src/Magnum/MeshTools/Interleave.cpp index 173c5ccc1..5ba11b8ba 100644 --- a/src/Magnum/MeshTools/Interleave.cpp +++ b/src/Magnum/MeshTools/Interleave.cpp @@ -346,7 +346,7 @@ Trade::MeshData interleave(Trade::MeshData&& mesh, const Containers::ArrayView