summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--rail.h6
-rw-r--r--rail_cmd.c1
-rw-r--r--railtypes.h (renamed from railtypes.c)9
4 files changed, 6 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index bc11b0de2..018278c31 100644
--- a/Makefile
+++ b/Makefile
@@ -670,7 +670,6 @@ C_SOURCES += queue.c
C_SOURCES += rail.c
C_SOURCES += rail_cmd.c
C_SOURCES += rail_gui.c
-C_SOURCES += railtypes.c
C_SOURCES += rev.c
C_SOURCES += road_cmd.c
C_SOURCES += road_gui.c
diff --git a/rail.h b/rail.h
index 387fc3fb4..631d35e4b 100644
--- a/rail.h
+++ b/rail.h
@@ -161,7 +161,7 @@ typedef struct RailtypeInfo {
byte compatible_railtypes;
} RailtypeInfo;
-RailtypeInfo railtypes[RAILTYPE_END];
+extern const RailtypeInfo _railtypes[RAILTYPE_END];
// these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
enum {
@@ -528,10 +528,10 @@ static inline TransportType GetCrossingTransportType(TileIndex tile, Track track
* @param railtype the rail type which the information is requested for
* @return The pointer to the RailtypeInfo
*/
-static inline RailtypeInfo *GetRailTypeInfo(RailType railtype)
+static inline const RailtypeInfo *GetRailTypeInfo(RailType railtype)
{
assert(railtype < RAILTYPE_END);
- return &railtypes[railtype];
+ return &_railtypes[railtype];
}
/**
diff --git a/rail_cmd.c b/rail_cmd.c
index ca854fa5e..05367a8b2 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -22,6 +22,7 @@
#include "waypoint.h"
#include "npf.h"
#include "rail.h"
+#include "railtypes.h" // include table for railtypes
extern uint16 _custom_sprites_base;
diff --git a/railtypes.c b/railtypes.h
index 9305a58eb..d89832bc5 100644
--- a/railtypes.c
+++ b/railtypes.h
@@ -1,17 +1,12 @@
/* $Id: */
-#include "stdafx.h"
-#include "openttd.h"
-#include "rail.h"
-#include "table/sprites.h"
-
-/** @file railtypes.c
+/** @file railtypes.h
* All the railtype-specific information is stored here.
*/
/** Global Railtype definition
*/
-RailtypeInfo railtypes[RAILTYPE_END] = {
+const RailtypeInfo _railtypes[RAILTYPE_END] = {
{
{
SPR_RAIL_TRACK_Y,