From d9d669dcf855e444a77141b4b96e5df1f13c7203 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 11 Mar 2018 13:19:41 +0000 Subject: (svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent. --- src/newgrf_airporttiles.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/newgrf_airporttiles.h') diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h index 4d25aa924..dc0464203 100644 --- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -17,6 +17,7 @@ #include "newgrf_animation_type.h" #include "newgrf_commons.h" #include "newgrf_spritegroup.h" +#include "station_base.h" /** Scope resolver for handling the tiles of an airport. */ struct AirportTileScopeResolver : public ScopeResolver { @@ -24,7 +25,18 @@ struct AirportTileScopeResolver : public ScopeResolver { byte airport_id; ///< Type of airport for which the callback is run. TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks. - AirportTileScopeResolver(ResolverObject &ro, const AirportTileSpec *ats, TileIndex tile, Station *st); + /** + * Constructor of the scope resolver specific for airport tiles. + * @param ats Specification of the airport tiles. + * @param tile %Tile for the callback, only valid for airporttile callbacks. + * @param st Station of the airport for which the callback is run, or \c NULL for build gui. + */ + AirportTileScopeResolver(ResolverObject &ro, const AirportTileSpec *ats, TileIndex tile, Station *st) + : ScopeResolver(ro), st(st), tile(tile) + { + assert(st != NULL); + this->airport_id = st->airport.type; + } /* virtual */ uint32 GetRandomBits() const; /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; -- cgit v1.2.3-54-g00ecf