diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-12-25 03:52:42 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-12-25 03:52:44 +0100 |
commit | 4b31a38ae9b2d2019ddf75d09c1fdfd67f512067 (patch) | |
tree | 0365ed25166f68a1b6933ffef78d087a9527e4d5 /src | |
parent | bf9f50bc0eff2e9231c55a2bfd5f97c27e6de4dd (diff) | |
download | minetest-4b31a38ae9b2d2019ddf75d09c1fdfd67f512067.tar.gz minetest-4b31a38ae9b2d2019ddf75d09c1fdfd67f512067.tar.bz2 minetest-4b31a38ae9b2d2019ddf75d09c1fdfd67f512067.zip |
Remove FPS from window title
This doubles performance on some window managers (WTF?!)
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/game.cpp b/src/game.cpp index 8cf7da1e1..33668fb44 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1479,6 +1479,11 @@ void the_game( bool use_weather = g_settings->getBool("weather"); + core::stringw str = L"Minetest ["; + str += driver->getName(); + str += "]"; + device->setWindowCaption(str.c_str()); + for(;;) { if(device->run() == false || kill == true) @@ -2990,10 +2995,13 @@ void the_game( scenetime_avg = scenetime_avg * 0.95 + (float)scenetime*0.05; static float endscenetime_avg = 0; endscenetime_avg = endscenetime_avg * 0.95 + (float)endscenetime*0.05;*/ - + + u16 fps = (1.0/dtime_avg1); + std::ostringstream os(std::ios_base::binary); os<<std::fixed <<"Minetest "<<minetest_version_hash + <<" FPS = "<<fps <<" (R: range_all="<<draw_control.range_all<<")" <<std::setprecision(0) <<" drawtime = "<<drawtime_avg @@ -3382,21 +3390,6 @@ void the_game( End of drawing */ - static s16 lastFPS = 0; - //u16 fps = driver->getFPS(); - u16 fps = (1.0/dtime_avg1); - - if (lastFPS != fps) - { - core::stringw str = L"Minetest ["; - str += driver->getName(); - str += "] FPS="; - str += fps; - - device->setWindowCaption(str.c_str()); - lastFPS = fps; - } - /* Log times and stuff for visualization */ |