diff options
author | Chuck Miller <shadowmil@gmail.com> | 2009-05-03 17:11:25 -0400 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2009-05-03 17:11:25 -0400 |
commit | a93a723db62ba2ad445b0fff26be5c51aefcda78 (patch) | |
tree | 1d39966d58f3d1c8c948f4719d22146d2373df10 /src/simpleanimation.cpp | |
parent | 19bf50bbff325024c2ed9ad724aeb6acb39bae39 (diff) | |
download | mana-a93a723db62ba2ad445b0fff26be5c51aefcda78.tar.gz mana-a93a723db62ba2ad445b0fff26be5c51aefcda78.tar.bz2 mana-a93a723db62ba2ad445b0fff26be5c51aefcda78.tar.xz mana-a93a723db62ba2ad445b0fff26be5c51aefcda78.zip |
Added rotational particles, and added code to show arrows when a player shoots them.
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r-- | src/simpleanimation.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 65d8e8e2..7038f446 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -129,6 +129,16 @@ void SimpleAnimation::reset() mAnimationPhase = 0; } +void SimpleAnimation::setFrame(int frame) +{ + if (frame < 0) + frame = 0; + if (frame >= mAnimation->getLength()) + frame = mAnimation->getLength() - 1; + mAnimationPhase = frame; + mCurrentFrame = mAnimation->getFrame(mAnimationPhase); +} + void SimpleAnimation::update(unsigned int timePassed) { mAnimationTime += timePassed; @@ -145,6 +155,11 @@ void SimpleAnimation::update(unsigned int timePassed) } } +int SimpleAnimation::getLength() +{ + return mAnimation->getLength(); +} + Image *SimpleAnimation::getCurrentImage() const { return mCurrentFrame->image; |