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