]> git.localhorst.tv Git - l2e.git/blob - src/graphics/SimpleAnimation.h
7e5a99a9a2630b6e4ba7eadf59e1a993349a6940
[l2e.git] / src / graphics / SimpleAnimation.h
1 #ifndef GRAPHICS_SIMPLEANIMATION_H_
2 #define GRAPHICS_SIMPLEANIMATION_H_
3
4 #include "Animation.h"
5
6 namespace graphics {
7
8 class SimpleAnimation
9 : public Animation {
10
11 public:
12         static const int TYPE_ID = 408;
13
14 public:
15         SimpleAnimation();
16         SimpleAnimation(const Sprite *sprite, int frameTime, int numFrames,
17                         int col = 0, int row = 0, bool repeat = false);
18
19 public:
20         void SetNumFrames(int n) { numFrames = n; }
21         void SetCol(int c) { col = c; }
22         void SetRow(int r) { row = r; }
23
24         static void CreateTypeDescription();
25         static void Construct(void *);
26
27 protected:
28         virtual int NumFrames() const;
29         virtual int Col(int frame) const;
30         virtual int Row(int frame) const;
31
32 private:
33         int numFrames;
34         int col;
35         int row;
36
37 };
38
39 }
40
41 #endif