| 33 | } |
| 34 | |
| 35 | bool ParticleDemo::Update(Ndk::StateMachine& /*fsm*/, float elapsedTime) |
| 36 | { |
| 37 | m_fpsCounter++; |
| 38 | if (m_updateClock.GetMilliseconds() > 1000) |
| 39 | { |
| 40 | m_updateClock.Restart(); |
| 41 | |
| 42 | m_shared.fpsCount->Update(Nz::SimpleTextDrawer::Draw(Nz::String::Number(m_fpsCounter) + " FPS", 24)); |
| 43 | m_fpsCounter = 0; |
| 44 | |
| 45 | unsigned int particleCount = 0; |
| 46 | for (const Ndk::EntityHandle& entity : m_particleGroups) |
| 47 | { |
| 48 | const Ndk::ParticleGroupComponent& group = entity->GetComponent<Ndk::ParticleGroupComponent>(); |
| 49 | particleCount += group.GetParticleCount(); |
| 50 | } |
| 51 | |
| 52 | m_shared.particleCount->Update(Nz::SimpleTextDrawer::Draw(Nz::String::Number(particleCount) + " particles", 36)); |
| 53 | } |
| 54 | |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | void ParticleDemo::RegisterEntity(const Ndk::EntityHandle& entity) |
| 59 | { |
no test coverage detected