summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-07 03:14:31 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-07 13:45:44 +0100
commitb9cacafcad8b515c1c65aee804a3ce08411b73c9 (patch)
tree8a82fabf08b322de8b31b97bc356caccc33f90f6 /src
parent3fcd6a549fc825f4185a6dc248922e02988caed5 (diff)
downloadmana-b9cacafcad8b515c1c65aee804a3ce08411b73c9.tar.gz
mana-b9cacafcad8b515c1c65aee804a3ce08411b73c9.tar.bz2
mana-b9cacafcad8b515c1c65aee804a3ce08411b73c9.tar.xz
mana-b9cacafcad8b515c1c65aee804a3ce08411b73c9.zip
Some small updates and reformatting
Diffstat (limited to 'src')
-rw-r--r--src/gui/popupmenu.cpp1
-rw-r--r--src/particlecontainer.cpp50
-rw-r--r--src/statuseffect.cpp37
-rw-r--r--src/statuseffect.h22
4 files changed, 49 insertions, 61 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 23e3bc1e..07719d2c 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -261,7 +261,6 @@ void PopupMenu::handleLink(const std::string& link)
setVisible(false);
- being = NULL;
mBeingId = 0;
mFloorItem = NULL;
mItem = NULL;
diff --git a/src/particlecontainer.cpp b/src/particlecontainer.cpp
index f7672eac..54a7b315 100644
--- a/src/particlecontainer.cpp
+++ b/src/particlecontainer.cpp
@@ -24,10 +24,10 @@
#include "particlecontainer.h"
-ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent) :
+ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
mDelParent(delParent),
mNext(parent)
-{};
+{}
ParticleContainer::~ParticleContainer()
{
@@ -36,8 +36,7 @@ ParticleContainer::~ParticleContainer()
delete mNext;
}
-void
-ParticleContainer::clear()
+void ParticleContainer::clear()
{
clearLocally();
if (mNext)
@@ -45,8 +44,7 @@ ParticleContainer::clear()
}
-void
-ParticleContainer::setPositions(float x, float y)
+void ParticleContainer::setPositions(float x, float y)
{
if (mNext)
mNext->setPositions(x, y);
@@ -55,12 +53,12 @@ ParticleContainer::setPositions(float x, float y)
// -- particle list ----------------------------------------
ParticleList::ParticleList(ParticleContainer *parent, bool delParent) :
- ParticleContainer(parent, delParent) {};
+ ParticleContainer(parent, delParent)
+{}
ParticleList::~ParticleList() {}
-void
-ParticleList::addLocally(Particle *particle)
+void ParticleList::addLocally(Particle *particle)
{
if (particle)
{
@@ -70,8 +68,7 @@ ParticleList::addLocally(Particle *particle)
}
}
-void
-ParticleList::removeLocally(Particle *particle)
+void ParticleList::removeLocally(Particle *particle)
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
@@ -81,18 +78,16 @@ ParticleList::removeLocally(Particle *particle)
}
}
-void
-ParticleList::clearLocally()
+void ParticleList::clearLocally()
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
(*it)->kill();
-
+
mElements.clear();
}
-void
-ParticleList::setPositions(float x, float y)
+void ParticleList::setPositions(float x, float y)
{
ParticleContainer::setPositions(x, y);
@@ -115,13 +110,14 @@ ParticleList::setPositions(float x, float y)
// -- particle vector ----------------------------------------
-ParticleVector::ParticleVector(ParticleContainer *parent, bool delParent) :
- ParticleContainer(parent, delParent) {};
+ParticleVector::ParticleVector(ParticleContainer *parent, bool delParent):
+ ParticleContainer(parent, delParent)
+{}
-ParticleVector::~ParticleVector() {};
+ParticleVector::~ParticleVector()
+{}
-void
-ParticleVector::setLocally(int index, Particle *particle)
+void ParticleVector::setLocally(int index, Particle *particle)
{
assert(index >= 0);
@@ -134,8 +130,7 @@ ParticleVector::setLocally(int index, Particle *particle)
mIndexedElements[index] = particle;
}
-void
-ParticleVector::delLocally(int index)
+void ParticleVector::delLocally(int index)
{
assert(index >= 0);
@@ -150,20 +145,18 @@ ParticleVector::delLocally(int index)
}
}
-void
-ParticleVector::clearLocally()
+void ParticleVector::clearLocally()
{
for (unsigned int i = 0; i < mIndexedElements.size(); i++)
delLocally(i);
}
-void
-ParticleVector::setPositions(float x, float y)
+void ParticleVector::setPositions(float x, float y)
{
ParticleContainer::setPositions(x, y);
for (std::vector<Particle *>::iterator it = mIndexedElements.begin();
- it != mIndexedElements.end(); it++)
+ it != mIndexedElements.end(); it++) {
if (*it)
{
(*it)->setPosition(x, y);
@@ -174,5 +167,6 @@ ParticleVector::setPositions(float x, float y)
*it = NULL;
}
}
+ }
}
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp
index 564d26f0..eeae45d8 100644
--- a/src/statuseffect.cpp
+++ b/src/statuseffect.cpp
@@ -30,25 +30,25 @@
#define STATUS_EFFECTS_FILE "status-effects.xml"
-StatusEffect::StatusEffect() {};
-StatusEffect::~StatusEffect() {};
+StatusEffect::StatusEffect()
+{}
-void
-StatusEffect::playSFX()
+StatusEffect::~StatusEffect()
+{}
+
+void StatusEffect::playSFX()
{
if (mSFXEffect != "")
sound.playSfx(mSFXEffect);
}
-void
-StatusEffect::deliverMessage()
+void StatusEffect::deliverMessage()
{
if (mMessage != "")
chatWindow->chatLog(mMessage, BY_SERVER);
}
-Particle *
-StatusEffect::getParticle()
+Particle *StatusEffect::getParticle()
{
if (mParticleEffect == "")
return NULL;
@@ -56,13 +56,13 @@ StatusEffect::getParticle()
return particleEngine->addEffect(mParticleEffect, 0, 0);
}
-AnimatedSprite *
-StatusEffect::getIcon()
+AnimatedSprite *StatusEffect::getIcon()
{
if (mIcon == "")
return NULL;
else {
- AnimatedSprite * sprite = AnimatedSprite::load("graphics/sprites/" + mIcon);
+ AnimatedSprite *sprite = AnimatedSprite::load(
+ "graphics/sprites/" + mIcon);
if (false && sprite) {
sprite->play(ACTION_DEFAULT);
sprite->reset();
@@ -71,8 +71,7 @@ StatusEffect::getIcon()
}
}
-SpriteAction
-StatusEffect::getAction()
+SpriteAction StatusEffect::getAction()
{
if (mAction == "")
return ACTION_INVALID;
@@ -90,23 +89,20 @@ static status_effect_map statusEffects;
static status_effect_map stunEffects;
static std::map<int, int> blockEffectIndexMap;
-int
-StatusEffect::blockEffectIndexToEffectIndex(int blockIndex)
+int StatusEffect::blockEffectIndexToEffectIndex(int blockIndex)
{
if (blockEffectIndexMap.find(blockIndex) == blockEffectIndexMap.end())
return -1;
return blockEffectIndexMap[blockIndex];
}
-StatusEffect *
-StatusEffect::getStatusEffect(int index, bool enabling)
+StatusEffect *StatusEffect::getStatusEffect(int index, bool enabling)
{
load();
return statusEffects[enabling][index];
}
-StatusEffect *
-StatusEffect::getStunEffect(int index, bool enabling)
+StatusEffect *StatusEffect::getStunEffect(int index, bool enabling)
{
load();
return stunEffects[enabling][index];
@@ -116,8 +112,7 @@ static bool status_effects_loaded = false;
-void
-StatusEffect::load()
+void StatusEffect::load()
{
if (status_effects_loaded)
return;
diff --git a/src/statuseffect.h b/src/statuseffect.h
index 9db90687..5d18ac92 100644
--- a/src/statuseffect.h
+++ b/src/statuseffect.h
@@ -18,6 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#ifndef STATUS_EFFECT_H
#define STATUS_EFFECT_H
@@ -33,36 +34,35 @@ public:
~StatusEffect();
/**
- * Plays the sound effect associated with this status effect, if possible
+ * Plays the sound effect associated with this status effect, if possible.
*/
void playSFX();
/**
- * Delivers the chat message associated with this status effect, if possible
+ * Delivers the chat message associated with this status effect, if
+ * possible.
*/
void deliverMessage();
/**
- * Creates the particle effect associated with this status effect, if possible
+ * Creates the particle effect associated with this status effect, if
+ * possible.
*/
- Particle *
- getParticle();
+ Particle *getParticle();
/**
* Retrieves the status icon for this effect, if applicable
*/
- AnimatedSprite *
- getIcon();
+ AnimatedSprite *getIcon();
/**
* Retrieves an action to perform, or ACTION_INVALID
*/
- SpriteAction
- getAction();
+ SpriteAction getAction();
/**
- * Retrieves a status effect.
+ * Retrieves a status effect.
*
* \param index Index of the status effect.
* \param enabling Whether to retrieve the activating effect (true) or
@@ -71,7 +71,7 @@ public:
static StatusEffect *getStatusEffect(int index, bool enabling);
/**
- * Retrieves a stun effect.
+ * Retrieves a stun effect.
*
* \param index Index of the stun effect.
* \param enabling Whether to retrieve the activating effect (true) or