forked from mirror/OpenTTD
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
@@ -98,9 +98,10 @@ struct ObjectSpec {
|
||||
|
||||
/** Object scope resolver. */
|
||||
struct ObjectScopeResolver : public ScopeResolver {
|
||||
struct Object *obj; ///< The object the callback is ran for.
|
||||
TileIndex tile; ///< The tile related to the object.
|
||||
uint8 view; ///< The view of the object.
|
||||
struct Object *obj; ///< The object the callback is ran for.
|
||||
const ObjectSpec *spec; ///< Specification of the object type.
|
||||
TileIndex tile; ///< The tile related to the object.
|
||||
uint8 view; ///< The view of the object.
|
||||
|
||||
/**
|
||||
* Constructor of an object scope resolver.
|
||||
@@ -109,8 +110,8 @@ struct ObjectScopeResolver : public ScopeResolver {
|
||||
* @param tile %Tile of the object.
|
||||
* @param view View of the object.
|
||||
*/
|
||||
ObjectScopeResolver(ResolverObject &ro, Object *obj, TileIndex tile, uint8 view = 0)
|
||||
: ScopeResolver(ro), obj(obj), tile(tile), view(view)
|
||||
ObjectScopeResolver(ResolverObject &ro, Object *obj, const ObjectSpec *spec, TileIndex tile, uint8 view = 0)
|
||||
: ScopeResolver(ro), obj(obj), spec(spec), tile(tile), view(view)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -144,6 +145,9 @@ struct ObjectResolverObject : public ResolverObject {
|
||||
}
|
||||
}
|
||||
|
||||
GrfSpecFeature GetFeature() const override;
|
||||
uint32 GetDebugID() const override;
|
||||
|
||||
private:
|
||||
TownScopeResolver *GetTown();
|
||||
};
|
||||
|
Reference in New Issue
Block a user