mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-08 18:16:40 +00:00
Comments from Capo
This commit is contained in:
parent
afb9fa06d7
commit
85f104fefe
1 changed files with 8 additions and 16 deletions
|
|
@ -1857,30 +1857,22 @@ namespace MWMechanics
|
||||||
|
|
||||||
if (!mAnimation->isPlaying(mAnimQueue.front().mGroup))
|
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);
|
mAnimation->disable(mAnimQueue.front().mGroup);
|
||||||
mAnimQueue.pop_front();
|
mAnimQueue.pop_front();
|
||||||
|
}
|
||||||
|
|
||||||
bool loopfallback = mAnimQueue.front().mGroup.starts_with("idle");
|
if (!mAnimQueue.empty())
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
// A scripted animation stopped playing before time.
|
// Move on to the remaining items of the queue
|
||||||
// This happens when the animation object is rebuilt, so we should restart the animation here.
|
|
||||||
bool loopfallback = mAnimQueue.front().mGroup.starts_with("idle");
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue