fix timer thing, still *broken*
[exterlulz-musk.git] / src / musk / animation.h
blob13bc6041c6a6e34d8ad1be55882cab07caa64521
1 #ifndef MUSK_ANIMATION_H_
2 #define MUSK_ANIMATION_H_
4 #include "image.h"
6 #include <string>
7 #include <vector>
9 namespace musk {
11 class Animation : public Image
13 public:
14 // TODO: doc: duration is the duration of each frame (in ms)
15 Animation(const std::string& path,
16 size_t frames = 1, uint32_t durations = 250);
18 virtual int width() const;
20 uint32_t durationForFrame(size_t n) const;
22 void start();
23 void stop();
25 void reset();
26 void step(uint32_t ticks);
28 private:
29 size_t frames_;
30 std::vector<uint32_t> durations_;
31 bool stopped_;
33 size_t currentFrame_;
34 uint32_t currentTicks_;
36 int width_;
39 } // namespace musk
41 #endif // MUSK_ANIMATION_H_