summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-12-26 22:45:24 -0700
committerIra Rice <irarice@gmail.com>2008-12-26 22:45:24 -0700
commit4854bc433cd74bb072d02e25aa416f06ff6257b4 (patch)
tree13fbae3ee50ea27829d31fb328d0ef761733dcc9 /src/effectmanager.cpp
parent0289c04b5454b42676f3b6beb68571e71617500c (diff)
downloadmana-4854bc433cd74bb072d02e25aa416f06ff6257b4.tar.gz
mana-4854bc433cd74bb072d02e25aa416f06ff6257b4.tar.bz2
mana-4854bc433cd74bb072d02e25aa416f06ff6257b4.tar.xz
mana-4854bc433cd74bb072d02e25aa416f06ff6257b4.zip
Fixed a potential leak in setup, changed the default border color to
white for wallpapers (matches our wallpapers better), and fixed the effect manager. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 4b835355..89bbf8f5 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -21,14 +21,12 @@
*/
#include "effectmanager.h"
-
-#include "particle.h"
#include "log.h"
+#include "particle.h"
#include "sound.h"
#include "utils/xml.h"
-
EffectManager::EffectManager()
{
XML::Document doc("effects.xml");
@@ -64,6 +62,29 @@ EffectManager::~EffectManager()
}
+bool EffectManager::trigger(int id, Being* being)
+{
+ bool rValue = false;
+ for (std::list<EffectDescription>::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
+ {
+ if ((*i).id == id)
+ {
+ printf("Found effect, playing it");
+ rValue = true;
+ if((*i).GFX != "")
+ {
+ Particle *selfFX;
+ selfFX = particleEngine->addEffect((*i).GFX, 0, 0);
+ being->controlParticle(selfFX);
+ }
+ if((*i).SFX != "")
+ sound.playSfx((*i).SFX);
+ break;
+ }
+ }
+ return rValue;
+}
+
bool EffectManager::trigger(int id, int x, int y)
{
bool rValue = false;