Browse Source

Revert "Fixed compilation with GCC 4.9."

The final release doesn't have the issue with non-explicit
default std::vector constructor. Most of the conflicts resulted from
Mesh::Primitve -> MeshPrimitive refactoring.

This reverts commit c2ad09706e.

Conflicts:
	src/Magnum/Primitives/Capsule.cpp
	src/Magnum/Primitives/Circle.cpp
	src/Magnum/Primitives/Crosshair.cpp
	src/Magnum/Primitives/Cylinder.cpp
	src/Magnum/Primitives/Icosphere.cpp
	src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp
	src/Magnum/Primitives/Line.cpp
	src/Magnum/Primitives/Plane.cpp
	src/Magnum/Primitives/Square.cpp
	src/Magnum/Primitives/UVSphere.cpp
	src/Magnum/SceneGraph/Object.hpp
	src/Magnum/Text/GlyphCache.cpp
	src/Magnum/TextureTools/Atlas.cpp
	src/Magnum/TextureTools/Test/AtlasTest.cpp
pull/59/head
Vladimír Vondruš 12 years ago
parent
commit
08dbf60b93
  1. 2
      src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp
  2. 8
      src/Magnum/Primitives/Capsule.cpp
  3. 8
      src/Magnum/Primitives/Circle.cpp
  4. 8
      src/Magnum/Primitives/Crosshair.cpp
  5. 4
      src/Magnum/Primitives/Cube.cpp
  6. 4
      src/Magnum/Primitives/Cylinder.cpp
  7. 2
      src/Magnum/Primitives/Icosphere.cpp
  8. 2
      src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp
  9. 8
      src/Magnum/Primitives/Line.cpp
  10. 6
      src/Magnum/Primitives/Plane.cpp
  11. 6
      src/Magnum/Primitives/Square.cpp
  12. 4
      src/Magnum/Primitives/UVSphere.cpp
  13. 8
      src/Magnum/SceneGraph/Object.hpp
  14. 8
      src/Magnum/Text/AbstractFontConverter.cpp
  15. 2
      src/Magnum/Text/GlyphCache.cpp
  16. 2
      src/Magnum/TextureTools/Atlas.cpp
  17. 2
      src/Magnum/TextureTools/Test/AtlasTest.cpp
  18. 2
      src/MagnumPlugins/MagnumFont/MagnumFont.cpp

2
src/Magnum/MeshTools/Test/GenerateFlatNormalsTest.cpp

@ -51,7 +51,7 @@ void GenerateFlatNormalsTest::wrongIndexCount() {
std::vector<Vector3> normals; std::vector<Vector3> normals;
std::tie(indices, normals) = MeshTools::generateFlatNormals({ std::tie(indices, normals) = MeshTools::generateFlatNormals({
0, 1 0, 1
}, std::vector<Vector3>{}); }, {});
CORRADE_COMPARE(indices.size(), 0); CORRADE_COMPARE(indices.size(), 0);
CORRADE_COMPARE(normals.size(), 0); CORRADE_COMPARE(normals.size(), 0);

8
src/Magnum/Primitives/Capsule.cpp

@ -36,7 +36,7 @@
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, Float halfLength) { Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, Float halfLength) {
CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector2>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData2D(MeshPrimitive::Lines, {}, {}, {}));
std::vector<Vector2> positions; std::vector<Vector2> positions;
positions.reserve(hemisphereRings*4+2+(cylinderRings-1)*2); positions.reserve(hemisphereRings*4+2+(cylinderRings-1)*2);
@ -87,11 +87,11 @@ Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt
{UnsignedInt(positions.size())-3, UnsignedInt(positions.size())-1, {UnsignedInt(positions.size())-3, UnsignedInt(positions.size())-1,
UnsignedInt(positions.size())-2, UnsignedInt(positions.size())-1}); UnsignedInt(positions.size())-2, UnsignedInt(positions.size())-1});
return Trade::MeshData2D(MeshPrimitive::Lines, std::move(indices), {std::move(positions)}, std::vector<std::vector<Vector2>>{}); return Trade::MeshData2D(MeshPrimitive::Lines, std::move(indices), {std::move(positions)}, {});
} }
Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, UnsignedInt segments, Float halfLength, TextureCoords textureCoords) { Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, UnsignedInt segments, Float halfLength, TextureCoords textureCoords) {
CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 3, "Capsule must have at least one hemisphere ring, one cylinder ring and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, {}, {}, {}, {}));
Implementation::Spheroid capsule(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid capsule(segments, textureCoords == TextureCoords::Generate ?
Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::Generate :
@ -125,7 +125,7 @@ Trade::MeshData3D Capsule3D::solid(UnsignedInt hemisphereRings, UnsignedInt cyli
} }
Trade::MeshData3D Capsule3D::wireframe(const UnsignedInt hemisphereRings, const UnsignedInt cylinderRings, const UnsignedInt segments, const Float halfLength) { Trade::MeshData3D Capsule3D::wireframe(const UnsignedInt hemisphereRings, const UnsignedInt cylinderRings, const UnsignedInt segments, const Float halfLength) {
CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(hemisphereRings >= 1 && cylinderRings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Capsule::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, {}, {}, {}, {}));
Implementation::WireframeSpheroid capsule(segments/4); Implementation::WireframeSpheroid capsule(segments/4);

8
src/Magnum/Primitives/Circle.cpp

@ -34,7 +34,7 @@ namespace Magnum { namespace Primitives {
Trade::MeshData2D Circle::solid(UnsignedInt segments) { Trade::MeshData2D Circle::solid(UnsignedInt segments) {
CORRADE_ASSERT(segments >= 3, "Primitives::Circle::solid(): segments must be >= 3", CORRADE_ASSERT(segments >= 3, "Primitives::Circle::solid(): segments must be >= 3",
Trade::MeshData2D(MeshPrimitive::TriangleFan, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector2>>{}, std::vector<std::vector<Vector2>>{})); Trade::MeshData2D(MeshPrimitive::TriangleFan, {}, {}, {}));
std::vector<Vector2> positions; std::vector<Vector2> positions;
positions.reserve(segments+1); positions.reserve(segments+1);
@ -49,12 +49,12 @@ Trade::MeshData2D Circle::solid(UnsignedInt segments) {
positions.emplace_back(Math::cos(angle), Math::sin(angle)); positions.emplace_back(Math::cos(angle), Math::sin(angle));
} }
return Trade::MeshData2D(MeshPrimitive::TriangleFan, std::vector<UnsignedInt>{}, {std::move(positions)}, std::vector<std::vector<Vector2>>{}); return Trade::MeshData2D(MeshPrimitive::TriangleFan, {}, {std::move(positions)}, {});
} }
Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { Trade::MeshData2D Circle::wireframe(UnsignedInt segments) {
CORRADE_ASSERT(segments >= 3, "Primitives::Circle::wireframe(): segments must be >= 3", CORRADE_ASSERT(segments >= 3, "Primitives::Circle::wireframe(): segments must be >= 3",
Trade::MeshData2D(MeshPrimitive::LineLoop, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector2>>{}, std::vector<std::vector<Vector2>>{})); Trade::MeshData2D(MeshPrimitive::LineLoop, {}, {}, {}));
std::vector<Vector2> positions; std::vector<Vector2> positions;
positions.reserve(segments); positions.reserve(segments);
@ -66,7 +66,7 @@ Trade::MeshData2D Circle::wireframe(UnsignedInt segments) {
positions.emplace_back(Math::cos(angle), Math::sin(angle)); positions.emplace_back(Math::cos(angle), Math::sin(angle));
} }
return Trade::MeshData2D(MeshPrimitive::LineLoop, std::vector<UnsignedInt>{}, {std::move(positions)}, std::vector<std::vector<Vector2>>{}); return Trade::MeshData2D(MeshPrimitive::LineLoop, {}, {std::move(positions)}, {});
} }
}} }}

8
src/Magnum/Primitives/Crosshair.cpp

@ -33,18 +33,18 @@
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Trade::MeshData2D Crosshair2D::wireframe() { Trade::MeshData2D Crosshair2D::wireframe() {
return Trade::MeshData2D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, {{ return Trade::MeshData2D(MeshPrimitive::Lines, {}, {{
{-1.0f, 0.0f}, {1.0f, 0.0f}, {-1.0f, 0.0f}, {1.0f, 0.0f},
{ 0.0f, -1.0f}, {0.0f, 1.0f} { 0.0f, -1.0f}, {0.0f, 1.0f}
}}, std::vector<std::vector<Vector2>>{}); }}, {});
} }
Trade::MeshData3D Crosshair3D::wireframe() { Trade::MeshData3D Crosshair3D::wireframe() {
return Trade::MeshData3D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, {{ return Trade::MeshData3D(MeshPrimitive::Lines, {}, {{
{-1.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f},
{ 0.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, { 0.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.0f},
{ 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f} { 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f, 1.0f}
}}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{}); }}, {}, {});
} }
}} }}

4
src/Magnum/Primitives/Cube.cpp

@ -99,7 +99,7 @@ Trade::MeshData3D Cube::solid() {
{-1.0f, 0.0f, 0.0f}, {-1.0f, 0.0f, 0.0f},
{-1.0f, 0.0f, 0.0f}, /* -X */ {-1.0f, 0.0f, 0.0f}, /* -X */
{-1.0f, 0.0f, 0.0f} {-1.0f, 0.0f, 0.0f}
}}, std::vector<std::vector<Vector2>>{}); }}, {});
} }
Trade::MeshData3D Cube::wireframe() { Trade::MeshData3D Cube::wireframe() {
@ -118,7 +118,7 @@ Trade::MeshData3D Cube::wireframe() {
{ 1.0f, -1.0f, -1.0f}, { 1.0f, -1.0f, -1.0f},
{ 1.0f, 1.0f, -1.0f}, { 1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, -1.0f} {-1.0f, 1.0f, -1.0f}
}}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{}); }}, {}, {});
} }
}} }}

4
src/Magnum/Primitives/Cylinder.cpp

@ -34,7 +34,7 @@
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength, const Flags flags) { Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength, const Flags flags) {
CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(rings >= 1 && segments >= 3, "Primitives::Cylinder::solid(): cylinder must have at least one ring and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, {}, {}, {}, {}));
Implementation::Spheroid cylinder(segments, flags & Flag::GenerateTextureCoords ? Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::DontGenerate); Implementation::Spheroid cylinder(segments, flags & Flag::GenerateTextureCoords ? Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::DontGenerate);
@ -65,7 +65,7 @@ Trade::MeshData3D Cylinder::solid(const UnsignedInt rings, const UnsignedInt seg
} }
Trade::MeshData3D Cylinder::wireframe(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength) { Trade::MeshData3D Cylinder::wireframe(const UnsignedInt rings, const UnsignedInt segments, const Float halfLength) {
CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(rings >= 1 && segments >= 4 && segments%4 == 0, "Primitives::Cylinder::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, {}, {}, {}, {}));
Implementation::WireframeSpheroid cylinder(segments/4); Implementation::WireframeSpheroid cylinder(segments/4);

2
src/Magnum/Primitives/Icosphere.cpp

@ -81,7 +81,7 @@ Trade::MeshData3D Icosphere::solid(const UnsignedInt subdivisions) {
indices = MeshTools::duplicate(indices, MeshTools::removeDuplicates(positions)); indices = MeshTools::duplicate(indices, MeshTools::removeDuplicates(positions));
std::vector<Vector3> normals(positions); std::vector<Vector3> normals(positions);
return Trade::MeshData3D(MeshPrimitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, std::vector<std::vector<Vector2>>{}); return Trade::MeshData3D(MeshPrimitive::Triangles, std::move(indices), {std::move(positions)}, {std::move(normals)}, {});
} }
}} }}

2
src/Magnum/Primitives/Implementation/WireframeSpheroid.cpp

@ -111,7 +111,7 @@ void WireframeSpheroid::cylinder() {
} }
Trade::MeshData3D WireframeSpheroid::finalize() { Trade::MeshData3D WireframeSpheroid::finalize() {
return Trade::MeshData3D(MeshPrimitive::Lines, std::move(_indices), {std::move(_positions)}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{}); return Trade::MeshData3D(MeshPrimitive::Lines, std::move(_indices), {std::move(_positions)}, {}, {});
} }
}}} }}}

8
src/Magnum/Primitives/Line.cpp

@ -33,15 +33,15 @@
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Trade::MeshData2D Line2D::wireframe() { Trade::MeshData2D Line2D::wireframe() {
return Trade::MeshData2D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, {{ return Trade::MeshData2D(MeshPrimitive::Lines, {}, {{
{0.0f, 0.0f}, {1.0f, 0.0f} {0.0f, 0.0f}, {1.0f, 0.0f}
}}, std::vector<std::vector<Vector2>>{}); }}, {});
} }
Trade::MeshData3D Line3D::wireframe() { Trade::MeshData3D Line3D::wireframe() {
return Trade::MeshData3D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, {{ return Trade::MeshData3D(MeshPrimitive::Lines, {}, {{
{0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f},
}}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{}); }}, {}, {});
} }
}} }}

6
src/Magnum/Primitives/Plane.cpp

@ -40,7 +40,7 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) {
{0.0f, 1.0f} {0.0f, 1.0f}
}); });
return Trade::MeshData3D(MeshPrimitive::TriangleStrip, std::vector<UnsignedInt>{}, {{ return Trade::MeshData3D(MeshPrimitive::TriangleStrip, {}, {{
{1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, 0.0f},
{1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 0.0f},
{-1.0f, -1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f},
@ -54,12 +54,12 @@ Trade::MeshData3D Plane::solid(const TextureCoords textureCoords) {
} }
Trade::MeshData3D Plane::wireframe() { Trade::MeshData3D Plane::wireframe() {
return Trade::MeshData3D(MeshPrimitive::LineLoop, std::vector<UnsignedInt>{}, {{ return Trade::MeshData3D(MeshPrimitive::LineLoop, {}, {{
{-1.0f, -1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f},
{1.0f, -1.0f, 0.0f}, {1.0f, -1.0f, 0.0f},
{1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 0.0f},
{-1.0f, 1.0f, 0.0f} {-1.0f, 1.0f, 0.0f}
}}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{}); }}, {}, {});
} }
}} }}

6
src/Magnum/Primitives/Square.cpp

@ -40,7 +40,7 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) {
{0.0f, 1.0f} {0.0f, 1.0f}
}); });
return Trade::MeshData2D(MeshPrimitive::TriangleStrip, std::vector<UnsignedInt>{}, {{ return Trade::MeshData2D(MeshPrimitive::TriangleStrip, {}, {{
{1.0f, -1.0f}, {1.0f, -1.0f},
{1.0f, 1.0f}, {1.0f, 1.0f},
{-1.0f, -1.0f}, {-1.0f, -1.0f},
@ -49,12 +49,12 @@ Trade::MeshData2D Square::solid(const TextureCoords textureCoords) {
} }
Trade::MeshData2D Square::wireframe() { Trade::MeshData2D Square::wireframe() {
return Trade::MeshData2D(MeshPrimitive::LineLoop, std::vector<UnsignedInt>{}, {{ return Trade::MeshData2D(MeshPrimitive::LineLoop, {}, {{
{-1.0f, -1.0f}, {-1.0f, -1.0f},
{1.0f, -1.0f}, {1.0f, -1.0f},
{1.0f, 1.0f}, {1.0f, 1.0f},
{-1.0f, 1.0f} {-1.0f, 1.0f}
}}, std::vector<std::vector<Vector2>>{}); }}, {});
} }
}} }}

4
src/Magnum/Primitives/UVSphere.cpp

@ -34,7 +34,7 @@
namespace Magnum { namespace Primitives { namespace Magnum { namespace Primitives {
Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, TextureCoords textureCoords) { Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, TextureCoords textureCoords) {
CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", Trade::MeshData3D(MeshPrimitive::Triangles, {}, {}, {}, {}));
Implementation::Spheroid sphere(segments, textureCoords == TextureCoords::Generate ? Implementation::Spheroid sphere(segments, textureCoords == TextureCoords::Generate ?
Implementation::Spheroid::TextureCoords::Generate : Implementation::Spheroid::TextureCoords::Generate :
@ -61,7 +61,7 @@ Trade::MeshData3D UVSphere::solid(UnsignedInt rings, UnsignedInt segments, Textu
} }
Trade::MeshData3D UVSphere::wireframe(const UnsignedInt rings, const UnsignedInt segments) { Trade::MeshData3D UVSphere::wireframe(const UnsignedInt rings, const UnsignedInt segments) {
CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, std::vector<UnsignedInt>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector3>>{}, std::vector<std::vector<Vector2>>{})); CORRADE_ASSERT(rings >= 2 && rings%2 == 0 && segments >= 4 && segments%2 == 0, "Primitives::UVSphere::wireframe(): improper parameters", Trade::MeshData3D(MeshPrimitive::Lines, {}, {}, {}, {}));
Implementation::WireframeSpheroid sphere(segments/4); Implementation::WireframeSpheroid sphere(segments/4);

8
src/Magnum/SceneGraph/Object.hpp

@ -275,7 +275,7 @@ computed and recursively concatenated together. Resulting transformations for
joints which were originally in `object` list is then returned. joints which were originally in `object` list is then returned.
*/ */
template<class Transformation> std::vector<typename Transformation::DataType> Object<Transformation>::transformations(std::vector<std::reference_wrapper<Object<Transformation>>> objects, const typename Transformation::DataType& initialTransformation) const { template<class Transformation> std::vector<typename Transformation::DataType> Object<Transformation>::transformations(std::vector<std::reference_wrapper<Object<Transformation>>> objects, const typename Transformation::DataType& initialTransformation) const {
CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", std::vector<typename Transformation::DataType>{}); CORRADE_ASSERT(objects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", {});
/* Remember object count for later */ /* Remember object count for later */
std::size_t objectCount = objects.size(); std::size_t objectCount = objects.size();
@ -296,7 +296,7 @@ template<class Transformation> std::vector<typename Transformation::DataType> Ob
const Scene<Transformation>* scene = this->scene(); const Scene<Transformation>* scene = this->scene();
/* Nearest common ancestor not yet implemented - assert this is done on scene */ /* Nearest common ancestor not yet implemented - assert this is done on scene */
CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", std::vector<typename Transformation::DataType>{}); CORRADE_ASSERT(scene == this, "SceneGraph::Object::transformationMatrices(): currently implemented only for Scene", {});
/* Mark all objects up the hierarchy as visited */ /* Mark all objects up the hierarchy as visited */
auto it = objects.begin(); auto it = objects.begin();
@ -314,7 +314,7 @@ template<class Transformation> std::vector<typename Transformation::DataType> Ob
/* If this is root object, remove from list */ /* If this is root object, remove from list */
if(!parent) { if(!parent) {
CORRADE_ASSERT(&it->get() == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", std::vector<typename Transformation::DataType>{}); CORRADE_ASSERT(&it->get() == scene, "SceneGraph::Object::transformations(): the objects are not part of the same tree", {});
it = objects.erase(it); it = objects.erase(it);
/* Parent is an joint or already visited - remove current from list */ /* Parent is an joint or already visited - remove current from list */
@ -325,7 +325,7 @@ template<class Transformation> std::vector<typename Transformation::DataType> Ob
list of joint objects */ list of joint objects */
if(!(parent->flags & Flag::Joint)) { if(!(parent->flags & Flag::Joint)) {
CORRADE_ASSERT(jointObjects.size() < 0xFFFFu, CORRADE_ASSERT(jointObjects.size() < 0xFFFFu,
"SceneGraph::Object::transformations(): too large scene", std::vector<typename Transformation::DataType>{}); "SceneGraph::Object::transformations(): too large scene", {});
CORRADE_INTERNAL_ASSERT(parent->counter == 0xFFFFu); CORRADE_INTERNAL_ASSERT(parent->counter == 0xFFFFu);
parent->counter = UnsignedShort(jointObjects.size()); parent->counter = UnsignedShort(jointObjects.size());
parent->flags |= Flag::Joint; parent->flags |= Flag::Joint;

8
src/Magnum/Text/AbstractFontConverter.cpp

@ -41,7 +41,7 @@ AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& man
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const { std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const {
CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData),
"Text::AbstractFontConverter::exportFontToData(): feature not supported", (std::vector<std::pair<std::string, Containers::Array<unsigned char>>>{})); "Text::AbstractFontConverter::exportFontToData(): feature not supported", {});
return doExportFontToData(font, cache, filename, uniqueUnicode(characters)); return doExportFontToData(font, cache, filename, uniqueUnicode(characters));
} }
@ -53,7 +53,7 @@ std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFo
#endif #endif
{ {
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", (std::vector<std::pair<std::string, Containers::Array<unsigned char>>>{})); "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {});
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> out; std::vector<std::pair<std::string, Containers::Array<unsigned char>>> out;
out.emplace_back(filename, std::move(doExportFontToSingleData(font, cache, characters))); out.emplace_back(filename, std::move(doExportFontToSingleData(font, cache, characters)));
@ -107,14 +107,14 @@ bool AbstractFontConverter::doExportFontToFile(AbstractFont& font, GlyphCache& c
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const {
CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData),
"Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", (std::vector<std::pair<std::string, Containers::Array<unsigned char>>>{})); "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", {});
return doExportGlyphCacheToData(cache, filename); return doExportGlyphCacheToData(cache, filename);
} }
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const { std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const {
CORRADE_ASSERT(!(features() & Feature::MultiFile), CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", (std::vector<std::pair<std::string, Containers::Array<unsigned char>>>{})); "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {});
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> out; std::vector<std::pair<std::string, Containers::Array<unsigned char>>> out;
out.emplace_back(filename, std::move(doExportGlyphCacheToSingleData(cache))); out.emplace_back(filename, std::move(doExportGlyphCacheToSingleData(cache)));

2
src/Magnum/Text/GlyphCache.cpp

@ -82,7 +82,7 @@ void GlyphCache::initialize(const TextureFormat internalFormat, const Vector2i&
std::vector<Range2Di> GlyphCache::reserve(const std::vector<Vector2i>& sizes) { std::vector<Range2Di> GlyphCache::reserve(const std::vector<Vector2i>& sizes) {
CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair<Vector2i, Range2Di>()), CORRADE_ASSERT((glyphs.size() == 1 && glyphs.at(0) == std::pair<Vector2i, Range2Di>()),
"Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", std::vector<Range2Di>{}); "Text::GlyphCache::reserve(): reserving space in non-empty cache is not yet implemented", {});
glyphs.reserve(glyphs.size() + sizes.size()); glyphs.reserve(glyphs.size() + sizes.size());
return TextureTools::atlas(_size, sizes, _padding); return TextureTools::atlas(_size, sizes, _padding);
} }

2
src/Magnum/TextureTools/Atlas.cpp

@ -31,7 +31,7 @@
namespace Magnum { namespace TextureTools { namespace Magnum { namespace TextureTools {
std::vector<Range2Di> atlas(const Vector2i& atlasSize, const std::vector<Vector2i>& sizes, const Vector2i& padding) { std::vector<Range2Di> atlas(const Vector2i& atlasSize, const std::vector<Vector2i>& sizes, const Vector2i& padding) {
if(sizes.empty()) return std::vector<Range2Di>{}; if(sizes.empty()) return {};
/* Size of largest texture */ /* Size of largest texture */
Vector2i maxSize; Vector2i maxSize;

2
src/Magnum/TextureTools/Test/AtlasTest.cpp

@ -77,7 +77,7 @@ void AtlasTest::createPadding() {
} }
void AtlasTest::createEmpty() { void AtlasTest::createEmpty() {
std::vector<Range2Di> atlas = TextureTools::atlas({}, std::vector<Vector2i>{}); std::vector<Range2Di> atlas = TextureTools::atlas({}, {});
CORRADE_VERIFY(atlas.empty()); CORRADE_VERIFY(atlas.empty());
} }

2
src/MagnumPlugins/MagnumFont/MagnumFont.cpp

@ -149,7 +149,7 @@ std::pair<Float, Float> MagnumFont::doOpenFile(const std::string& filename, Floa
std::pair<Float, Float> MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) { std::pair<Float, Float> MagnumFont::openInternal(Utility::Configuration&& conf, Trade::ImageData2D&& image) {
/* Everything okay, save the data internally */ /* Everything okay, save the data internally */
_opened = new Data{std::move(conf), std::move(image), std::unordered_map<char32_t, UnsignedInt>{}, std::vector<Vector2>{}}; _opened = new Data{std::move(conf), std::move(image), std::unordered_map<char32_t, UnsignedInt>{}, {}};
/* Glyph advances */ /* Glyph advances */
const std::vector<Utility::ConfigurationGroup*> glyphs = _opened->conf.groups("glyph"); const std::vector<Utility::ConfigurationGroup*> glyphs = _opened->conf.groups("glyph");

Loading…
Cancel
Save