From 41f80908d96697979409f61e75258b5635b841d8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 29 Sep 2012 01:10:49 -0700 Subject: [PATCH] Simplify getting the stop time when playing all animation groups --- apps/openmw/mwrender/animation.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index f7a175332..ef92497e5 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -87,17 +87,9 @@ void Animation::playGroup(std::string groupname, int mode, int loops) times.mStart = times.mLoopStart = 0.0f; times.mLoopStop = times.mStop = 0.0f; - if(mEntityList.mSkelBase) - { - Ogre::AnimationStateSet *aset = mEntityList.mSkelBase->getAllAnimationStates(); - Ogre::AnimationStateIterator as = aset->getAnimationStateIterator(); - while(as.hasMoreElements()) - { - Ogre::AnimationState *state = as.getNext(); - times.mLoopStop = times.mStop = state->getLength(); - break; - } - } + NifOgre::TextKeyMap::const_reverse_iterator iter = mTextKeys.rbegin(); + if(iter != mTextKeys.rend()) + times.mLoopStop = times.mStop = iter->first; } else if(!findGroupTimes(groupname, ×)) throw std::runtime_error("Failed to find animation group "+groupname);