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

Function GetSpriteLocalID

src/spritecache.cpp:163–167  ·  view source on GitHub ↗

* Get the GRF-local sprite id of a given sprite. * @param sprite The sprite to look at. * @return The GRF-local sprite id. */

Source from the content-addressed store, hash-verified

161 * @return The GRF-local sprite id.
162 */
163uint32_t GetSpriteLocalID(SpriteID sprite)
164{
165 if (!SpriteExists(sprite)) return 0;
166 return GetSpriteCache(sprite)->id;
167}
168
169/**
170 * Count the sprites which originate from a specific file in a range of SpriteIDs.

Callers 3

GetWidgetStringMethod · 0.85
DrawWidgetMethod · 0.85
operator()Method · 0.85

Calls 2

SpriteExistsFunction · 0.85
GetSpriteCacheFunction · 0.85

Tested by

no test coverage detected