diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-09-25 11:03:20 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-09-25 11:03:20 +0400 |
commit | 58a74bc87faf30b036d3088b8f741b353296b6a4 (patch) | |
tree | 6f3cfc12d95d96f046bbdd8efdf4a2a095f6ece2 /source/gameengine/Converter | |
parent | 0f21ecdb166d73e0b4786cd9eb625f901d48c1bb (diff) |
BGE Animations: Fixing various Action Actuator compatibility issues reported by Dalai in issue #28723.
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 895def17e8e..557b4aa7f11 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -226,10 +226,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) break; } - // Continue only really makes sense for play stop and flipper. All other modes go until they are complete. - if (m_flag & ACT_FLAG_CONTINUE && - (m_playtype == ACT_ACTION_LOOP_STOP || - m_playtype == ACT_ACTION_FLIPPER)) + if (m_flag & ACT_FLAG_CONTINUE) bUseContinue = true; @@ -244,12 +241,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame) if (m_flag & ACT_FLAG_ATTEMPT_PLAY) SetLocalTime(curtime); - if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE)) - { - m_localtime = obj->GetActionFrame(m_layer); - ResetStartTime(curtime); - } - // Handle a frame property if it's defined if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0) { @@ -264,22 +255,25 @@ bool BL_ActionActuator::Update(double curtime, bool frame) } // Handle a finished animation - if ((m_flag & ACT_FLAG_PLAY_END) && obj->IsActionDone(m_layer)) + if ((m_flag & ACT_FLAG_PLAY_END) && (m_flag & ACT_FLAG_ACTIVE) && obj->IsActionDone(m_layer)) { m_flag &= ~ACT_FLAG_ACTIVE; m_flag &= ~ACT_FLAG_ATTEMPT_PLAY; - obj->StopAction(m_layer); return false; } // If a different action is playing, we've been overruled and are no longer active - if (obj->GetCurrentAction(m_layer) != m_action) + if (obj->GetCurrentAction(m_layer) != m_action && !obj->IsActionDone(m_layer)) m_flag &= ~ACT_FLAG_ACTIVE; if (bPositiveEvent || (m_flag & ACT_FLAG_ATTEMPT_PLAY && !(m_flag & ACT_FLAG_ACTIVE))) { if (bPositiveEvent) + { + if (obj->IsActionDone(m_layer)) + m_localtime = start; ResetStartTime(curtime); + } if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, m_priority, m_blendin, playtype, m_layer_weight, m_ipo_flags)) { @@ -307,11 +301,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return false; } - - m_localtime = obj->GetActionFrame(m_layer); - if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe)) - m_localtime = m_startframe; - switch(m_playtype) { case ACT_ACTION_LOOP_STOP: @@ -340,6 +329,12 @@ bool BL_ActionActuator::Update(double curtime, bool frame) break; } } + + if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE)) + { + m_localtime = obj->GetActionFrame(m_layer); + ResetStartTime(curtime); + } return true; } |