* 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
| 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 | */ |
| 612 | SpriteID 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 | |
| 622 | void GetCustomStationRelocation(SpriteLayoutProcessor &processor, const StationSpec *statspec, BaseStation *st, TileIndex tile) |
| 623 | { |
no test coverage detected