diff options
author | frosch <frosch@openttd.org> | 2018-03-11 13:19:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2018-03-11 13:19:41 +0000 |
commit | d9d669dcf855e444a77141b4b96e5df1f13c7203 (patch) | |
tree | a90dc37970fd26211382b50c25b5680be5963955 /src/newgrf_airport.cpp | |
parent | 7c406f0d9dc365960f07e20e690cc0bdf8682fd6 (diff) | |
download | openttd-d9d669dcf855e444a77141b4b96e5df1f13c7203.tar.xz |
(svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent.
Diffstat (limited to 'src/newgrf_airport.cpp')
-rw-r--r-- | src/newgrf_airport.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index 6db12f737..0863d0986 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -26,7 +26,18 @@ struct AirportScopeResolver : public ScopeResolver { byte layout; ///< Layout of the airport to build. TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks. - AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout); + /** + * Constructor of the scope resolver for an airport. + * @param ro Surrounding resolver. + * @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. + * @param airport_id Type of airport for which the callback is run. + * @param layout Layout of the airport to build. + */ + AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout) + : ScopeResolver(ro), st(st), airport_id(airport_id), layout(layout), tile(tile) + { + } /* virtual */ uint32 GetRandomBits() const; /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; @@ -242,22 +253,6 @@ AirportResolverObject::AirportResolverObject(TileIndex tile, Station *st, byte a this->root_spritegroup = AirportSpec::Get(airport_id)->grf_prop.spritegroup[0]; } -/** - * Constructor of the scope resolver for an airport. - * @param ro Surrounding resolver. - * @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. - * @param airport_id Type of airport for which the callback is run. - * @param layout Layout of the airport to build. - */ -AirportScopeResolver::AirportScopeResolver(ResolverObject &ro, TileIndex tile, Station *st, byte airport_id, byte layout) : ScopeResolver(ro) -{ - this->st = st; - this->airport_id = airport_id; - this->layout = layout; - this->tile = tile; -} - SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout) { AirportResolverObject object(INVALID_TILE, NULL, as->GetIndex(), layout); |