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.
This commit is contained in:

committed by
Patric Stout

parent
a3d1950b65
commit
2a868b9f3b
@@ -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();
|
||||
|
Reference in New Issue
Block a user