]> git.lizzy.rs Git - minetest.git/blobdiff - src/client/gameui.cpp
Fix shadows for upright sprite nodes
[minetest.git] / src / client / gameui.cpp
index ecb8e0ec4a95c8d83473c072285970e246f449b6..8505ea3aef11df07d0f02f4f7c3eed9b3bd70ad9 100644 (file)
@@ -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)