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

Function GetCustomCargoSprite

src/newgrf_cargo.cpp:55–62  ·  view source on GitHub ↗

* Get the custom sprite for the given cargo type. * @param cs Cargo being queried. * @return Custom sprite to draw, or \c 0 if not available. */

Source from the content-addressed store, hash-verified

53 * @return Custom sprite to draw, or \c 0 if not available.
54 */
55SpriteID GetCustomCargoSprite(const CargoSpec *cs)
56{
57 CargoResolverObject object(cs);
58 const auto *group = object.Resolve<ResultSpriteGroup>();
59 if (group == nullptr || group->num_sprites == 0) return 0;
60
61 return group->sprite;
62}
63
64
65uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2, const CargoSpec *cs, std::span<int32_t> regs100)

Callers 1

GetCargoIconMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected