summaryrefslogtreecommitdiff
path: root/src/newgrf_airport.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_airport.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_airport.cpp')
-rw-r--r--src/newgrf_airport.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp
index 4540698a1..61ad46ac0 100644
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -58,6 +58,9 @@ struct AirportResolverObject : public ResolverObject {
}
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
+
+ GrfSpecFeature GetFeature() const override;
+ uint32 GetDebugID() const override;
};
/**
@@ -226,6 +229,16 @@ void AirportOverrideManager::SetEntitySpec(AirportSpec *as)
return nullptr;
}
+GrfSpecFeature AirportResolverObject::GetFeature() const
+{
+ return GSF_AIRPORTS;
+}
+
+uint32 AirportResolverObject::GetDebugID() const
+{
+ return AirportSpec::Get(this->airport_scope.airport_id)->grf_prop.local_id;
+}
+
/* virtual */ uint32 AirportScopeResolver::GetRandomBits() const
{
return this->st == nullptr ? 0 : this->st->random_bits;