From 98c10803f79ce9decb4a431719e18bb27aac4485 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Jun 2012 20:06:08 +0300 Subject: Improve a bit animation speed. --- src/resources/animation.h | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'src/resources/animation.h') diff --git a/src/resources/animation.h b/src/resources/animation.h index 1d23b1608..ffa717f8c 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -58,6 +58,10 @@ struct Frame */ class Animation { + friend class AnimatedSprite; + friend class ParticleEmitter; + friend class SimpleAnimation; + public: Animation(); @@ -73,29 +77,11 @@ class Animation */ void addTerminator(int rand); - /** - * Returns the frame at the specified index. - */ - Frame *getFrame(int index) - { return &(mFrames[index]); } - /** * Returns the length of this animation in frames. */ - unsigned int getLength() const - { return static_cast(mFrames.size()); } - - /** - * Check for empty animation. - */ - bool empty() const - { return mFrames.empty(); } - - /** - * Returns the duration of this animation. - */ - int getDuration() const - { return mDuration; } + size_t getLength() const + { return mFrames.size(); } void addJump(std::string name, int rand); @@ -113,6 +99,7 @@ class Animation static bool isTerminator(const Frame &phase); protected: + typedef std::vector Frames; typedef Frames::iterator FramesIter; typedef Frames::reverse_iterator FramesRevIter; -- cgit v1.2.3-60-g2f50