X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.cpp;h=e82a92a87ce4811b3e465b345e6f5477d1c61f27;hp=02a2d371c71c1d32baff99aa3a120429d8c90d91;hb=9319f1c8ed99866966f20fbab952da673af2257e;hpb=8d8b80f3c1511b37f030d897ad97b92993a03ca2 diff --git a/source/animation.cpp b/source/animation.cpp index 02a2d371..e82a92a8 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -78,9 +78,10 @@ void Animation::add_keyframe(const Time::TimeDelta &t, const RefPtr1) + if(keyframes.size()>1 && t>(&tkf-1)->time) tkf.prev = &tkf-1; prepare_keyframe(tkf); @@ -272,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) {