summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.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/newgrf_industrytiles.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/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 03d86a771..e9c99f6cd 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -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);