src/newgrf_station.h
author rubidium
Sat, 17 Nov 2007 12:42:15 +0000
changeset 7898 7c6a9c9030b5
parent 7327 d810677fb909
child 8130 d2eb7d04f6e1
permissions -rw-r--r--
(svn r11449) -Fix [FS#1160]: trams could deadlock themselves. As of now trams will turn as roadvehicles do when the player cannot build a tram track piece on the next tile without destroying anything. It will not turn when the player can build the before mentioned track piece on the 'next' tile.
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     1
/* $Id$ */
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     2
2963
f28ce0549513 (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
     3
/** @file newgrf_station.h Header file for NewGRF stations */
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     4
2963
f28ce0549513 (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
     5
#ifndef NEWGRF_STATION_H
f28ce0549513 (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
     6
#define NEWGRF_STATION_H
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     7
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     8
#include "engine.h"
7327
d810677fb909 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 6451
diff changeset
     9
#include "newgrf_callbacks.h"
3866
b13553406a0a (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents: 3865
diff changeset
    10
#include "newgrf_cargo.h"
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    11
#include "helpers.hpp"
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    12
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    13
enum StationClassID {
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    14
	STAT_CLASS_BEGIN = 0,    ///< the lowest valid value
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    15
	STAT_CLASS_DFLT = 0,     ///< Default station class.
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    16
	STAT_CLASS_WAYP,         ///< Waypoint class.
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    17
	STAT_CLASS_MAX = 32,     ///< Maximum number of classes.
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    18
};
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    19
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    20
/** Define basic enum properties */
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    21
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    22
typedef TinyEnumT<StationClassID> StationClassIDByte;
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    23
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    24
/** Allow incrementing of StationClassID variables */
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    25
DECLARE_POSTFIX_INCREMENT(StationClassID);
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    26
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    27
/* Station layout for given dimensions - it is a two-dimensional array
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    28
 * where index is computed as (x * platforms) + platform. */
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    29
typedef byte *StationLayout;
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    30
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    31
struct StationSpec {
6451
e576c71bfc09 (svn r9601) -Codechange: Store grf file reference in station spec, not just GRF ID
peter1138
parents: 6248
diff changeset
    32
	const struct GRFFile *grffile; ///< ID of GRF file station belongs to.
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    33
	int localidx; ///< Index within GRF file of station.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    34
3780
4c785f28b1dd (svn r4772) - Newstations: when allocating a custom station (via action 0x03) check if the station has already been allocated. (Fixes duplicate waypoints in newstatsw in non-temperate climate)
peter1138
parents: 3775
diff changeset
    35
	bool allocated; ///< Flag whether this station has been added to a station class list
4c785f28b1dd (svn r4772) - Newstations: when allocating a custom station (via action 0x03) check if the station has already been allocated. (Fixes duplicate waypoints in newstatsw in non-temperate climate)
peter1138
parents: 3775
diff changeset
    36
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    37
	StationClassID sclass; ///< The class to which this spec belongs.
3594
3c4e4feea80a (svn r4484) - Newstations: Use StringIDs instead of char*s to reference our custom names.
peter1138
parents: 3587
diff changeset
    38
	StringID name; ///< Name of this station.
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    39
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    40
	/**
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    41
	 * Bitmask of number of platforms available for the station.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    42
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 platforms.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    43
	 */
3505
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    44
	byte disallowed_platforms;
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    45
	/**
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    46
	 * Bitmask of platform lengths available for the station.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    47
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 tiles long.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    48
	 */
3505
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    49
	byte disallowed_lengths;
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    50
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    51
	/** Number of tile layouts.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    52
	 * A minimum of 8 is required is required for stations.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    53
	 * 0-1 = plain platform
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    54
	 * 2-3 = platform with building
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    55
	 * 4-5 = platform with roof, left side
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    56
	 * 6-7 = platform with roof, right side
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    57
	 */
3570
707f93772b0a (svn r4452) - NewGRF: switch to unsigned ints for array indices.
peter1138
parents: 3505
diff changeset
    58
	uint tiles;
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    59
	DrawTileSprites *renderdata; ///< Array of tile layouts.
3740
4742b3d6f37b (svn r4722) - Newstations: release station sprite layout data when uninitializing NewGRF data.
peter1138
parents: 3688
diff changeset
    60
	bool copied_renderdata;
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    61
3505
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    62
	/** Cargo threshold for choosing between little and lots of cargo
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    63
	 * @note little/lots are equivalent to the moving/loading states for vehicles
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    64
	 */
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    65
	uint16 cargo_threshold;
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    66
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    67
	uint32 cargo_triggers; ///< Bitmask of cargo types which cause trigger re-randomizing
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    68
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    69
	byte callbackmask; ///< Bitmask of callbacks to use, @see newgrf_callbacks.h
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    70
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    71
	byte flags; ///< Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    72
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    73
	byte pylons;  ///< Bitmask of base tiles (0 - 7) which should contain elrail pylons
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    74
	byte wires;   ///< Bitmask of base tiles (0 - 7) which should contain elrail wires
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    75
	byte blocked; ///< Bitmask of base tiles (0 - 7) which are blocked to trains
091f0285df7d (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    76
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    77
	byte lengths;
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    78
	byte *platforms;
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    79
	StationLayout **layouts;
5060
e942a3137724 (svn r7113) -Codechange: [NewStations] Add support for copying custom station layouts
peter1138
parents: 4893
diff changeset
    80
	bool copied_layouts;
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    81
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    82
	/**
6148
5247b66aad19 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.
peter1138
parents: 5587
diff changeset
    83
	 * NUM_CARGO real cargo plus three pseudo cargo sprite groups.
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    84
	 * Used for obtaining the sprite offset of custom sprites, and for
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    85
	 * evaluating callbacks.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    86
	 */
6148
5247b66aad19 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.
peter1138
parents: 5587
diff changeset
    87
	const struct SpriteGroup *spritegroup[NUM_CARGO + 3];
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    88
};
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    89
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    90
/**
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    91
 * Struct containing information relating to station classes.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    92
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    93
struct StationClass {
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    94
	uint32 id;          ///< ID of this class, e.g. 'DFLT', 'WAYP', etc.
3594
3c4e4feea80a (svn r4484) - Newstations: Use StringIDs instead of char*s to reference our custom names.
peter1138
parents: 3587
diff changeset
    95
	StringID name;      ///< Name of this class.
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    96
	uint stations;      ///< Number of stations in this class.
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    97
	StationSpec **spec; ///< Array of station specifications.
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    98
};
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    99
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6148
diff changeset
   100
void ResetStationClasses();
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents: 3866
diff changeset
   101
StationClassID AllocateStationClass(uint32 cls);
3642
8da309b5fd2b (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   102
void SetStationClassName(StationClassID sclass, StringID name);
8da309b5fd2b (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   103
StringID GetStationClassName(StationClassID sclass);
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6148
diff changeset
   104
StringID *BuildStationClassDropdown();
3642
8da309b5fd2b (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   105
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6148
diff changeset
   106
uint GetNumStationClasses();
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   107
uint GetNumCustomStations(StationClassID sclass);
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   108
3676
680dfa6336a1 (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   109
void SetCustomStationSpec(StationSpec *statspec);
680dfa6336a1 (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   110
const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station);
3765
a4ddbff73f9f (svn r4757) - Newstations: add saveload support for custom station speclists
peter1138
parents: 3764
diff changeset
   111
const StationSpec *GetCustomStationSpecByGrf(uint32 grfid, byte localidx);
2625
19bf7f695537 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   112
3769
7d3b35126fc1 (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   113
/* Evaluate a tile's position within a station, and return the result a bitstuffed format. */
7d3b35126fc1 (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   114
uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, int y, bool centred);
7d3b35126fc1 (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   115
2967
77b04531d7a0 (svn r3530) - NewGRF: Move station resolver to newgrf_station
peter1138
parents: 2963
diff changeset
   116
/* Get sprite offset for a given custom station and station structure (may be
3751
ce6408fdb788 (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   117
 * NULL - that means we are in a build dialog). The station structure is used
ce6408fdb788 (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   118
 * for variational sprite groups. */
ce6408fdb788 (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   119
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile);
3775
0fb5118536c3 (svn r4767) - Newstations: fix loading / use of custom ground sprites
peter1138
parents: 3769
diff changeset
   120
SpriteID GetCustomStationGroundRelocation(const StationSpec *statspec, const Station *st, TileIndex tile);
7327
d810677fb909 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 6451
diff changeset
   121
uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, const Station *st, TileIndex tile);
2967
77b04531d7a0 (svn r3530) - NewGRF: Move station resolver to newgrf_station
peter1138
parents: 2963
diff changeset
   122
3766
fc2dea6ef369 (svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
peter1138
parents: 3765
diff changeset
   123
/* Check if a rail station tile is traversable. */
fc2dea6ef369 (svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
peter1138
parents: 3765
diff changeset
   124
bool IsStationTileBlocked(TileIndex tile);
fc2dea6ef369 (svn r4758) - Newstations: add support for 'blocked' station tiles, which no train can pass.
peter1138
parents: 3765
diff changeset
   125
3789
c50647c927e4 (svn r4785) - Newstations: don't draw catenary on non-track tiles
glx
parents: 3780
diff changeset
   126
/* Check if a rail station tile is electrifiable. */
c50647c927e4 (svn r4785) - Newstations: don't draw catenary on non-track tiles
glx
parents: 3780
diff changeset
   127
bool IsStationTileElectrifiable(TileIndex tile);
c50647c927e4 (svn r4785) - Newstations: don't draw catenary on non-track tiles
glx
parents: 3780
diff changeset
   128
3587
c434d5c3dcaa (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   129
/* Allocate a StationSpec to a Station. This is called once per build operation. */
3676
680dfa6336a1 (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   130
int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec);
3587
c434d5c3dcaa (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   131
c434d5c3dcaa (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   132
/* Deallocate a StationSpec from a Station. Called when removing a single station tile. */
4190
2acef650361f (svn r5632) Replace a boolean variable in DeallocateSpecFromStation() by a return
tron
parents: 3900
diff changeset
   133
void DeallocateSpecFromStation(Station* st, byte specindex);
3587
c434d5c3dcaa (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   134
3764
f017ce73e96b (svn r4755) - Newstations: add a gui station tile drawing routine and use it in place of the existing one for waypoints.
peter1138
parents: 3752
diff changeset
   135
/* Draw representation of a station tile for GUI purposes. */
f017ce73e96b (svn r4755) - Newstations: add a gui station tile drawing routine and use it in place of the existing one for waypoints.
peter1138
parents: 3752
diff changeset
   136
bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station);
f017ce73e96b (svn r4755) - Newstations: add a gui station tile drawing routine and use it in place of the existing one for waypoints.
peter1138
parents: 3752
diff changeset
   137
2963
f28ce0549513 (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
   138
#endif /* NEWGRF_STATION_H */