]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Animation.h
added animation synchronization function
[l2e.git] / src / graphics / Animation.h
index 79bfa852b887f02316afad317a5bfdd912348eb5..a224f548590c4af16edad31b32c1ab596881df3d 100644 (file)
@@ -10,7 +10,7 @@ namespace loader {
 }
 
 #include "../app/Timer.h"
-#include "../geometry/Vector.h"
+#include "../math/Vector.h"
 
 #include <memory>
 #include <SDL.h>
@@ -45,7 +45,7 @@ public:
        virtual int NumFrames() const = 0;
        virtual int Col(int frame) const = 0;
        virtual int Row(int frame) const = 0;
-       virtual geometry::Vector<int> Offset(int frame) const { return geometry::Vector<int>(); }
+       virtual math::Vector<int> Offset(int frame) const { return math::Vector<int>(); }
 
        static void CreateTypeDescription();
 
@@ -72,6 +72,7 @@ public:
 
        void Start(app::State &ctrl);
        void Start(app::Application &ctrl);
+       void Synchronize(const AnimationRunner &other) { timer = other.timer; }
        void Stop();
        bool Started() const;
        bool Running() const;
@@ -93,10 +94,10 @@ public:
        void ChangeSprite(const Sprite *s) { sprite = s; }
        const Sprite *GetSprite() const { return sprite ? sprite : animation->GetSprite(); }
 
-       void Draw(SDL_Surface *dest, geometry::Vector<int> position) const;
-       void DrawTopRight(SDL_Surface *dest, geometry::Vector<int> position) const;
-       void DrawCenter(SDL_Surface *dest, geometry::Vector<int> position) const;
-       void DrawCenterBottom(SDL_Surface *dest, geometry::Vector<int> position) const;
+       void Draw(SDL_Surface *dest, math::Vector<int> position) const;
+       void DrawTopRight(SDL_Surface *dest, math::Vector<int> position) const;
+       void DrawCenter(SDL_Surface *dest, math::Vector<int> position) const;
+       void DrawCenterBottom(SDL_Surface *dest, math::Vector<int> position) const;
 
        int Frame() const;
 
@@ -112,4 +113,4 @@ private:
 
 }
 
-#endif /* GRAPHICS_SIMPLEANIMATION_H_ */
+#endif