mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Comments from Capo
This commit is contained in:
parent
afb9fa06d7
commit
85f104fefe
@ -1857,30 +1857,22 @@ namespace MWMechanics
|
||||
|
||||
if (!mAnimation->isPlaying(mAnimQueue.front().mGroup))
|
||||
{
|
||||
if (mAnimQueue.size() > 1)
|
||||
// Remove the finished animation, unless it's a scripted animation that was interrupted by e.g. a rebuild of
|
||||
// the animation object.
|
||||
if (mAnimQueue.size() > 1 || !mAnimQueue.front().mScripted || mAnimQueue.front().mLoopCount == 0)
|
||||
{
|
||||
// Curren animation finished, move to the next in queue
|
||||
mAnimation->disable(mAnimQueue.front().mGroup);
|
||||
mAnimQueue.pop_front();
|
||||
}
|
||||
|
||||
bool loopfallback = mAnimQueue.front().mGroup.starts_with("idle");
|
||||
mAnimation->play(mAnimQueue.front().mGroup, Priority_Default, MWRender::Animation::BlendMask_All, false,
|
||||
1.0f, "start", "stop", 0.0f, mAnimQueue.front().mLoopCount, loopfallback);
|
||||
}
|
||||
else if (mAnimQueue.front().mLoopCount > 0 && mAnimQueue.front().mScripted)
|
||||
if (!mAnimQueue.empty())
|
||||
{
|
||||
// A scripted animation stopped playing before time.
|
||||
// This happens when the animation object is rebuilt, so we should restart the animation here.
|
||||
// Move on to the remaining items of the queue
|
||||
bool loopfallback = mAnimQueue.front().mGroup.starts_with("idle");
|
||||
mAnimation->play(mAnimQueue.front().mGroup, Priority_Scripted, MWRender::Animation::BlendMask_All,
|
||||
mAnimation->play(mAnimQueue.front().mGroup, mAnimQueue.front().mScripted ? Priority_Scripted : Priority_Default,
|
||||
MWRender::Animation::BlendMask_All,
|
||||
false, 1.0f, "start", "stop", 0.0f, mAnimQueue.front().mLoopCount, loopfallback);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Animation is done, remove it from the queue.
|
||||
mAnimation->disable(mAnimQueue.front().mGroup);
|
||||
mAnimQueue.pop_front();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user