X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FAnimation.cc;h=39dcb5a40a8b643a7e98958e293ecdcfc7b30ac4;hp=38ffa6c9c5e5c8ca9fdb83806e46f731d9bd274b;hb=5fa5f117f28922a7e539a432367960c1a61f837d;hpb=493ddb59a8620b49dfa0ff62ce93395ebfd02e86 diff --git a/src/Moof/Animation.cc b/src/Moof/Animation.cc index 38ffa6c..39dcb5a 100644 --- a/src/Moof/Animation.cc +++ b/src/Moof/Animation.cc @@ -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 + struct GlobalData : public Mippleton { /** * 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(name) + explicit GlobalData(const std::string& name) : + Mippleton(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::iterator it; + std::map::iterator it; it = data->sequences.find(name); @@ -299,9 +299,9 @@ struct Animation::AnimationImpl } } - boost::shared_ptr data; ///< Internal data. + boost::shared_ptr 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"); }