summaryrefslogtreecommitdiff
path: root/src/spritecache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/spritecache.cpp')
-rw-r--r--src/spritecache.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index f36354c01..da0ca8048 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -146,6 +146,17 @@ uint GetOriginFileSlot(SpriteID sprite)
}
/**
+ * Get the GRF-local sprite id of a given sprite.
+ * @param sprite The sprite to look at.
+ * @return The GRF-local sprite id.
+ */
+uint32 GetSpriteLocalID(SpriteID sprite)
+{
+ if (!SpriteExists(sprite)) return 0;
+ return GetSpriteCache(sprite)->id;
+}
+
+/**
* Count the sprites which originate from a specific file slot in a range of SpriteIDs.
* @param file_slot FIOS file slot.
* @param begin First sprite in range.