diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-08 00:44:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-08 00:44:17 +0300 |
commit | 4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe (patch) | |
tree | 714897eca03fbcb764f5b450a29cc1aef8d33433 /src/animatedsprite.cpp | |
parent | 9e83411f7e4147d09af5a5006888dcc187ea0ef8 (diff) | |
download | manaverse-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.gz manaverse-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.bz2 manaverse-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.tar.xz manaverse-4cea2a5cd85b8d3ad905eb3b337b28284c62d4fe.zip |
Fix more gcc 4.7 warnings.
Diffstat (limited to 'src/animatedsprite.cpp')
-rw-r--r-- | src/animatedsprite.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index fedcd8de2..c1f1cac85 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -40,9 +40,9 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mFrameIndex(0), mFrameTime(0), mSprite(sprite), - mAction(0), - mAnimation(0), - mFrame(0) + mAction(nullptr), + mAnimation(nullptr), + mFrame(nullptr) { mAlpha = 1.0f; @@ -59,7 +59,7 @@ AnimatedSprite *AnimatedSprite::load(const std::string &filename, int variant) ResourceManager *resman = ResourceManager::getInstance(); SpriteDef *s = resman->getSprite(filename, variant); if (!s) - return 0; + return nullptr; AnimatedSprite *as = new AnimatedSprite(s); s->decRef(); return as; @@ -70,7 +70,7 @@ AnimatedSprite::~AnimatedSprite() if (mSprite) { mSprite->decRef(); - mSprite = 0; + mSprite = nullptr; } } @@ -194,8 +194,8 @@ bool AnimatedSprite::updateCurrentAnimation(unsigned int time) { if (mFrame->rand == 100 || rand() % 100 <= mFrame->rand) { - mAnimation = 0; - mFrame = 0; + mAnimation = nullptr; + mFrame = nullptr; return false; } } @@ -292,7 +292,7 @@ std::string AnimatedSprite::getIdPath() const Image* AnimatedSprite::getImage() const { - return mFrame ? mFrame->image : 0; + return mFrame ? mFrame->image : nullptr; } void AnimatedSprite::setAlpha(float alpha) |