(svn r2756) Renamed railtypes into _railtypes

Renamed railtypes.c into railtypes.h, all other tables are in .h files. (It should be in the tables dir but I couldn't figure out how to get it there without deleting it first).
Added const and extern.
replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
ludde 19 years ago
parent bb1e1f2b5f
commit 24986e9144

@ -670,7 +670,6 @@ C_SOURCES += queue.c
C_SOURCES += rail.c C_SOURCES += rail.c
C_SOURCES += rail_cmd.c C_SOURCES += rail_cmd.c
C_SOURCES += rail_gui.c C_SOURCES += rail_gui.c
C_SOURCES += railtypes.c
C_SOURCES += rev.c C_SOURCES += rev.c
C_SOURCES += road_cmd.c C_SOURCES += road_cmd.c
C_SOURCES += road_gui.c C_SOURCES += road_gui.c

@ -161,7 +161,7 @@ typedef struct RailtypeInfo {
byte compatible_railtypes; byte compatible_railtypes;
} RailtypeInfo; } 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 // these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
enum { enum {
@ -528,10 +528,10 @@ static inline TransportType GetCrossingTransportType(TileIndex tile, Track track
* @param railtype the rail type which the information is requested for * @param railtype the rail type which the information is requested for
* @return The pointer to the RailtypeInfo * @return The pointer to the RailtypeInfo
*/ */
static inline RailtypeInfo *GetRailTypeInfo(RailType railtype) static inline const RailtypeInfo *GetRailTypeInfo(RailType railtype)
{ {
assert(railtype < RAILTYPE_END); assert(railtype < RAILTYPE_END);
return &railtypes[railtype]; return &_railtypes[railtype];
} }
/** /**

@ -22,6 +22,7 @@
#include "waypoint.h" #include "waypoint.h"
#include "npf.h" #include "npf.h"
#include "rail.h" #include "rail.h"
#include "railtypes.h" // include table for railtypes
extern uint16 _custom_sprites_base; extern uint16 _custom_sprites_base;

@ -1,17 +1,12 @@
/* $Id: */ /* $Id: */
#include "stdafx.h" /** @file railtypes.h
#include "openttd.h"
#include "rail.h"
#include "table/sprites.h"
/** @file railtypes.c
* All the railtype-specific information is stored here. * All the railtype-specific information is stored here.
*/ */
/** Global Railtype definition /** Global Railtype definition
*/ */
RailtypeInfo railtypes[RAILTYPE_END] = { const RailtypeInfo _railtypes[RAILTYPE_END] = {
{ {
{ {
SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_Y,
Loading…
Cancel
Save