remove timer variable

This commit is contained in:
chmodsayshello 2024-04-28 10:08:39 +02:00
parent 98200bb771
commit 97f7a521f3
1 changed files with 3 additions and 8 deletions

View File

@ -1284,20 +1284,15 @@ void Game::shutdown()
FpsControl fps_control; FpsControl fps_control;
fps_control.reset(); fps_control.reset();
f32 timer = 0;
float percentage = 0; float percentage = 0;
while (stop_thread->isRunning()) { while (stop_thread->isRunning()) {
m_rendering_engine->run(); m_rendering_engine->run();
f32 dtime; f32 dtime;
fps_control.limit(device, &dtime); fps_control.limit(device, &dtime);
timer += dtime;
if(timer >= 0.1) { percentage += 5 * (dtime / 0.1);
timer = 0; if (percentage >= 100) {
percentage += 5; percentage = 0;
if (percentage > 100) {
percentage = 0;
}
} }
m_rendering_engine->draw_load_screen(utf8_to_wide(std::string(N_("Shutting down…"))) , guienv, texture_src, dtime, percentage); m_rendering_engine->draw_load_screen(utf8_to_wide(std::string(N_("Shutting down…"))) , guienv, texture_src, dtime, percentage);