summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-10-30 17:24:30 +0000
committerfrosch <frosch@openttd.org>2015-10-30 17:24:30 +0000
commit2d636266f59e8f5e88c3460b9adb8889442108d8 (patch)
tree2ce70a31ab745556593c46cb72d5c2341b34cc69 /src/rail.h
parent312809228d52009191e2000cc1a49272b48f9699 (diff)
downloadopenttd-2d636266f59e8f5e88c3460b9adb8889442108d8.tar.xz
(svn r27427) -Fix: Use the NewGRF railtype sorting order in the infrastructure window.
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rail.h b/src/rail.h
index 539a162b8..320d24a9a 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -431,4 +431,13 @@ void ResetRailTypes();
void InitRailTypes();
RailType AllocateRailType(RailTypeLabel label);
+extern RailType _sorted_railtypes[RAILTYPE_END];
+extern uint8 _sorted_railtypes_size;
+
+/**
+ * Loop header for iterating over railtypes, sorted by sortorder.
+ * @param var Railtype.
+ */
+#define FOR_ALL_SORTED_RAILTYPES(var) for (uint8 index = 0; index < _sorted_railtypes_size && (var = _sorted_railtypes[index], true) ; index++)
+
#endif /* RAIL_H */