]> git.localhorst.tv Git - l2e.git/blob - src/graphics/ComplexAnimation.h
renamed namespace geometry -> math
[l2e.git] / src / graphics / ComplexAnimation.h
1 #ifndef GRAPHICS_COMPLEXANIMATION_H_
2 #define GRAPHICS_COMPLEXANIMATION_H_
3
4 #include "Animation.h"
5
6 namespace graphics {
7
8 class ComplexAnimation
9 : public Animation {
10
11 public:
12         static const int TYPE_ID = 402;
13
14 public:
15         ComplexAnimation();
16         ComplexAnimation(const Sprite *sprite, int frameTime, bool repeat = false);
17
18 public:
19         struct FrameProp {
20                 static const int TYPE_ID = 403;
21                 FrameProp() : col(0), row(0) { }
22                 FrameProp(int col, int row, const math::Vector<int> &disposition)
23                 : col(col), row(row), disposition(disposition) {}
24                 int col;
25                 int row;
26                 math::Vector<int> disposition;
27         };
28         void SetFrames(const FrameProp *f, int num) { frames = f; numFrames = num; }
29
30         static void CreateTypeDescription();
31         static void Construct(void *);
32
33 protected:
34         virtual int NumFrames() const;
35         virtual int Col(int frame) const;
36         virtual int Row(int frame) const;
37         virtual math::Vector<int> Offset(int frame) const;
38
39 private:
40         const FrameProp *frames;
41         int numFrames;
42
43 };
44
45 }
46
47 #endif /* GRAPHICS_COMPLEXANIMATION_H_ */