From 4854bc433cd74bb072d02e25aa416f06ff6257b4 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 26 Dec 2008 22:45:24 -0700 Subject: 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 --- src/effectmanager.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/effectmanager.cpp') 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::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; -- cgit v1.2.3-70-g09d2