summaryrefslogtreecommitdiff
path: root/src/actorsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-04 22:22:22 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-04 22:32:50 +0300
commita1b7e08a00a9dfcf3596252f5565eea170fd4c71 (patch)
treef7beb57e41114480757faf0f6a81ec454ff59182 /src/actorsprite.cpp
parent4ad3a8e89e64ce3ae845d2786dd433ab2682393e (diff)
downloadmanaplus-a1b7e08a00a9dfcf3596252f5565eea170fd4c71.tar.gz
manaplus-a1b7e08a00a9dfcf3596252f5565eea170fd4c71.tar.bz2
manaplus-a1b7e08a00a9dfcf3596252f5565eea170fd4c71.tar.xz
manaplus-a1b7e08a00a9dfcf3596252f5565eea170fd4c71.zip
Remove dead code from actorsprite class.
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r--src/actorsprite.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp
index af98a0fbc..60857a5af 100644
--- a/src/actorsprite.cpp
+++ b/src/actorsprite.cpp
@@ -42,8 +42,6 @@
#include "debug.h"
-static const char *const EFFECTS_FILE = "effects.xml";
-
ImageSet *ActorSprite::targetCursorImages[2][NUM_TC];
SimpleAnimation *ActorSprite::targetCursor[2][NUM_TC];
bool ActorSprite::loaded = false;
@@ -166,71 +164,6 @@ struct EffectDescription final
std::string mSFXEffect;
};
-static EffectDescription *default_effect = nullptr;
-static std::map<int, EffectDescription *> effects;
-static bool effects_initialized = false;
-
-static EffectDescription *getEffectDescription(XmlNodePtr const node,
- int *const id)
-{
- if (!id)
- return nullptr;
-
- EffectDescription *const ed = new EffectDescription;
-
- *id = atoi(XML::getProperty(node, "id", "-1").c_str());
- ed->mSFXEffect = XML::getProperty(node, "audio", "");
- ed->mGFXEffect = XML::getProperty(node, "particle", "");
-
- return ed;
-}
-
-static EffectDescription *getEffectDescription(const int effectId)
-{
- if (!effects_initialized)
- {
- XML::Document doc(EFFECTS_FILE);
- const XmlNodePtr root = doc.rootNode();
-
- if (!root || !xmlNameEqual(root, "being-effects"))
- {
- logger->log1("Error loading being effects file");
- return nullptr;
- }
-
- for_each_xml_child_node(node, root)
- {
- int id;
-
- if (xmlNameEqual(node, "effect"))
- {
- EffectDescription *const effectDescription =
- getEffectDescription(node, &id);
- effects[id] = effectDescription;
- }
- else if (xmlNameEqual(node, "default"))
- {
- EffectDescription *const effectDescription =
- getEffectDescription(node, &id);
-
- delete default_effect;
-
- default_effect = effectDescription;
- }
- }
-
- effects_initialized = true;
- } // done initializing
-
- std::map<int, EffectDescription *>::iterator it = effects.find(effectId);
- if (it == effects.end())
- return default_effect;
-
- EffectDescription *const ed = (*it).second;
-
- return ed ? ed : default_effect;
-}
-
void ActorSprite::setStatusEffect(const int index, const bool active)
{
const bool wasActive = mStatusEffects.find(index) != mStatusEffects.end();
@@ -258,33 +191,6 @@ void ActorSprite::setStatusEffectBlock(const int offset,
}
}
-void ActorSprite::internalTriggerEffect(const int effectId, const bool sfx,
- const bool gfx)
-{
- if (reportTrue(!particleEngine))
- return;
-
- if (player_node)
- {
- logger->log("Special effect #%d on %s", effectId,
- getId() == player_node->getId() ? "self" : "other");
- }
-
- const EffectDescription *const ed = getEffectDescription(effectId);
-
- if (reportTrue(!ed))
- {
- logger->log1("Unknown special effect and no default recorded");
- return;
- }
-
- if (gfx && !ed->mGFXEffect.empty())
- controlParticle(particleEngine->addEffect(ed->mGFXEffect, 0, 0));
-
- if (sfx && !ed->mSFXEffect.empty())
- soundManager.playSfx(ed->mSFXEffect);
-}
-
void ActorSprite::updateStunMode(const int oldMode, const int newMode)
{
handleStatusEffect(StatusEffect::getStatusEffect(oldMode, false), -1);