X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation.cpp;h=b58a4ea77e0e0c3193c2eec31074aa91912b72c7;hp=f0e2630a502f6f43339ef7cbd1be8bcbe3aed7a3;hb=bfeb6c6404659fffb1222e084b0bd08cccb4e67d;hpb=42c1534d95e1551c37e64a1dae288e8b75e8d8ba diff --git a/source/animation.cpp b/source/animation.cpp index f0e2630a..b58a4ea7 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -114,6 +114,14 @@ void Animation::add_event(const Time::TimeDelta &t, const string &n, const Varia 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;