X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fgameui.cpp;h=8505ea3aef11df07d0f02f4f7c3eed9b3bd70ad9;hb=8f652f4e31e865c856dd45f9f7fc43e99fcc0f1c;hp=ecb8e0ec4a95c8d83473c072285970e246f449b6;hpb=e79d6154fc26b2a9bac242f0ac01ec785b5c53b1;p=minetest.git diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp index ecb8e0ec4..8505ea3ae 100644 --- a/src/client/gameui.cpp +++ b/src/client/gameui.cpp @@ -104,16 +104,16 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ // Minimal debug text must only contain info that can't give a gameplay advantage if (m_flags.show_minimal_debug) { - static float drawtime_avg = 0; - drawtime_avg = drawtime_avg * 0.95 + stats.drawtime * 0.05; - u16 fps = 1.0 / stats.dtime_jitter.avg; + const u16 fps = 1.0 / stats.dtime_jitter.avg; + m_drawtime_avg *= 0.95f; + m_drawtime_avg += 0.05f * (stats.drawtime / 1000); std::ostringstream os(std::ios_base::binary); os << std::fixed << PROJECT_NAME_C " " << g_version_hash << " | FPS: " << fps << std::setprecision(0) - << " | drawtime: " << drawtime_avg << "ms" + << " | drawtime: " << m_drawtime_avg << "ms" << std::setprecision(1) << " | dtime jitter: " << (stats.dtime_jitter.max_fraction * 100.0) << "%" @@ -210,7 +210,6 @@ void GameUI::initFlags() { m_flags = GameUI::Flags(); m_flags.show_minimal_debug = g_settings->getBool("show_debug"); - m_flags.show_basic_debug = false; } void GameUI::showMinimap(bool show)