MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetCustomStationRelocation

Function GetCustomStationRelocation

src/newgrf_station.cpp:612–620  ·  view source on GitHub ↗

* Resolve sprites for drawing a station tile. * @param statspec Station spec * @param st Station (nullptr in GUI) * @param tile Station tile being drawn (INVALID_TILE in GUI) * @param var10 Value to put in variable 10; normally 0; 1 when resolving the groundsprite and StationSpecFlag::SeparateGround is set. * @return First sprite of the Action 1 spriteset to use, minus an offset of SPR_RAIL_P

Source from the content-addressed store, hash-verified

610 * @return First sprite of the Action 1 spriteset to use, minus an offset of SPR_RAIL_PLATFORM_Y_FRONT (0x42D) to accommodate for weird NewGRF specs.
611 */
612SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32_t var10)
613{
614 StationResolverObject object(statspec, st, tile, CBID_NO_CALLBACK, var10);
615 const auto *group = object.Resolve<ResultSpriteGroup>();
616
617 /* A zero-length ResultSpriteGroup is valid because the output value is an offset, not a sprite ID within the ResultSpriteGroup. */
618 if (group == nullptr) return 0;
619 return group->sprite - SPR_RAIL_PLATFORM_Y_FRONT;
620}
621
622void GetCustomStationRelocation(SpriteLayoutProcessor &processor, const StationSpec *statspec, BaseStation *st, TileIndex tile)
623{

Callers 2

DrawStationTileFunction · 0.85
DrawTile_StationFunction · 0.85

Calls 2

Var10ValuesMethod · 0.80
ProcessRegistersMethod · 0.45

Tested by

no test coverage detected