]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animationplayer.h
Minor fixes to texture anisotropy handling
[libs/gl.git] / source / animationplayer.h
index 63e6e030d03aa68b30efa2a63aa169b077986402..4c6e9ceca50bbc2fc0c7beeb5f256658a81c7150 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <msp/time/timedelta.h>
 #include "animation.h"
+#include "animationeventobserver.h"
 #include "matrix.h"
 
 namespace Msp {
@@ -32,8 +33,11 @@ private:
                const Armature *armature;
                std::vector<PlayingAnimation> animations;
                bool stacked;
+               std::vector<AnimationEventObserver *> event_observers;
 
                Target(AnimatedObject &);
+
+               virtual void animation_event(AnimatedObject *, const std::string &, const Variant &);
        };
 
        typedef std::map<const AnimatedObject *, Target> ObjectMap;
@@ -54,6 +58,17 @@ public:
        /// Returns the number of animations currently affecting an object.
        unsigned get_n_active_animations(const AnimatedObject &) const;
 
+       /** Request delivery of animation events for the given object.  Events will
+       be delivered from all current and future animations until the observer is
+       removed. */
+       void observe_events(AnimatedObject &, AnimationEventObserver &);
+
+       /// Remove an event observer from one object.
+       void unobserve_events(AnimatedObject &, AnimationEventObserver &);
+
+       /// Remove an event observer from all objects.
+       void unobserve_events(AnimationEventObserver &);
+
        /// Stops all animations affecting an object.
        void stop(AnimatedObject &);
 
@@ -65,8 +80,8 @@ public:
        void tick(const Time::TimeDelta &);
 
 private:
-       bool tick_single(Target &, const Time::TimeDelta &);
-       bool tick_stacked(Target &, const Time::TimeDelta &);
+       void tick_single(Target &, const Time::TimeDelta &);
+       void tick_stacked(Target &, const Time::TimeDelta &);
        static void set_object_uniform(AnimatedObject &, const std::string &, const KeyFrame::AnimatedUniform &);
 };