summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:54:01 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:54:01 +0100
commit337fdc49fc9fd5c041568c30327a9aab66e6080d (patch)
tree4eba7a36fcfda0d4810b56f64850385f26fec3d1
parent68760426532b9ca4c6939d7a7b8faa1586ee82e0 (diff)
downloadmana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.gz
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.bz2
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.xz
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.zip
Mostly code reformatting
-rw-r--r--src/being.cpp5
-rw-r--r--src/particlecontainer.cpp12
-rw-r--r--src/particlecontainer.h6
3 files changed, 14 insertions, 9 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 56764fed..85807b2f 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -390,8 +390,9 @@ void Being::logic()
}
}
- //Update particle effects
- mChildParticleEffects.setPositions((float)mPx + 16.0f, (float)mPy + 32.0f);
+ // Update particle effects
+ mChildParticleEffects.setPositions((float) mPx + 16.0f,
+ (float) mPy + 32.0f);
}
void Being::draw(Graphics *graphics, int offsetX, int offsetY) const
diff --git a/src/particlecontainer.cpp b/src/particlecontainer.cpp
index 54a7b315..ddd99ff2 100644
--- a/src/particlecontainer.cpp
+++ b/src/particlecontainer.cpp
@@ -24,7 +24,8 @@
#include "particlecontainer.h"
-ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
+ParticleContainer::ParticleContainer(ParticleContainer *parent,
+ bool delParent):
mDelParent(delParent),
mNext(parent)
{}
@@ -32,7 +33,7 @@ ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
ParticleContainer::~ParticleContainer()
{
clearLocally();
- if (mNext && mDelParent)
+ if (mDelParent)
delete mNext;
}
@@ -52,11 +53,12 @@ void ParticleContainer::setPositions(float x, float y)
// -- particle list ----------------------------------------
-ParticleList::ParticleList(ParticleContainer *parent, bool delParent) :
+ParticleList::ParticleList(ParticleContainer *parent, bool delParent):
ParticleContainer(parent, delParent)
{}
-ParticleList::~ParticleList() {}
+ParticleList::~ParticleList()
+{}
void ParticleList::addLocally(Particle *particle)
{
@@ -72,10 +74,12 @@ void ParticleList::removeLocally(Particle *particle)
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
+ {
if (*it == particle) {
(*it)->kill();
mElements.erase(it);
}
+ }
}
void ParticleList::clearLocally()
diff --git a/src/particlecontainer.h b/src/particlecontainer.h
index cf002fbc..b2bb4399 100644
--- a/src/particlecontainer.h
+++ b/src/particlecontainer.h
@@ -61,8 +61,8 @@ public:
virtual void setPositions(float x, float y);
protected:
- bool mDelParent; /**< Delete mNext in destructor */
- ParticleContainer *mNext; /**< Contained container, if any */
+ bool mDelParent; /**< Delete mNext in destructor */
+ ParticleContainer *mNext; /**< Contained container, if any */
};
@@ -91,7 +91,7 @@ public:
virtual void setPositions(float x, float y);
protected:
- std::list<Particle *> mElements; /**< Contained particle effects */
+ std::list<Particle *> mElements; /**< Contained particle effects */
};