summaryrefslogtreecommitdiff
path: root/src/resources/sprite/animatedsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-30 17:51:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-30 17:51:46 +0300
commit88efa77af94256992ba2c05f4d7b5b5a9d01d6e9 (patch)
treec0a4f3c7f7ab1f0afaf54bcfc993c0b183c1989b /src/resources/sprite/animatedsprite.cpp
parentc92ceeaa5e82bd5e237ca1fc4a3798fb61b81cfd (diff)
downloadplus-88efa77af94256992ba2c05f4d7b5b5a9d01d6e9.tar.gz
plus-88efa77af94256992ba2c05f4d7b5b5a9d01d6e9.tar.bz2
plus-88efa77af94256992ba2c05f4d7b5b5a9d01d6e9.tar.xz
plus-88efa77af94256992ba2c05f4d7b5b5a9d01d6e9.zip
Add debug flag for debugging animated sprites.
Diffstat (limited to 'src/resources/sprite/animatedsprite.cpp')
-rw-r--r--src/resources/sprite/animatedsprite.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 98d4b418d..43c11497a 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -70,6 +70,9 @@ AnimatedSprite *AnimatedSprite::load(const std::string &restrict filename,
if (!s)
return nullptr;
AnimatedSprite *restrict const as = new AnimatedSprite(s);
+#ifdef DEBUG_ANIMATIONS
+ as->setSpriteName(filename);
+#endif
as->play(SpriteAction::STAND);
s->decRef();
return as;
@@ -90,6 +93,9 @@ AnimatedSprite *AnimatedSprite::delayedLoad(const std::string &restrict
}
AnimatedSprite *restrict const as = new AnimatedSprite(nullptr);
+#ifdef DEBUG_ANIMATIONS
+ as->setSpriteName(filename);
+#endif
as->play(SpriteAction::STAND);
as->setDelayLoad(filename, variant);
return as;
@@ -101,6 +107,9 @@ AnimatedSprite *AnimatedSprite::clone(const AnimatedSprite *restrict const
if (!anim)
return nullptr;
AnimatedSprite *restrict const sprite = new AnimatedSprite(anim->mSprite);
+#ifdef DEBUG_ANIMATIONS
+ sprite->setSpriteName(anim->getSpriteName());
+#endif
sprite->play(SpriteAction::STAND);
return sprite;
}