Skip to content

Commit 4b31a38

Browse files
committed
Remove FPS from window title
This doubles performance on some window managers (WTF?!)
1 parent bf9f50b commit 4b31a38

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/game.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,11 @@ void the_game(
14791479

14801480
bool use_weather = g_settings->getBool("weather");
14811481

1482+
core::stringw str = L"Minetest [";
1483+
str += driver->getName();
1484+
str += "]";
1485+
device->setWindowCaption(str.c_str());
1486+
14821487
for(;;)
14831488
{
14841489
if(device->run() == false || kill == true)
@@ -2990,10 +2995,13 @@ void the_game(
29902995
scenetime_avg = scenetime_avg * 0.95 + (float)scenetime*0.05;
29912996
static float endscenetime_avg = 0;
29922997
endscenetime_avg = endscenetime_avg * 0.95 + (float)endscenetime*0.05;*/
2993-
2998+
2999+
u16 fps = (1.0/dtime_avg1);
3000+
29943001
std::ostringstream os(std::ios_base::binary);
29953002
os<<std::fixed
29963003
<<"Minetest "<<minetest_version_hash
3004+
<<" FPS = "<<fps
29973005
<<" (R: range_all="<<draw_control.range_all<<")"
29983006
<<std::setprecision(0)
29993007
<<" drawtime = "<<drawtime_avg
@@ -3382,21 +3390,6 @@ void the_game(
33823390
End of drawing
33833391
*/
33843392

3385-
static s16 lastFPS = 0;
3386-
//u16 fps = driver->getFPS();
3387-
u16 fps = (1.0/dtime_avg1);
3388-
3389-
if (lastFPS != fps)
3390-
{
3391-
core::stringw str = L"Minetest [";
3392-
str += driver->getName();
3393-
str += "] FPS=";
3394-
str += fps;
3395-
3396-
device->setWindowCaption(str.c_str());
3397-
lastFPS = fps;
3398-
}
3399-
34003393
/*
34013394
Log times and stuff for visualization
34023395
*/

0 commit comments

Comments
 (0)