summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-07-19 21:17:07 +0200
committerPatric Stout <truebrain@openttd.org>2018-07-19 21:17:07 +0200
commit2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad (patch)
tree36da708e128fc68d9ceac32362503df43af2fc22 /src/vehicle.cpp
parenta3d1950b656787b76fbccec1aedd63407c34c2f1 (diff)
downloadopenttd-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/vehicle.cpp')
-rw-r--r--src/vehicle.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index b4c790722..ae826a50c 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -52,6 +52,7 @@
#include "gamelog.h"
#include "linkgraph/linkgraph.h"
#include "linkgraph/refresh.h"
+#include "framerate_type.h"
#include "table/strings.h"
@@ -945,8 +946,15 @@ void CallVehicleTicks()
RunVehicleDayProc();
- Station *st;
- FOR_ALL_STATIONS(st) LoadUnloadStation(st);
+ {
+ PerformanceMeasurer framerate(PFE_GL_ECONOMY);
+ Station *st;
+ FOR_ALL_STATIONS(st) LoadUnloadStation(st);
+ }
+ PerformanceAccumulator::Reset(PFE_GL_TRAINS);
+ PerformanceAccumulator::Reset(PFE_GL_ROADVEHS);
+ PerformanceAccumulator::Reset(PFE_GL_SHIPS);
+ PerformanceAccumulator::Reset(PFE_GL_AIRCRAFT);
Vehicle *v;
FOR_ALL_VEHICLES(v) {