diff options
author | celestar <celestar@openttd.org> | 2006-03-29 16:30:26 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-03-29 16:30:26 +0000 |
commit | a7d8ad0004e00e1d917d636f4d69fd58f5edbfa3 (patch) | |
tree | c1903bfd394f761768fa9d907c58a76229e1b2f8 /rail.h | |
parent | 9c96bcb9975c4f9e197cebf0562f81de5be99b5b (diff) | |
download | openttd-a7d8ad0004e00e1d917d636f4d69fd58f5edbfa3.tar.xz |
(svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
Diffstat (limited to 'rail.h')
-rw-r--r-- | rail.h | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -9,7 +9,6 @@ #include "rail_map.h" #include "tile.h" - /** These are a combination of tracks and directions. Values are 0-5 in one direction (corresponding to the Track enum) and 8-13 in the other direction. */ typedef enum Trackdirs { @@ -110,8 +109,11 @@ typedef struct RailtypeInfo { /** sprite number difference between a piece of track on a snowy ground and the corresponding one on normal ground */ SpriteID snow_offset; - /** bitmask to the OTHER railtypes that can be used by an engine of THIS railtype */ - byte compatible_railtypes; + /** bitmask to the OTHER railtypes on which an engine of THIS railtype generates power */ + RailTypeMask powered_railtypes; + + /** bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel */ + RailTypeMask compatible_railtypes; /** * Offset between the current railtype and normal rail. This means that:<p> @@ -478,6 +480,11 @@ static inline bool IsCompatibleRail(RailType enginetype, RailType tiletype) return HASBIT(GetRailTypeInfo(enginetype)->compatible_railtypes, tiletype); } +static inline bool HasPowerOnRail(RailType enginetype, RailType tiletype) +{ + return HASBIT(GetRailTypeInfo(enginetype)->powered_railtypes, tiletype); +} + /** * Checks if the given tracks overlap, ie form a crossing. Basically this * means when there is more than one track on the tile, exept when there are @@ -497,4 +504,13 @@ static inline bool TracksOverlap(TrackBits bits) void DrawTrainDepotSprite(int x, int y, int image, RailType railtype); void DrawDefaultWaypointSprite(int x, int y, RailType railtype); + +/** + * Draws overhead wires and pylons for electric railways. + * @param ti The TileInfo struct of the tile being drawn + * @see DrawCatenaryRailway + */ +void DrawCatenary(const TileInfo *ti); + +uint GetRailFoundation(uint tileh, uint bits); #endif /* RAIL_H */ |