diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-30 03:53:21 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-30 03:53:21 +0400 |
commit | ae483e0cd2e9cafac08b26c917687b74c6d4a661 (patch) | |
tree | b0d7dd75e644abbbfbdf4bad65c912d944339d9f /source/gameengine | |
parent | 0690f6287cce55bd3dc094c7b9723c8ace4e4128 (diff) |
BGE: When using the "Restrict Animation Updates" option, animations are now truly frame rate independent. Thanks to vrav for reporting the issue in IRC.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 940f8e5c6fe..a560b606f5b 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -784,21 +784,21 @@ else // Handle the animations independently of the logic time step if (GetRestrictAnimationFPS()) { - m_logger->StartLog(tc_animations, m_kxsystem->GetTimeInSeconds(), true); + double clocktime = m_kxsystem->GetTimeInSeconds(); + m_logger->StartLog(tc_animations, clocktime, true); SG_SetActiveStage(SG_STAGE_ANIMATION_UPDATE); double anim_timestep = 1.0/KX_GetActiveScene()->GetAnimationFPS(); - if (m_clockTime - m_previousAnimTime > anim_timestep) + if (clocktime - m_previousAnimTime > anim_timestep) { // Sanity/debug print to make sure we're actually going at the fps we want (should be close to anim_timestep) // printf("Anim fps: %f\n", 1.0/(m_clockTime - m_previousAnimTime)); - m_previousAnimTime = m_clockTime; + m_previousAnimTime = clocktime; for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit) { - (*sceneit)->UpdateAnimations(m_frameTime); + (*sceneit)->UpdateAnimations(clocktime); } } - m_previousClockTime = m_clockTime; } // Start logging time spend outside main loop |