From d122f24c1af429dd59a0051db01650fd2b1abbba Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Wed, 29 Jun 2011 01:53:17 +0000 Subject: BGE Animations: Fixing a bug with priority and non continuous animations. --- source/gameengine/Ketsji/BL_Action.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/gameengine/Ketsji/BL_Action.cpp') diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index 1741e74a771..149189b6a79 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -104,7 +104,7 @@ BL_Action::~BL_Action() delete m_ptrrna; } -void BL_Action::Play(const char* name, +bool BL_Action::Play(const char* name, float start, float end, short priority, @@ -118,7 +118,7 @@ void BL_Action::Play(const char* name, // Only start playing a new action if we're done, or if // the new action has a higher priority if (priority != 0 && !IsDone() && priority >= m_priority) - return; + return false; m_priority = priority; bAction* prev_action = m_action; @@ -128,7 +128,7 @@ void BL_Action::Play(const char* name, { printf("Failed to load action: %s\n", name); m_done = true; - return; + return false; } if (prev_action != m_action) @@ -178,6 +178,8 @@ void BL_Action::Play(const char* name, m_speed = playback_speed; m_done = false; + + return true; } void BL_Action::Stop() @@ -329,6 +331,9 @@ void BL_Action::Update(float curtime) game_blend_poses(m_pose, m_blendpose, weight); } + + // Handle layer blending + obj->SetPose(m_pose); obj->SetActiveAction(NULL, 0, curtime); -- cgit v1.2.3