summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-04-08 07:19:29 +0000
committerpeter1138 <peter1138@openttd.org>2008-04-08 07:19:29 +0000
commit310170364ff7e22ce631e2c5afeef9be12a8aca4 (patch)
tree50bcc2dd4368fa179ba3a9e9f3b2108b9892999f /src/rail.h
parentb0ca38e20a154572e4dca3dd95c7deddea02c3e1 (diff)
downloadopenttd-310170364ff7e22ce631e2c5afeef9be12a8aca4.tar.xz
(svn r12624) -Codechange: Make drawing of catenary an attribute of rail types, instead of deciding by the rail type directly.
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/rail.h b/src/rail.h
index 53b3a1337..04a712d1c 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -13,6 +13,16 @@
#include "economy_func.h"
#include "tile_cmd.h"
+enum RailTypeFlag {
+ RTF_CATENARY = 0, ///< Set if the rail type should have catenary drawn
+};
+
+enum RailTypeFlags {
+ RTFB_NONE = 0,
+ RTFB_CATENARY = 1 << RTF_CATENARY,
+};
+DECLARE_ENUM_AS_BIT_SET(RailTypeFlags);
+
/** This struct contains all the info that is needed to draw and construct tracks.
*/
struct RailtypeInfo {
@@ -93,6 +103,11 @@ struct RailtypeInfo {
* Multiplier for curve maximum speed advantage
*/
byte curve_speed;
+
+ /**
+ * Bit mask of rail type flags
+ */
+ RailTypeFlags flags;
};
@@ -190,7 +205,7 @@ int TicksToLeaveDepot(const Vehicle *v);
*/
static inline bool HasCatenary(RailType rt)
{
- return rt == RAILTYPE_ELECTRIC;
+ return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
}