X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.cpp;h=e82a92a87ce4811b3e465b345e6f5477d1c61f27;hp=b58a4ea77e0e0c3193c2eec31074aa91912b72c7;hb=9319f1c8ed99866966f20fbab952da673af2257e;hpb=bfeb6c6404659fffb1222e084b0bd08cccb4e67d diff --git a/source/animation.cpp b/source/animation.cpp index b58a4ea7..e82a92a8 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -61,6 +61,8 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const KeyFrame &kf, float void Animation::add_keyframe(const Time::TimeDelta &t, const RefPtr &kf, float ss, float es) { + if(keyframes.empty() && t!=Time::zero) + throw invalid_argument("Animation::add_keyframe"); if(!keyframes.empty() && t1) + if(keyframes.size()>1 && t>(&tkf-1)->time) tkf.prev = &tkf-1; prepare_keyframe(tkf); @@ -270,7 +273,10 @@ Animation::Iterator::Iterator(const Animation &a): event_iter(animation->events.begin()), x(0), end(false) -{ } +{ + if(iter==animation->keyframes.end()) + throw invalid_argument("Animation::Iterator::Iterator"); +} Animation::Iterator &Animation::Iterator::operator+=(const Time::TimeDelta &t) {