X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation%2Fanimation.cpp;h=b62f5dd9c74e035ed7fe0ab39ef69c46b3cbf714;hp=a8d9e9698625b027997586745cd71b9c73c1d305;hb=3ac3a51c623271da815c8ee60c484445871753bf;hpb=885b8ad08cfcefba4b95ec9028fa1e25df2fe171 diff --git a/source/animation/animation.cpp b/source/animation/animation.cpp index a8d9e969..b62f5dd9 100644 --- a/source/animation/animation.cpp +++ b/source/animation/animation.cpp @@ -1,7 +1,9 @@ #include #include #include +#include #include +#include #include "animation.h" #include "animationeventobserver.h" #include "armature.h" @@ -20,6 +22,9 @@ Animation::Animation(): Animation::~Animation() { + for(vector::iterator i=keyframes.begin(); i!=keyframes.end(); ++i) + if(i->owned) + delete i->keyframe; for(vector::iterator i=curves.begin(); i!=curves.end(); ++i) delete *i; } @@ -155,9 +160,8 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame *kf, bool TimedKeyFrame tkf; tkf.time = t; tkf.keyframe = kf; - if(!owned) - tkf.keyframe.keep(); tkf.control = c; + tkf.owned = owned; keyframes.push_back(tkf); @@ -553,7 +557,11 @@ void Animation::Loader::load_kf_inline(bool c) { RefPtr kf = new KeyFrame; if(coll) - load_sub(*kf, get_collection()); + { + KeyFrame::Loader ldr(*kf, get_collection()); + ldr.set_inline_base_name(format("%s/%d.kframe", FS::basename(get_source()), obj.keyframes.size())); + load_sub_with(ldr); + } else load_sub(*kf);