diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2020-01-26 13:45:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-26 13:45:51 +0100 |
commit | c8779fb311c2665d3fc45c18b2f3460cd998d179 (patch) | |
tree | 15321da1e265a40fce50700182b218a87494d24a /src/newgrf_railtype.h | |
parent | f88ac83408bff58022699b4d9488818d509ef974 (diff) | |
download | openttd-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/newgrf_railtype.h')
-rw-r--r-- | src/newgrf_railtype.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/newgrf_railtype.h b/src/newgrf_railtype.h index 223cfdd63..1e0ff01d8 100644 --- a/src/newgrf_railtype.h +++ b/src/newgrf_railtype.h @@ -18,6 +18,7 @@ struct RailTypeScopeResolver : public ScopeResolver { TileIndex tile; ///< Tracktile. For track on a bridge this is the southern bridgehead. TileContext context; ///< Are we resolving sprites for the upper halftile, or on a bridge? + const RailtypeInfo *rti; /** * Constructor of the railtype scope resolvers. @@ -25,8 +26,8 @@ struct RailTypeScopeResolver : public ScopeResolver { * @param tile %Tile containing the track. For track on a bridge this is the southern bridgehead. * @param context Are we resolving sprites for the upper halftile, or on a bridge? */ - RailTypeScopeResolver(ResolverObject &ro, TileIndex tile, TileContext context) - : ScopeResolver(ro), tile(tile), context(context) + RailTypeScopeResolver(ResolverObject &ro, const RailtypeInfo *rti, TileIndex tile, TileContext context) + : ScopeResolver(ro), tile(tile), context(context), rti(rti) { } @@ -49,6 +50,9 @@ struct RailTypeResolverObject : public ResolverObject { } const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override; + + GrfSpecFeature GetFeature() const override; + uint32 GetDebugID() const override; }; SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = nullptr); |