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

@@ -139,11 +139,22 @@ IndustryTileResolverObject::IndustryTileResolverObject(IndustryGfx gfx, TileInde
CallbackID callback, uint32 callback_param1, uint32 callback_param2)
: ResolverObject(GetIndTileGrffile(gfx), callback, callback_param1, callback_param2),
indtile_scope(*this, indus, tile),
ind_scope(*this, tile, indus, indus->type)
ind_scope(*this, tile, indus, indus->type),
gfx(gfx)
{
this->root_spritegroup = GetIndustryTileSpec(gfx)->grf_prop.spritegroup[0];
}
GrfSpecFeature IndustryTileResolverObject::GetFeature() const
{
return GSF_INDUSTRYTILES;
}
uint32 IndustryTileResolverObject::GetDebugID() const
{
return GetIndustryTileSpec(gfx)->grf_prop.local_id;
}
static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGroup *group, byte rnd_colour, byte stage, IndustryGfx gfx)
{
const DrawTileSprites *dts = group->ProcessRegisters(&stage);