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.
This commit is contained in:
Niels Martin Hansen
2020-01-26 13:45:51 +01:00
committed by GitHub
parent f88ac83408
commit c8779fb311
40 changed files with 691 additions and 20 deletions

View File

@@ -39,6 +39,7 @@ struct IndustryTileScopeResolver : public ScopeResolver {
struct IndustryTileResolverObject : public ResolverObject {
IndustryTileScopeResolver indtile_scope; ///< Scope resolver for the industry tile.
IndustriesScopeResolver ind_scope; ///< Scope resolver for the industry owning the tile.
IndustryGfx gfx;
IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
@@ -51,6 +52,9 @@ struct IndustryTileResolverObject : public ResolverObject {
default: return ResolverObject::GetScope(scope, relative);
}
}
GrfSpecFeature GetFeature() const override;
uint32 GetDebugID() const override;
};
bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds);