diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-04 22:33:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-04 23:04:16 +0300 |
commit | faeaa157b1abada82243b8dc508201aa17db1df2 (patch) | |
tree | 4bd20cce8987a5e77d341b953ee6f93aaaab3504 | |
parent | a1b7e08a00a9dfcf3596252f5565eea170fd4c71 (diff) | |
download | mv-faeaa157b1abada82243b8dc508201aa17db1df2.tar.gz mv-faeaa157b1abada82243b8dc508201aa17db1df2.tar.bz2 mv-faeaa157b1abada82243b8dc508201aa17db1df2.tar.xz mv-faeaa157b1abada82243b8dc508201aa17db1df2.zip |
Add support for loading animated effect for effects.xml
now this animation is unused.
also effect field names is fixed.
-rw-r--r-- | src/effectmanager.cpp | 27 | ||||
-rw-r--r-- | src/effectmanager.h | 15 |
2 files changed, 23 insertions, 19 deletions
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; } } diff --git a/src/effectmanager.h b/src/effectmanager.h index fca033d97..95ecc3439 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -37,16 +37,19 @@ class EffectManager final public: struct EffectDescription { - EffectDescription(const int id0, const std::string &GFX0, - const std::string &SFX0) : + EffectDescription(const int id0, const std::string &gfx0, + const std::string &sfx0, + const std::string &sprite0) : id(id0), - GFX(GFX0), - SFX(SFX0) + gfx(gfx0), + sfx(sfx0), + sprite(sprite0) { } int id; - std::string GFX; - std::string SFX; + std::string gfx; + std::string sfx; + std::string sprite; }; EffectManager(); |