bunch of optimizations

This commit is contained in:
Eduardo Bart
2012-03-20 12:17:10 -03:00
parent 3cd31bcd1e
commit b4261a8c7b
37 changed files with 164 additions and 123 deletions

View File

@@ -70,7 +70,7 @@ void ParticleSystem::render()
void ParticleSystem::update()
{
static const double delay = 0.0166; // 60 updates/s
static const float delay = 0.0166; // 60 updates/s
// check if finished
if(m_particles.empty() && m_emitters.empty()) {
@@ -79,7 +79,7 @@ void ParticleSystem::update()
}
// check time
double elapsedTime = g_clock.timeElapsed(m_lastUpdateTime);
float elapsedTime = g_clock.timeElapsed(m_lastUpdateTime);
if(elapsedTime < delay)
return;
m_lastUpdateTime = g_clock.time() - std::fmod(elapsedTime, delay);