]> Dogcows Code - chaz/yoink/blob - src/Animation.hh
bugfix: resource file searching was broken
[chaz/yoink] / src / Animation.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _ANIMATION_HH_
13 #define _ANIMATION_HH_
14
15 /**
16 * @file Animation.hh
17 * Motion picture!!
18 */
19
20 #include <string>
21
22 #include <boost/shared_ptr.hpp>
23
24 #include <Moof/Math.hh>
25 #include <Moof/Resource.hh>
26
27
28 class Animation;
29 typedef boost::shared_ptr<Animation> AnimationP;
30
31 /**
32 * A class to manage frame-based animation. Animation sequences can be
33 * loaded from file, then named sequences are started. The animation is
34 * updated periodically (each update cycle), and the correct current frame
35 * is determined. This class is generic enough that a frame can mean just
36 * about anything to whatever drawing context is used to render the frame.
37 */
38
39 class Animation : public Mf::Resource
40 {
41 class Impl;
42 boost::shared_ptr<Impl> mImpl;
43
44 public:
45
46 Animation(const std::string& name);
47
48 static AnimationP alloc(const std::string& name)
49 {
50 return AnimationP(new Animation(name));
51 }
52
53
54 void startSequence(const std::string& name);
55
56 void update(Mf::Scalar t, Mf::Scalar dt);
57 unsigned getFrame() const;
58
59 static bool getPath(std::string& name);
60 };
61
62
63 #endif // _ANIMATION_HH_
64
This page took 0.032548 seconds and 4 git commands to generate.