summaryrefslogtreecommitdiff
path: root/src/resources/animation.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-03 20:06:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-03 20:18:49 +0300
commit98c10803f79ce9decb4a431719e18bb27aac4485 (patch)
treecbe6325a1e2deafe38170565a0c1d9c3f5cb7faa /src/resources/animation.h
parent57a81ed6cf1c02d7ec8bfe1e6f0a1d3232309534 (diff)
downloadmv-98c10803f79ce9decb4a431719e18bb27aac4485.tar.gz
mv-98c10803f79ce9decb4a431719e18bb27aac4485.tar.bz2
mv-98c10803f79ce9decb4a431719e18bb27aac4485.tar.xz
mv-98c10803f79ce9decb4a431719e18bb27aac4485.zip
Improve a bit animation speed.
Diffstat (limited to 'src/resources/animation.h')
-rw-r--r--src/resources/animation.h27
1 files changed, 7 insertions, 20 deletions
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();
@@ -74,28 +78,10 @@ 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<unsigned>(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<Frame> Frames;
typedef Frames::iterator FramesIter;
typedef Frames::reverse_iterator FramesRevIter;