Skip to content

Commit

Permalink
Remove FPS from window title
Browse files Browse the repository at this point in the history
This doubles performance on some window managers (WTF?!)
  • Loading branch information
PilzAdam committed Dec 25, 2013
1 parent bf9f50b commit 4b31a38
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/game.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down

7 comments on commit 4b31a38

@corbin-auriti
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@corbin-auriti
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this caused the strange performance on xfce

@stormhcaser3000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i liked seeing the fps :(

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i liked seeing the fps :(

you can still see them

@davidgumberg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Press F6

Please sign in to comment.