mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +00:00
Simplify getting the stop time when playing all animation groups
This commit is contained in:
parent
cd8515396a
commit
41f80908d9
@ -87,17 +87,9 @@ void Animation::playGroup(std::string groupname, int mode, int loops)
|
|||||||
times.mStart = times.mLoopStart = 0.0f;
|
times.mStart = times.mLoopStart = 0.0f;
|
||||||
times.mLoopStop = times.mStop = 0.0f;
|
times.mLoopStop = times.mStop = 0.0f;
|
||||||
|
|
||||||
if(mEntityList.mSkelBase)
|
NifOgre::TextKeyMap::const_reverse_iterator iter = mTextKeys.rbegin();
|
||||||
{
|
if(iter != mTextKeys.rend())
|
||||||
Ogre::AnimationStateSet *aset = mEntityList.mSkelBase->getAllAnimationStates();
|
times.mLoopStop = times.mStop = iter->first;
|
||||||
Ogre::AnimationStateIterator as = aset->getAnimationStateIterator();
|
|
||||||
while(as.hasMoreElements())
|
|
||||||
{
|
|
||||||
Ogre::AnimationState *state = as.getNext();
|
|
||||||
times.mLoopStop = times.mStop = state->getLength();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(!findGroupTimes(groupname, ×))
|
else if(!findGroupTimes(groupname, ×))
|
||||||
throw std::runtime_error("Failed to find animation group "+groupname);
|
throw std::runtime_error("Failed to find animation group "+groupname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user