diff options
-rw-r--r-- | src/being.cpp | 1 | ||||
-rw-r--r-- | src/being.h | 1 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 2 | ||||
-rw-r--r-- | src/monster.cpp | 4 | ||||
-rw-r--r-- | src/npc.cpp | 2 | ||||
-rw-r--r-- | src/particle.cpp | 2 | ||||
-rw-r--r-- | src/particle.h | 1 | ||||
-rw-r--r-- | src/player.cpp | 2 |
8 files changed, 9 insertions, 6 deletions
diff --git a/src/being.cpp b/src/being.cpp index 69d9293f..b54f4c44 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -78,7 +78,6 @@ Being::Being(int id, int job, Map *map): mDirection(DOWN), mSpriteDirection(DIRECTION_DOWN), mMap(NULL), - mParticleEffects(config.getValue("particleeffects", 1)), mDispName(0), mShowName(false), mEquippedWeapon(NULL), diff --git a/src/being.h b/src/being.h index b1a08e37..8aa34b7c 100644 --- a/src/being.h +++ b/src/being.h @@ -529,7 +529,6 @@ class Being : public Sprite, public ConfigListener Map *mMap; /**< Map on which this being resides */ std::string mName; /**< Name of character */ MapSprite mMapSprite; - bool mParticleEffects; /**< Whether to display particles or not */ /** * Holds a text object when the being displays it's name, 0 otherwise diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index a4bd6864..b1d40575 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -484,6 +484,8 @@ void Setup_Video::action(const gcn::ActionEvent &event) { config.setValue("particleeffects", mParticleEffectsCheckBox->isSelected()); + Particle::enabled = mParticleEffectsCheckBox->isSelected(); + if (engine) { new OkDialog(_("Particle Effect Settings Changed."), diff --git a/src/monster.cpp b/src/monster.cpp index cc2285fe..34390982 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -53,7 +53,7 @@ Monster::Monster(int id, int job, Map *map): mSprites.push_back(AnimatedSprite::load("graphics/sprites/error.xml")); } - if (mParticleEffects) + if (Particle::enabled) { const std::list<std::string> &particleEffects = info.getParticleEffects(); for (std::list<std::string>::const_iterator i = particleEffects.begin(); @@ -106,7 +106,7 @@ void Monster::setAction(Action action, int attackType) //attack particle effect particleEffect = getInfo().getAttackParticleEffect(attackType); - if (!particleEffect.empty() && mParticleEffects) + if (!particleEffect.empty() && Particle::enabled) { switch (mSpriteDirection) { diff --git a/src/npc.cpp b/src/npc.cpp index 882f1b42..a79e5bac 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -52,7 +52,7 @@ NPC::NPC(int id, int job, Map *map): mSpriteColors.push_back(""); } - if (mParticleEffects) + if (Particle::enabled) { //setup particle effects for (std::list<std::string>::const_iterator i = info.particles.begin(); diff --git a/src/particle.cpp b/src/particle.cpp index 42ec84d7..21bcec99 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -49,6 +49,7 @@ int Particle::particleCount = 0; int Particle::maxCount = 0; int Particle::fastPhysics = 0; int Particle::emitterSkip = 1; +bool Particle::enabled = true; const float Particle::PARTICLE_SKY = 800.0f; Particle::Particle(Map *map): @@ -89,6 +90,7 @@ void Particle::setupEngine() Particle::maxCount = (int)config.getValue("particleMaxCount", 3000); Particle::fastPhysics = (int)config.getValue("particleFastPhysics", 0); Particle::emitterSkip = (int)config.getValue("particleEmitterSkip", 1) + 1; + Particle::enabled = (bool)config.getValue("particleeffects", true); disableAutoDelete(); logger->log("Particle engine set up"); } diff --git a/src/particle.h b/src/particle.h index c3e7692c..1b2d24ae 100644 --- a/src/particle.h +++ b/src/particle.h @@ -49,6 +49,7 @@ class Particle : public Sprite static int particleCount; /**< Current number of particles */ static int maxCount; /**< Maximum number of particles */ static int emitterSkip; /**< Duration of pause between two emitter updates in ticks */ + static bool enabled; /**< true when non-crucial particle effects are disabled */ /** * Constructor. diff --git a/src/player.cpp b/src/player.cpp index 7e390b84..3cee0d1e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -102,7 +102,7 @@ void Player::logic() if (mEquippedWeapon) particleEffect = mEquippedWeapon->getParticleEffect(); - if (!particleEffect.empty() && mParticleEffects && mFrame == 1) + if (!particleEffect.empty() && Particle::enabled && mFrame == 1) { switch (mDirection) { |