From faeaa157b1abada82243b8dc508201aa17db1df2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 4 Apr 2013 22:33:00 +0300 Subject: Add support for loading animated effect for effects.xml now this animation is unused. also effect field names is fixed. --- src/effectmanager.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/effectmanager.cpp') diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 2d235bbfe..f7e1ccbaa 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -51,7 +51,8 @@ EffectManager::EffectManager() mEffects.push_back(EffectDescription( XML::getProperty(node, "id", -1), XML::getProperty(node, "particle", ""), - XML::getProperty(node, "audio", ""))); + XML::getProperty(node, "audio", ""), + XML::getProperty(node, "sprite", ""))); } } } @@ -72,14 +73,14 @@ bool EffectManager::trigger(const int id, Being *const being, if ((*i).id == id) { rValue = true; - if (!(*i).GFX.empty()) + if (!(*i).gfx.empty()) { Particle *const selfFX = particleEngine->addEffect( - (*i).GFX, 0, 0, rotation); + (*i).gfx, 0, 0, rotation); being->controlParticle(selfFX); } - if (!(*i).SFX.empty()) - soundManager.playSfx((*i).SFX); + if (!(*i).sfx.empty()) + soundManager.playSfx((*i).sfx); break; } } @@ -97,14 +98,14 @@ Particle *EffectManager::triggerReturn(const int id, Being *const being, { if ((*i).id == id) { - if (!(*i).GFX.empty()) + if (!(*i).gfx.empty()) { rValue = particleEngine->addEffect( - (*i).GFX, 0, 0, rotation); + (*i).gfx, 0, 0, rotation); being->controlParticle(rValue); } - if (!(*i).SFX.empty()) - soundManager.playSfx((*i).SFX); + if (!(*i).sfx.empty()) + soundManager.playSfx((*i).sfx); break; } } @@ -123,10 +124,10 @@ bool EffectManager::trigger(const int id, const int x, const int y, if ((*i).id == id) { rValue = true; - if (!(*i).GFX.empty() && particleEngine) - particleEngine->addEffect((*i).GFX, x, y, rotation); - if (!(*i).SFX.empty()) - soundManager.playSfx((*i).SFX); + if (!(*i).gfx.empty() && particleEngine) + particleEngine->addEffect((*i).gfx, x, y, rotation); + if (!(*i).sfx.empty()) + soundManager.playSfx((*i).sfx); break; } } -- cgit v1.2.3-70-g09d2