summaryrefslogtreecommitdiff
path: root/src/animatedsprite.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:07:54 +0100
commit5afe88df2538274859a162ffd63ed52118e80c19 (patch)
treeb610dfd58dc748fd63f49565b2a43eea2316714f /src/animatedsprite.cpp
parent73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff)
downloadmana-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/animatedsprite.cpp')
-rw-r--r--src/animatedsprite.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index 54a11d87..a9138e36 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -36,9 +36,9 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite):
mFrameIndex(0),
mFrameTime(0),
mSprite(sprite),
- mAction(0),
- mAnimation(0),
- mFrame(0)
+ mAction(nullptr),
+ mAnimation(nullptr),
+ mFrame(nullptr)
{
assert(mSprite);
@@ -56,8 +56,8 @@ AnimatedSprite *AnimatedSprite::load(const std::string &filename, int variant)
ResourceManager *resman = ResourceManager::getInstance();
SpriteDef *s = resman->getSprite(filename, variant);
if (!s)
- return NULL;
- AnimatedSprite *as = new AnimatedSprite(s);
+ return nullptr;
+ auto *as = new AnimatedSprite(s);
s->decRef();
return as;
}
@@ -145,8 +145,8 @@ bool AnimatedSprite::updateCurrentAnimation(unsigned int time)
if (Animation::isTerminator(*mFrame))
{
- mAnimation = 0;
- mFrame = 0;
+ mAnimation = nullptr;
+ mFrame = nullptr;
return false;
}
}
@@ -229,5 +229,5 @@ int AnimatedSprite::getOffsetY() const
const Image* AnimatedSprite::getImage() const
{
- return mFrame ? mFrame->image : 0;
+ return mFrame ? mFrame->image : nullptr;
}