From 252b36a38bd1140ab73242b81e15178d01c072f3 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Wed, 21 Jan 2009 19:20:02 -0500 Subject: [PATCH] refactored effectManager --- TODO | 3 ++- src/effectManager.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/TODO b/TODO index 54b6269..3b9d98a 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,8 @@ and a * entry is something to remember when working in this area of the project. - remove (at least direct) uses of stl and the std libs - create my own set - - replace the setPhys in collisionHandler + - replace the set in collisionHandler + - replace the set in effectManager - create my own list diff --git a/src/effectManager.cpp b/src/effectManager.cpp index a75e5d8..c11ffc3 100644 --- a/src/effectManager.cpp +++ b/src/effectManager.cpp @@ -33,13 +33,13 @@ typedef std::set setEffect; setEffect active_Effects; -GravityWell* mouseWell; +GravityWell* pMouseWell; /// ***** Initializers/Cleaners ***** void effect::init() { - mouseWell = new GravityWell(Vector2(0,0)); + pMouseWell = new GravityWell(Vector2(0,0)); active_Effects.insert(new Screen()); active_Effects.insert(new Gravity()); @@ -63,15 +63,15 @@ void effect::update(float) void effect::handleInput() { if(cfg::mouseWellFollow()) - mouseWell->setPosition(input::mousePosition()); + pMouseWell->setPosition(input::mousePosition()); if(cfg::mouseWellOn()) - active_Effects.insert(mouseWell); + active_Effects.insert(pMouseWell); if(cfg::mouseWellOff()) - active_Effects.erase(mouseWell); + active_Effects.erase(pMouseWell); } -Vector2 effect::positionDelta(const PhysicsEntity* e, float time_step) +Vector2 effect::positionDelta(const PhysicsEntity* ppe, float fTimeStep) { Vector2 acc(0,0); @@ -79,12 +79,12 @@ Vector2 effect::positionDelta(const PhysicsEntity* e, float time_step) it != active_Effects.end(); it++ ) { - acc += (*it)->positionDelta(e, time_step); + acc += (*it)->positionDelta(ppe, fTimeStep); } return acc; } -Vector2 effect::velocityDelta(const PhysicsEntity* e, float time_step) +Vector2 effect::velocityDelta(const PhysicsEntity* ppe, float fTimeStep) { Vector2 acc(0,0); @@ -92,12 +92,12 @@ Vector2 effect::velocityDelta(const PhysicsEntity* e, float time_step) it != active_Effects.end(); it++ ) { - acc += (*it)->velocityDelta(e, time_step); + acc += (*it)->velocityDelta(ppe, fTimeStep); } return acc; } -Vector2 effect::forceDelta(const PhysicsEntity* e, float time_step) +Vector2 effect::forceDelta(const PhysicsEntity* ppe, float fTimeStep) { Vector2 acc(0,0); @@ -105,7 +105,7 @@ Vector2 effect::forceDelta(const PhysicsEntity* e, float time_step) it != active_Effects.end(); it++ ) { - acc += (*it)->forceDelta(e, time_step); + acc += (*it)->forceDelta(ppe, fTimeStep); } return acc; -- 2.10.2