diff --git a/src/Magnum/SceneTools/FlattenMeshHierarchy.cpp b/src/Magnum/SceneTools/FlattenMeshHierarchy.cpp index 269641513..f62ecfa3a 100644 --- a/src/Magnum/SceneTools/FlattenMeshHierarchy.cpp +++ b/src/Magnum/SceneTools/FlattenMeshHierarchy.cpp @@ -85,13 +85,12 @@ Containers::Array(&Containers::Pair::first), - stridedArrayView(orderedClusteredParents).slice(&Containers::Pair::second)); + stridedArrayView(orderedClusteredParents).slice(&decltype(orderedClusteredParents)::Type::first), + stridedArrayView(orderedClusteredParents).slice(&decltype(orderedClusteredParents)::Type::second)); SceneDataDimensionTraits::transformationsInto(scene, - stridedArrayView(transformations).template slice(&Containers::Pair>::first), - stridedArrayView(transformations).template slice>(&Containers::Pair>::second)); + stridedArrayView(transformations).slice(&decltype(transformations)::Type::first), + stridedArrayView(transformations).slice(&decltype(transformations)::Type::second)); /* Retrieve transformations of all objects, indexed by object ID. Since not all nodes in the hierarchy may have a transformation assigned, the whole @@ -117,11 +116,11 @@ Containers::Array>> out{NoInit, scene.fieldSize(Trade::SceneField::Mesh)}; - Containers::StridedArrayView1D meshes{out, &out.data()->first(), out.size(), sizeof(typename decltype(out)::Type)}; - Containers::StridedArrayView1D meshMaterials{out, &out.data()->second(), out.size(), sizeof(typename decltype(out)::Type)}; - Containers::StridedArrayView1D> matrices{out, &out.data()->third(), out.size(), sizeof(typename decltype(out)::Type)}; - Containers::StridedArrayView1D mapping = Containers::arrayCast(matrices); - scene.meshesMaterialsInto(mapping, meshes, meshMaterials); + const auto matrices = stridedArrayView(out).slice(&decltype(out)::Type::third); + const auto mapping = Containers::arrayCast(matrices); + scene.meshesMaterialsInto(mapping, + stridedArrayView(out).slice(&decltype(out)::Type::first), + stridedArrayView(out).slice(&decltype(out)::Type::second)); for(std::size_t i = 0; i != out.size(); ++i) { CORRADE_INTERNAL_ASSERT(mapping[i] < scene.mappingBound()); matrices[i] = absoluteTransformations[mapping[i] + 1]; diff --git a/src/Magnum/SceneTools/OrderClusterParents.cpp b/src/Magnum/SceneTools/OrderClusterParents.cpp index f39248115..59c1d22ed 100644 --- a/src/Magnum/SceneTools/OrderClusterParents.cpp +++ b/src/Magnum/SceneTools/OrderClusterParents.cpp @@ -39,9 +39,9 @@ Containers::Array> orderClusterParents(const CORRADE_ASSERT(parentFieldId, "SceneTools::orderClusterParents(): the scene has no hierarchy", {}); Containers::Array> out{NoInit, scene.fieldSize(*parentFieldId)}; - Containers::StridedArrayView1D mapping{out, &out.data()->first(), out.size(), sizeof(decltype(out)::Type)}; - Containers::StridedArrayView1D parentOffset{out, &out.data()->second(), out.size(), sizeof(decltype(out)::Type)}; - orderClusterParentsInto(scene, mapping, parentOffset); + orderClusterParentsInto(scene, + stridedArrayView(out).slice(&decltype(out)::Type::first), + stridedArrayView(out).slice(&decltype(out)::Type::second)); return out; } @@ -72,11 +72,10 @@ void orderClusterParentsInto(const Trade::SceneData& scene, const Containers::St {NoInit, parentFieldSize + 1, parentsToProcess} }; - /* Convert the parent list to a child list to sort them toplogically. - Explicit slice() template parameters needed by GCC 4.8 and MSVC 2015 */ + /* Convert the parent list to a child list to sort them toplogically */ scene.parentsInto( - stridedArrayView(parents).slice(&Containers::Pair::first), - stridedArrayView(parents).slice(&Containers::Pair::second) + stridedArrayView(parents).slice(&decltype(parents)::Type::first), + stridedArrayView(parents).slice(&decltype(parents)::Type::second) ); /* Children offset for each node including root. First calculate the count