diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/actorsprite.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | Mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz Mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 Mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz Mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r-- | src/actorsprite.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index 3b3a83ef..58ffa6e7 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -51,14 +51,14 @@ ActorSprite::ActorSprite(int id): mStatusParticleEffects(&mStunParticleEffects, false), mChildParticleEffects(&mStatusParticleEffects, false), mMustResetParticles(false), - mUsedTargetCursor(NULL) + mUsedTargetCursor(nullptr) {} ActorSprite::~ActorSprite() { - setMap(NULL); + setMap(nullptr); - mUsedTargetCursor = NULL; + mUsedTargetCursor = nullptr; // Notify listeners of the destruction. Event event(Event::Destroyed); @@ -112,7 +112,7 @@ void ActorSprite::logic() if (mMustResetParticles) { mMustResetParticles = false; - for (std::set<int>::iterator it = mStatusEffects.begin(); + for (auto it = mStatusEffects.begin(); it != mStatusEffects.end(); it++) { const StatusEffect *effect = StatusEffect::getStatusEffect(*it, true); @@ -161,13 +161,13 @@ struct EffectDescription { std::string mSFXEffect; }; -static EffectDescription *default_effect = NULL; +static EffectDescription *default_effect = nullptr; static std::map<int, EffectDescription *> effects; static bool effects_initialized = false; static EffectDescription *getEffectDescription(xmlNodePtr node, int *id) { - EffectDescription *ed = new EffectDescription; + auto *ed = new EffectDescription; *id = atoi(XML::getProperty(node, "id", "-1").c_str()); ed->mSFXEffect = XML::getProperty(node, "audio", ""); @@ -187,7 +187,7 @@ static EffectDescription *getEffectDescription(int effectId) { logger->log("Error loading being effects file: " EFFECTS_FILE); - return NULL; + return nullptr; } for_each_xml_child_node(node, root) @@ -449,7 +449,7 @@ void ActorSprite::loadTargetCursor(const std::string &filename, return; } - Animation *anim = new Animation; + auto *anim = new Animation; for (unsigned int i = 0; i < currentImageSet->size(); ++i) { @@ -458,7 +458,7 @@ void ActorSprite::loadTargetCursor(const std::string &filename, -(currentImageSet->getHeight() / 2)); } - SimpleAnimation *currentCursor = new SimpleAnimation(anim); + auto *currentCursor = new SimpleAnimation(anim); targetCursorImages[type][size] = currentImageSet; targetCursor[type][size] = currentCursor; |