From c8779fb311c2665d3fc45c18b2f3460cd998d179 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 26 Jan 2020 13:45:51 +0100 Subject: 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. --- src/newgrf_airporttiles.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/newgrf_airporttiles.h') diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h index 191b79e9a..37460622d 100644 --- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -22,6 +22,7 @@ struct AirportTileScopeResolver : public ScopeResolver { struct Station *st; ///< %Station of the airport for which the callback is run, or \c nullptr for build gui. byte airport_id; ///< Type of airport for which the callback is run. TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks. + const AirportTileSpec *ats; /** * Constructor of the scope resolver specific for airport tiles. @@ -30,7 +31,7 @@ struct AirportTileScopeResolver : public ScopeResolver { * @param st Station of the airport for which the callback is run, or \c nullptr for build gui. */ AirportTileScopeResolver(ResolverObject &ro, const AirportTileSpec *ats, TileIndex tile, Station *st) - : ScopeResolver(ro), st(st), tile(tile) + : ScopeResolver(ro), st(st), tile(tile), ats(ats) { assert(st != nullptr); this->airport_id = st->airport.type; @@ -54,6 +55,9 @@ struct AirportTileResolverObject : public ResolverObject { default: return ResolverObject::GetScope(scope, relative); } } + + GrfSpecFeature GetFeature() const override; + uint32 GetDebugID() const override; }; /** -- cgit v1.2.3-54-g00ecf