]> git.tdb.fi Git - libs/demoscene.git/blob - source/animate.h
Fix initialization issues in the Animate action
[libs/demoscene.git] / source / animate.h
1 #ifndef MSP_DEMOSCENE_ANIMATE_H_
2 #define MSP_DEMOSCENE_ANIMATE_H_
3
4 #include <msp/gl/animatedobject.h>
5 #include <msp/gl/animation.h>
6 #include <msp/gl/animationplayer.h>
7 #include "action.h"
8
9 namespace Msp {
10 namespace DemoScene {
11
12 class Animate: public Action
13 {
14 public:
15         class Loader: public Msp::DataFile::DerivedObjectLoader<Animate, Action::Loader>
16         {
17         public:
18                 Loader(Animate &, Demo &);
19
20         private:
21                 void animation(const std::string &);
22                 void target(const std::string &);
23         };
24
25 private:
26         Msp::GL::Placeable *target;
27         Msp::GL::AnimatedObject *target_obj;
28         const Msp::GL::Animation *anim;
29         bool stacked;
30         Msp::GL::AnimationPlayer *player;
31
32 public:
33         Animate();
34         Animate(Msp::GL::Placeable &, const Msp::GL::Animation &, Msp::GL::AnimationPlayer &, bool = false);
35
36         virtual void validate() const;
37
38         virtual void start(float, float);
39 };
40
41 } // namespace DemoScene
42 } // namespace Msp
43
44 #endif