X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.cpp;h=1cfb533f94eb3cd901ecba9dc501d28433224a15;hp=f0e2630a502f6f43339ef7cbd1be8bcbe3aed7a3;hb=ae161d1081b42be523aecb72dfe209d6aee6f770;hpb=332352298ef41b8ac3a4c57b467dd146c0b05e0b diff --git a/source/animation.cpp b/source/animation.cpp index f0e2630a..1cfb533f 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() && tevents.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) {