summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2020-01-26 13:45:51 +0100
committerGitHub <noreply@github.com>2020-01-26 13:45:51 +0100
commitc8779fb311c2665d3fc45c18b2f3460cd998d179 (patch)
tree15321da1e265a40fce50700182b218a87494d24a /src/misc.cpp
parentf88ac83408bff58022699b4d9488818d509ef974 (diff)
downloadopenttd-c8779fb311c2665d3fc45c18b2f3460cd998d179.tar.xz
Feature: NewGRF callback profiling (#7868)
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index c56eb6a38..dcb04fa02 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -29,6 +29,7 @@
#include "station_kdtree.h"
#include "town_kdtree.h"
#include "viewport_kdtree.h"
+#include "newgrf_profiling.h"
#include "safeguards.h"
@@ -69,6 +70,8 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
_thd.redsq = INVALID_TILE;
if (reset_settings) MakeNewgameSettingsLive();
+ _newgrf_profilers.clear();
+
if (reset_date) {
SetDate(ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1), 0);
InitializeOldNames();