diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-07-19 21:17:07 +0200 |
---|---|---|
committer | Patric Stout <truebrain@openttd.org> | 2018-07-19 21:17:07 +0200 |
commit | 2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad (patch) | |
tree | 36da708e128fc68d9ceac32362503df43af2fc22 /src/openttd.cpp | |
parent | a3d1950b656787b76fbccec1aedd63407c34c2f1 (diff) | |
download | openttd-2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad.tar.xz |
Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 43c6b1170..510f00427 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -63,6 +63,7 @@ #include "subsidy_func.h" #include "gfx_layout.h" #include "viewport_sprite_sorter.h" +#include "framerate_type.h" #include "linkgraph/linkgraphschedule.h" @@ -1336,6 +1337,14 @@ void StateGameLoop() { /* don't execute the state loop during pause */ if (_pause_mode != PM_UNPAUSED) { + PerformanceMeasurer::Paused(PFE_GAMELOOP); + PerformanceMeasurer::Paused(PFE_GL_ECONOMY); + PerformanceMeasurer::Paused(PFE_GL_TRAINS); + PerformanceMeasurer::Paused(PFE_GL_ROADVEHS); + PerformanceMeasurer::Paused(PFE_GL_SHIPS); + PerformanceMeasurer::Paused(PFE_GL_AIRCRAFT); + PerformanceMeasurer::Paused(PFE_GL_LANDSCAPE); + UpdateLandscapingLimits(); #ifndef DEBUG_DUMP_COMMANDS Game::GameLoop(); @@ -1343,6 +1352,9 @@ void StateGameLoop() CallWindowTickEvent(); return; } + + PerformanceMeasurer framerate(PFE_GAMELOOP); + PerformanceAccumulator::Reset(PFE_GL_LANDSCAPE); if (HasModalProgress()) return; Layouter::ReduceLineCache(); |