Revision: 39200
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39200
Author:   moguri
Date:     2011-08-09 03:06:22 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
BGE Animations: Fixing the Continue option when using the Flipper play type. 
Also removing a couple of debug prints.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionActuator.cpp
    branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp

Modified: 
branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionActuator.cpp
===================================================================
--- branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionActuator.cpp  
2011-08-08 21:28:51 UTC (rev 39199)
+++ branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionActuator.cpp  
2011-08-09 03:06:22 UTC (rev 39200)
@@ -174,8 +174,10 @@
                start = end = prop->GetNumber();
        }
 
-       // Continue only really makes sense for play stop. All other modes go 
until they are complete.
-       if (m_flag & ACT_FLAG_CONTINUE && m_playtype == ACT_ACTION_LOOP_STOP)
+       // 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))
                use_continue = true;
        
        
@@ -189,6 +191,9 @@
        
        if (bPositiveEvent)
        {
+               if (use_continue && m_flag & ACT_FLAG_ACTIVE)
+                       start = m_localtime = obj->GetActionFrame(m_layer);
+
                if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, 
m_priority, m_blendin, play_mode, m_layer_weight, m_ipo_flags))
                {
                        m_flag |= ACT_FLAG_ACTIVE;
@@ -215,11 +220,13 @@
                        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;
+
                if (m_playtype == ACT_ACTION_LOOP_STOP)
                {
-                       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;
                        obj->StopAction(m_layer); // Stop the action after 
getting the frame
 
                        // We're done

Modified: branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp
===================================================================
--- branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp     
2011-08-08 21:28:51 UTC (rev 39199)
+++ branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp     
2011-08-09 03:06:22 UTC (rev 39200)
@@ -252,9 +252,7 @@
        float dt = m_localtime - m_startframe;
 
        m_starttime = curtime - dt / 
(KX_KetsjiEngine::GetAnimFrameRate()*m_speed);
-       printf("Before: %f, ", m_localtime);
        SetLocalTime(curtime);
-       printf("After: %f\n", m_localtime);
 }
 
 void BL_Action::IncrementBlending(float curtime)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to