]> Dogcows Code - chaz/yoink/blobdiff - src/animation.hh
big batch of progress
[chaz/yoink] / src / animation.hh
index 85307ac921d56f4409caf2d898e90f8c0c793f18..ca565818d569b07442a88ebb28623880b080948d 100644 (file)
  * Motion picture!!
  */
 
+#include <string>
+
 #include <boost/shared_ptr.hpp>
 
+#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<animation_impl> impl;
 };
 
@@ -62,3 +75,5 @@ private:
 
 #endif // _ANIMATION_HH_
 
+/** vim: set ts=4 sw=4 tw=80: *************************************************/
+
This page took 0.019329 seconds and 4 git commands to generate.