]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Skeleton.cpp
Cleanup animation loading
[lugaru.git] / Source / Skeleton.cpp
index 878bcbe13511cc6ec54d317c146abe447246c94a..2959e8157ab33281b0a96369c0fc8cdff5e67a15 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Game.h"
 #include "Skeleton.h"
 #include "openal_wrapper.h"
+#include "Animation.h"
 
 extern float multiplier;
 extern float gravity;
@@ -1007,17 +1008,24 @@ void Skeleton::FindRotationMuscle(int which, int animation)
        if(!isnormal(muscles[which].rotate3))muscles[which].rotate3=0;
 }
 
-void Animation::Load(char *filename, int aheight, int aattack)
+void Animation::Load(const char *filename, int aheight, int aattack)
 {
        static FILE *tfile;
        static int i,j;
        static XYZ startoffset,endoffset;
        static int howmany;
 
+       static const char *anim_prefix = ":Data:Animations:";
+
+
        LOGFUNC;
 
+       int len = strlen(anim_prefix) + strlen(filename);
+       char *buf = new char[len + 1];
+       snprintf(buf, len + 1, "%s%s", anim_prefix, filename);
        // Changing the filename into something the OS can understand
-       char *fixedFN = ConvertFileName(filename);
+       char *fixedFN = ConvertFileName(buf);
+       delete[] buf;
 
        LOG(std::string("Loading animation...") + fixedFN);