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
commit b7b5458c79
3 changed files with 11 additions and 5 deletions

View File

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

View File

@ -15,6 +15,7 @@ namespace Ndk
{ {
RenderSystem::RenderSystem() RenderSystem::RenderSystem()
{ {
SetUpdateRate(0.f);
} }
void RenderSystem::OnEntityRemoved(Entity* entity) void RenderSystem::OnEntityRemoved(Entity* entity)

View File

@ -104,7 +104,8 @@ unsigned int NzBitset<Block, Allocator>::FindNext(unsigned int bit) const
{ {
NazaraAssert(bit < m_bitCount, "Bit index out of range"); NazaraAssert(bit < m_bitCount, "Bit index out of range");
bit++; if (++bit >= m_bitCount)
return npos;
// Le bloc du bit, l'indice du bit // Le bloc du bit, l'indice du bit
unsigned int blockIndex = GetBlockIndex(bit); unsigned int blockIndex = GetBlockIndex(bit);