]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Animation.cc
better logging (maybe) and exception handling
[chaz/yoink] / src / Moof / Animation.cc
index 38ffa6c9c5e5c8ca9fdb83806e46f731d9bd274b..39dcb5a40a8b643a7e98958e293ecdcfc7b30ac4 100644 (file)
@@ -39,14 +39,14 @@ namespace Mf {
 
 /**
  * The collection of nested animation classes.  The animation implementation
- * consists of an AnimationImpl classes which is allocated and initialized with
- * the interface object.  This class contains the specific fields which are
- * required to run a single instance of an animation.  The sequence data is
- * loaded in a difference class which can be shared amongst multiple animation
- * implementation instances.
+ * consists of an Impl class which is allocated and initialized with the
+ * interface object.  This class contains the specific fields which are required
+ * to run a single instance of an animation.  The sequence data is loaded in a
+ * different class which can be shared amongst multiple animation implementation
+ * instances.
  */
 
-struct Animation::AnimationImpl
+struct Animation::Impl
 {
 
        /**
@@ -55,7 +55,7 @@ struct Animation::AnimationImpl
         * which wants to use these loaded sequences.
         */
 
-       struct AnimationData : public Mippleton<AnimationData>
+       struct GlobalData : public Mippleton<GlobalData>
        {
                /**
                 * A frame of an animation sequence.  A frame is merely an index which
@@ -182,7 +182,7 @@ struct Animation::AnimationImpl
 
                void loadFromFile()
                {
-                       std::string filePath = Animation::getPathToResource(getName());
+                       std::string filePath = Animation::getPath(getName());
 
                        Deserializer deserializer(filePath);
 
@@ -210,8 +210,8 @@ struct Animation::AnimationImpl
                 * registers itself as a mippleton and then loads the animation data.
                 */
 
-               explicit AnimationData(const std::string& name) :
-                       Mippleton<AnimationData>(name)
+               explicit GlobalData(const std::string& name) :
+                       Mippleton<GlobalData>(name)
                {
                        loadFromFile();
                }
@@ -224,8 +224,8 @@ struct Animation::AnimationImpl
         * Construction is intialization.
         */
 
-       AnimationImpl(const std::string& name) :
-               data(AnimationData::retain(name), &AnimationData::release),
+       Impl(const std::string& name) :
+               data(GlobalData::getInstance(name)),
                currentSequence(0),
                frameCounter(0),
                frameIndex(0),
@@ -241,7 +241,7 @@ struct Animation::AnimationImpl
 
        void startSequence(const std::string& name)
        {
-               std::map<std::string,AnimationData::Sequence>::iterator it;
+               std::map<std::string,GlobalData::Sequence>::iterator it;
 
                it = data->sequences.find(name);
 
@@ -299,9 +299,9 @@ struct Animation::AnimationImpl
                }
        }
 
-       boost::shared_ptr<AnimationData> data;                  ///< Internal data.
+       boost::shared_ptr<GlobalData> data;                     ///< Internal data.
 
-       AnimationData::Sequence*        currentSequence;        ///< Active sequence.
+       GlobalData::Sequence*   currentSequence;        ///< Active sequence.
        unsigned        frameCounter;                                           ///< Current frame.
        unsigned        frameIndex;                                                     ///< Index of current frame.
        Scalar          timeAccum;                                                      ///< Time accumulation.
@@ -311,7 +311,7 @@ struct Animation::AnimationImpl
 
 Animation::Animation(const std::string& name) :
        // pass through
-       impl_(new Animation::AnimationImpl(name)) {}
+       impl_(new Animation::Impl(name)) {}
 
 
 void Animation::startSequence(const std::string& name)
@@ -343,9 +343,9 @@ unsigned Animation::getFrame() const
  * "animations" subdirectory of any of the searched directories.
  */
 
-std::string Animation::getPathToResource(const std::string& name)
+std::string Animation::getPath(const std::string& name)
 {
-       return Resource::getPathToResource("animations/" + name + ".json");
+       return Resource::getPath("animations/" + name + ".json");
 }
 
 
This page took 0.021498 seconds and 4 git commands to generate.