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:

committed by
GitHub

parent
f88ac83408
commit
c8779fb311
@@ -352,7 +352,7 @@ unhandled:
|
||||
*/
|
||||
ObjectResolverObject::ObjectResolverObject(const ObjectSpec *spec, Object *obj, TileIndex tile, uint8 view,
|
||||
CallbackID callback, uint32 param1, uint32 param2)
|
||||
: ResolverObject(spec->grf_prop.grffile, callback, param1, param2), object_scope(*this, obj, tile, view)
|
||||
: ResolverObject(spec->grf_prop.grffile, callback, param1, param2), object_scope(*this, obj, spec, tile, view)
|
||||
{
|
||||
this->town_scope = nullptr;
|
||||
this->root_spritegroup = (obj == nullptr && spec->grf_prop.spritegroup[CT_PURCHASE_OBJECT] != nullptr) ?
|
||||
@@ -384,6 +384,16 @@ TownScopeResolver *ObjectResolverObject::GetTown()
|
||||
return this->town_scope;
|
||||
}
|
||||
|
||||
GrfSpecFeature ObjectResolverObject::GetFeature() const
|
||||
{
|
||||
return GSF_OBJECTS;
|
||||
}
|
||||
|
||||
uint32 ObjectResolverObject::GetDebugID() const
|
||||
{
|
||||
return this->object_scope.spec->grf_prop.local_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a callback for an object.
|
||||
* @param callback The callback to perform.
|
||||
|
Reference in New Issue
Block a user