summaryrefslogtreecommitdiff
path: root/src/resources/sprite
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-29 02:03:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-29 02:03:14 +0300
commit04b9930189da220c8135a2e3e6768e28a9d376e3 (patch)
tree1da0f06be11534bfa3d3be28cb707e704425a009 /src/resources/sprite
parent427e97031a188a2830c6d15b2befa7664adfec41 (diff)
downloadManaVerse-04b9930189da220c8135a2e3e6768e28a9d376e3.tar.gz
ManaVerse-04b9930189da220c8135a2e3e6768e28a9d376e3.tar.bz2
ManaVerse-04b9930189da220c8135a2e3e6768e28a9d376e3.tar.xz
ManaVerse-04b9930189da220c8135a2e3e6768e28a9d376e3.zip
Add A_UNLIKELY into AnimatedSprite::update.
Diffstat (limited to 'src/resources/sprite')
-rw-r--r--src/resources/sprite/animatedsprite.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 25c6d0e74..4ec3dedb1 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -187,7 +187,7 @@ bool AnimatedSprite::play(const std::string &restrict spriteAction) restrict2
bool AnimatedSprite::update(const int time) restrict2
{
// Avoid freaking out at first frame or when tick_time overflows
- if (time < mLastTime || mLastTime == 0)
+ if (A_UNLIKELY(time < mLastTime || mLastTime == 0))
mLastTime = time;
// If not enough time has passed yet, do nothing
@@ -200,7 +200,7 @@ bool AnimatedSprite::update(const int time) restrict2
const Animation *restrict const animation = mAnimation;
const Frame *restrict const frame = mFrame;
- if (!updateCurrentAnimation(dt))
+ if (A_UNLIKELY(!updateCurrentAnimation(dt)))
{
// Animation finished, reset to default
play(SpriteAction::STAND);