diff options
author | Alec Thomas <alec@swapoff.org> | 2015-07-18 21:22:10 -0400 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2015-07-18 21:22:43 -0400 |
commit | a7535d87a738157cfdfd30177828ae87c26ccaaa (patch) | |
tree | 7a25ad423f788192ed0beca864c8b0d4b9314f92 /examples | |
parent | c4d518bbdd136dde3826ff2e0e51ae84d7613720 (diff) |
Remove ambiguity that old compilers can't resolve.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/example.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/example.cc b/examples/example.cc index 7474f7f..bd049ba 100644 --- a/examples/example.cc +++ b/examples/example.cc @@ -87,7 +87,7 @@ public: void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { int c = 0; ex::ComponentHandle<Collideable> collideable; - es.each<Collideable>([&](Collideable&) { ++c; }); + es.each<Collideable>([&](ex::Entity entity, Collideable&) { ++c; }); for (int i = 0; i < count - c; i++) { ex::Entity entity = es.create(); @@ -117,7 +117,7 @@ private: // Updates a body's position and rotation. struct BodySystem : public ex::System<BodySystem> { void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each<Body>([dt](Body &body) { + es.each<Body>([dt](ex::Entity entity, Body &body) { body.position += body.direction * static_cast<float>(dt); body.rotation += body.rotationd * dt; }); @@ -131,7 +131,7 @@ public: explicit BounceSystem(sf::RenderTarget &target) : size(target.getSize()) {} void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each<Body>([this](Body &body) { + es.each<Body>([this](ex::Entity entity, Body &body) { if (body.position.x + body.direction.x < 0 || body.position.x + body.direction.x >= size.x) body.direction.x = -body.direction.x; @@ -246,7 +246,7 @@ public: void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { sf::VertexArray vertices(sf::Quads); - es.each<Particle, Body>([&vertices](Particle &particle, Body &body) { + es.each<Particle, Body>([&vertices](ex::Entity entity, Particle &particle, Body &body) { const float r = particle.radius; vertices.append(sf::Vertex(body.position + sf::Vector2f(-r, -r), particle.colour)); vertices.append(sf::Vertex(body.position + sf::Vector2f(r, -r), particle.colour)); @@ -324,7 +324,7 @@ public: } void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override { - es.each<Body, Renderable>([this](Body &body, Renderable &renderable) { + es.each<Body, Renderable>([this](ex::Entity entity, Body &body, Renderable &renderable) { renderable.shape->setPosition(body.position); renderable.shape->setRotation(body.rotation); target.draw(*renderable.shape.get()); |