* 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;
};
#endif // _ANIMATION_HH_
+/** vim: set ts=4 sw=4 tw=80: *************************************************/
+