summaryrefslogtreecommitdiff
path: root/src/newgrf_railtype.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 16:14:23 +0000
commit4d5dbf51707c42c24eeafdb65016b079c54adcf2 (patch)
tree0197dcc17f4a8411ecea2223f356019c902fe7b9 /src/newgrf_railtype.cpp
parente9837ff1ec1326aec622366ae29ff1aa81581daf (diff)
downloadopenttd-4d5dbf51707c42c24eeafdb65016b079c54adcf2.tar.xz
(svn r22410) -Document: some more bits ;)
Diffstat (limited to 'src/newgrf_railtype.cpp')
-rw-r--r--src/newgrf_railtype.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index 6f38794b6..c38124464 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -87,6 +87,14 @@ static inline void NewRailTypeResolver(ResolverObject *res, TileIndex tile, Tile
res->count = 0;
}
+/**
+ * Get the sprite to draw for the given tile.
+ * @param rti The rail type data (spec).
+ * @param tile The tile to get the sprite for.
+ * @param rtsg The type of sprite to draw.
+ * @param content Where are we drawing the tile?
+ * @return The sprite to draw.
+ */
SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context)
{
assert(rtsg < RTSG_END);
@@ -104,6 +112,12 @@ SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSp
return group->GetResult();
}
+/**
+ * Perform a reverse railtype lookup to get the GRF internal ID.
+ * @param railtype The global (OpenTTD) railtype.
+ * @param grffile The GRF to do the lookup for.
+ * @return the GRF internal ID.
+ */
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
{
/* No rail type table present, return rail type as-is */