void Animation::add_keyframe(const Time::TimeDelta &t, const RefPtr<const KeyFrame> &kf, float ss, float es)
{
+ if(keyframes.empty() && t!=Time::zero)
+ throw invalid_argument("Animation::add_keyframe");
if(!keyframes.empty() && t<keyframes.back().time)
throw invalid_argument("Animation::add_keyframe");
events.push_back(event);
}
+const Time::TimeDelta &Animation::get_duration() const
+{
+ if(keyframes.empty())
+ return Time::zero;
+
+ return keyframes.back().time;
+}
+
void Animation::set_looping(bool l)
{
looping = l;