Skip to content
Permalink
Browse files

Remove FPS from window title

This doubles performance on some window managers (WTF?!)
  • Loading branch information
PilzAdam committed Dec 25, 2013
1 parent bf9f50b commit 4b31a38ae9b2d2019ddf75d09c1fdfd67f512067
Showing with 9 additions and 16 deletions.
  1. +9 −16 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
*/

7 comments on commit 4b31a38

@RavetcoFX

This comment has been minimized.

Copy link

RavetcoFX replied Dec 26, 2013

Ahhh, as of this commit Minetest is no longer a development test :D

@PilzAdam and what WMs did you test on, thats a curious issue.

@PilzAdam

This comment has been minimized.

Copy link
Contributor Author

PilzAdam replied Dec 26, 2013

People reported the speedup on Xfce. And I havent noticed anything in KDE.

@RavetcoFX

This comment has been minimized.

Copy link

RavetcoFX replied Dec 26, 2013

I tested on Gnome Mutter and Cinnamon Muffin, I didn't notice anything either.

@HybridDog

This comment has been minimized.

Copy link
Contributor

HybridDog replied Dec 27, 2013

maybe this caused the strange performance on xfce

@stormhcaser3000

This comment has been minimized.

Copy link

stormhcaser3000 replied Dec 28, 2013

i liked seeing the fps :(

@HybridDog

This comment has been minimized.

Copy link
Contributor

HybridDog replied Dec 28, 2013

i liked seeing the fps :(

you can still see them

@davidgumberg

This comment has been minimized.

Copy link
Contributor

davidgumberg replied Dec 28, 2013

Press F6

Please sign in to comment.
You can’t perform that action at this time.