From 25b210d5c54383bd7575bf3601e242340182ee5f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Oct 2013 17:14:25 +0300 Subject: remove from animatedsprite contructor virtual method call. --- src/animatedsprite.cpp | 9 +++++---- 1 file 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() -- cgit v1.2.3-70-g09d2