* Resolve the sprites for custom station foundations. * @param statspec Station spec * @param st Station * @param tile Station tile being drawn * @param layout Spritelayout as returned by previous callback * @param edge_info Information about northern tile edges; whether they need foundations or merge into adjacent tile's foundations. * @return First sprite of a set of foundation sprites for
| 644 | * @return First sprite of a set of foundation sprites for various slopes, or 0 if default foundations shall be drawn. |
| 645 | */ |
| 646 | SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint layout, uint edge_info) |
| 647 | { |
| 648 | /* callback_param1 == 2 means we are resolving the foundation sprites. */ |
| 649 | StationResolverObject object(statspec, st, tile, CBID_NO_CALLBACK, 2, layout | (edge_info << 16)); |
| 650 | |
| 651 | const auto *group = object.Resolve<ResultSpriteGroup>(); |
| 652 | /* Note: SpriteGroup::Resolve zeroes all registers, so register 0x100 is initialised to 0. (compatibility) */ |
| 653 | uint32_t offset = static_cast<uint32_t>(object.GetRegister(0x100)); |
| 654 | if (group == nullptr || group->num_sprites <= offset) return 0; |
| 655 | |
| 656 | return group->sprite + offset; |
| 657 | } |
| 658 | |
| 659 | |
| 660 | uint16_t GetStationCallback(CallbackID callback, uint32_t param1, uint32_t param2, const StationSpec *statspec, BaseStation *st, TileIndex tile, std::span<int32_t> regs100) |
no test coverage detected