Merge remote-tracking branch 'origin/NDK' into NDK-ShadowMapping

Former-commit-id: 0c302477d672346eb50c12f8fa7e2b6a19d60779
This commit is contained in:
Lynix
2015-06-23 12:11:02 +02:00
3 changed files with 11 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ namespace Ndk
inline float BaseSystem::GetUpdateRate() const
{
return 1.f / m_updateRate;
return (m_updateRate > 0.f) ? 1.f / m_updateRate : 0.f;
}
inline World& BaseSystem::GetWorld() const
@@ -58,12 +58,16 @@ namespace Ndk
inline void BaseSystem::Update(float elapsedTime)
{
m_updateCounter -= elapsedTime;
if (m_updateCounter < 0.f)
if (m_updateRate > 0.f)
{
m_updateCounter -= elapsedTime;
if (m_updateCounter >= 0.f)
return;
m_updateCounter += m_updateRate;
OnUpdate(elapsedTime);
}
OnUpdate(elapsedTime);
}
template<typename ComponentType>