X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fanimation.hh;h=ca565818d569b07442a88ebb28623880b080948d;hp=85307ac921d56f4409caf2d898e90f8c0c793f18;hb=7d15b919681bb9ec0088b4b27c6abf62d6dfb9b1;hpb=0fffd0097d7b496454413e57b398c903ecc252e4 diff --git a/src/animation.hh b/src/animation.hh index 85307ac..ca56581 100644 --- a/src/animation.hh +++ b/src/animation.hh @@ -34,26 +34,39 @@ * Motion picture!! */ +#include + #include +#include "resource.hh" +#include "math.hh" + namespace dc { -class animation_impl; +/** + * A class to manage frame-based animation. Animation sequences can be loaded + * from file, then named sequences are started. The animation is updated + * periodically (each update cycle), and the correct current frame is + * determined. This class is generic enough that a frame can mean just about + * anything to whatever drawing context is used to render the frame. + */ class animation : public resource { public: animation(const std::string& name); - void setSequence(const std::string& sequence); - bool isSequenceDone(); + void startSequence(const std::string& sequenceName); + + void update(scalar t, scalar dt); + unsigned getFrame() const; - void update(scalar dt); - unsigned getFrame(); + static std::string getPathToResource(const std::string& name); private: + class animation_impl; boost::shared_ptr impl; }; @@ -62,3 +75,5 @@ private: #endif // _ANIMATION_HH_ +/** vim: set ts=4 sw=4 tw=80: *************************************************/ +