diff options
author | chai <chaifix@163.com> | 2018-12-06 00:14:52 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-06 00:14:52 +0800 |
commit | 17d86218e25a6c889c24822da8d7b59967babd89 (patch) | |
tree | 478996e0554639829a44f6d6eb84d79b8f466c1a /src/libjin/graphics/animations | |
parent | bffa68875803598210a974d11446ccf87dbf40a3 (diff) |
*animator
Diffstat (limited to 'src/libjin/graphics/animations')
-rw-r--r-- | src/libjin/graphics/animations/je_animator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libjin/graphics/animations/je_animator.cpp b/src/libjin/graphics/animations/je_animator.cpp index 449799d..1e25639 100644 --- a/src/libjin/graphics/animations/je_animator.cpp +++ b/src/libjin/graphics/animations/je_animator.cpp @@ -51,10 +51,10 @@ namespace JinEngine float interval = 1 / mSpeed; mTick += dt; uint fc = mAnimation->getFrameCount(); - while (mTick >= interval) + if (mTick >= interval) { - mTick -= interval; - ++mIndex; + mIndex += int(mTick / interval); + mTick = fmod(mTick, interval); if (mLoop) mIndex %= fc; mIndex = clamp<uint>(mIndex, 0, fc - 1); |