From 76c7cbff70e2cd4ea86a58f3efe2eed1839e5986 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 8 May 2011 15:58:59 +0000 Subject: (svn r22436) -Fix (r18969): Apply railtype property 12 (station graphics) also to station groundsprites from action 1. --- src/rail.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/rail.h') diff --git a/src/rail.h b/src/rail.h index 586b85324..067db7957 100644 --- a/src/rail.h +++ b/src/rail.h @@ -162,25 +162,15 @@ struct RailtypeInfo { /** bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel */ RailTypes compatible_railtypes; - /** - * Offset between the current railtype and normal rail. This means that:

- * 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

- * 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:

+ * 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

+ * 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; + } }; -- cgit v1.2.3-54-g00ecf