From 5afe88df2538274859a162ffd63ed52118e80c19 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:07:54 +0100 Subject: Apply C++11 fixits modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using --- src/actorsprite.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/actorsprite.cpp') 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::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 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; -- cgit v1.2.3-70-g09d2