]> Dogcows Code - chaz/yoink/blobdiff - src/Animation.cc
prep for runloop code
[chaz/yoink] / src / Animation.cc
index ba34bc5d9f95cae0bc86fa0aba1242cf73cf4626..a9710ce66b525e0536789394ca014b5323a89b2f 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <moof/manager.hh>
 #include <moof/log.hh>
+#include <moof/resource.hh>
 #include <moof/script.hh>
 
 #include "Animation.hh"
@@ -137,13 +138,8 @@ public:
                void init(const std::string& name)
                {
                        moof::script script;
-                       std::string path(name);
+                       std::string path = moof::resource::find_file("animations/"+name, "lua");
                        
-                       if (!Animation::find_path(path))
-                       {
-                               throw std::runtime_error("cannot find resource " + name);
-                       }
-
                        script.import_base_library();
                        moof::log::import(script);
                        importAnimationBindings(script);
@@ -214,7 +210,6 @@ public:
                std::map<std::string,Data::Sequence>::iterator it;
 
                it = mData->mSequences.find(name);
-
                if (it != mData->mSequences.end())
                {
                        mCurrentSequence = &(*it).second;
@@ -306,14 +301,3 @@ unsigned Animation::getFrame() const
        return impl_->mFrameIndex;
 }
 
-
-/**
- * Specialized search location for animation files.  They can be found in
- * the "animations" subdirectory of any of the search directories.
- */
-
-bool Animation::find_path(std::string& name)
-{
-       return moof::resource::find_path(name, "animations/", "lua");
-}
-
This page took 0.017694 seconds and 4 git commands to generate.