diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-17 17:14:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-17 21:17:11 +0300 |
commit | 25b210d5c54383bd7575bf3601e242340182ee5f (patch) | |
tree | 0bff5cdf6e45d50e1c85744315e129bdaef7ec4f /src | |
parent | 7889fb609aa6b8b4bbe1345c7888ace1a0f1e54c (diff) | |
download | plus-25b210d5c54383bd7575bf3601e242340182ee5f.tar.gz plus-25b210d5c54383bd7575bf3601e242340182ee5f.tar.bz2 plus-25b210d5c54383bd7575bf3601e242340182ee5f.tar.xz plus-25b210d5c54383bd7575bf3601e242340182ee5f.zip |
remove from animatedsprite contructor virtual method call.
Diffstat (limited to 'src')
-rw-r--r-- | src/animatedsprite.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index abb4ea96f..456dc9c70 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -54,9 +54,6 @@ AnimatedSprite::AnimatedSprite(SpriteDef *const sprite): // Take possession of the sprite if (mSprite) mSprite->incRef(); - - // Play the stand animation by default - play(SpriteAction::STAND); } AnimatedSprite *AnimatedSprite::load(const std::string &filename, @@ -67,6 +64,7 @@ AnimatedSprite *AnimatedSprite::load(const std::string &filename, if (!s) return nullptr; AnimatedSprite *const as = new AnimatedSprite(s); + as->play(SpriteAction::STAND); s->decRef(); return as; } @@ -85,6 +83,7 @@ AnimatedSprite *AnimatedSprite::delayedLoad(const std::string &filename, } AnimatedSprite *const as = new AnimatedSprite(nullptr); + as->play(SpriteAction::STAND); as->setDelayLoad(filename, variant); return as; } @@ -93,7 +92,9 @@ AnimatedSprite *AnimatedSprite::clone(const AnimatedSprite *const anim) { if (!anim) return nullptr; - return new AnimatedSprite(anim->mSprite); + AnimatedSprite *const sprite = new AnimatedSprite(anim->mSprite); + sprite->play(SpriteAction::STAND); + return sprite; } AnimatedSprite::~AnimatedSprite() |