summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-08 15:58:59 +0000
committerfrosch <frosch@openttd.org>2011-05-08 15:58:59 +0000
commit76c7cbff70e2cd4ea86a58f3efe2eed1839e5986 (patch)
tree96f7daf731da1dbbae4d6798f86a0dc2c59ba231 /src/rail.h
parent28067c21d5cc155f72c85374f8463bf8ceb1f0a0 (diff)
downloadopenttd-76c7cbff70e2cd4ea86a58f3efe2eed1839e5986.tar.xz
(svn r22436) -Fix (r18969): Apply railtype property 12 (station graphics) also to station groundsprites from action 1.
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/rail.h b/src/rail.h
index 586b85324..067db7957 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -163,24 +163,14 @@ struct RailtypeInfo {
RailTypes compatible_railtypes;
/**
- * Offset between the current railtype and normal rail. This means that:<p>
- * 1) All the sprites in a railset MUST be in the same order. This order
- * is determined by normal rail. Check sprites 1005 and following for this order<p>
- * 2) The position where the railtype is loaded must always be the same, otherwise
- * the offset will fail.
- * @note: Something more flexible might be desirable in the future.
- */
- SpriteID total_offset;
-
- /**
* Bridge offset
*/
SpriteID bridge_offset;
/**
- * Offset to add to ground sprite when drawing custom waypoints / stations
+ * Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations.
*/
- byte custom_ground_offset;
+ byte fallback_railtype;
/**
* Multiplier for curve maximum speed advantage
@@ -251,6 +241,18 @@ struct RailtypeInfo {
{
return this->group[RTSG_GROUND] != NULL;
}
+
+ /**
+ * Offset between the current railtype and normal rail. This means that:<p>
+ * 1) All the sprites in a railset MUST be in the same order. This order
+ * is determined by normal rail. Check sprites 1005 and following for this order<p>
+ * 2) The position where the railtype is loaded must always be the same, otherwise
+ * the offset will fail.
+ */
+ inline uint GetRailtypeSpriteOffset() const
+ {
+ return 82 * this->fallback_railtype;
+ }
};