src/newgrf_station.h
author glx
Mon, 21 Apr 2008 21:15:50 +0000
branchnoai
changeset 10294 7798ae816af8
parent 9837 c9ec4f82e0d0
permissions -rw-r--r--
(svn r12826) [NoAI] -Sync: with trunk r12780:12824
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     1
/* $Id$ */
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     2
2963
6645da0a5b4a (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
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     4
2963
6645da0a5b4a (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
     5
#ifndef NEWGRF_STATION_H
6645da0a5b4a (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
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
     7
9837
c9ec4f82e0d0 (svn r12503) [NoAI] -Sync: with trunk r12461:12501.
rubidium
parents: 9724
diff changeset
     8
#include "engine_type.h"
9694
e72987579514 (svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents: 9599
diff changeset
     9
#include "newgrf_callbacks.h"
3866
113de2b20059 (svn r4902) Newgrf : Introduction of the newgrf_cargo files.
belugas
parents: 3865
diff changeset
    10
#include "newgrf_cargo.h"
9724
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
    11
#include "tile_type.h"
9837
c9ec4f82e0d0 (svn r12503) [NoAI] -Sync: with trunk r12461:12501.
rubidium
parents: 9724
diff changeset
    12
#include "station_type.h"
9724
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
    13
#include "strings_type.h"
9837
c9ec4f82e0d0 (svn r12503) [NoAI] -Sync: with trunk r12461:12501.
rubidium
parents: 9724
diff changeset
    14
#include "sprite.h"
c9ec4f82e0d0 (svn r12503) [NoAI] -Sync: with trunk r12461:12501.
rubidium
parents: 9724
diff changeset
    15
#include "direction_type.h"
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    16
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    17
enum StationClassID {
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    18
	STAT_CLASS_BEGIN = 0,    ///< the lowest valid value
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    19
	STAT_CLASS_DFLT = 0,     ///< Default station class.
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    20
	STAT_CLASS_WAYP,         ///< Waypoint class.
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    21
	STAT_CLASS_MAX = 32,     ///< Maximum number of classes.
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    22
};
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    23
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    24
/** Define basic enum properties */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    25
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    26
typedef TinyEnumT<StationClassID> StationClassIDByte;
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    27
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    28
/** Allow incrementing of StationClassID variables */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    29
DECLARE_POSTFIX_INCREMENT(StationClassID);
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    30
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    31
/* Station layout for given dimensions - it is a two-dimensional array
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    32
 * where index is computed as (x * platforms) + platform. */
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    33
typedef byte *StationLayout;
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    34
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    35
struct StationSpec {
9599
949374e83b78 (svn r9632) [NoAI] -Sync with trunk r9574:9631.
rubidium
parents: 6574
diff changeset
    36
	const struct GRFFile *grffile; ///< ID of GRF file station belongs to.
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    37
	int localidx; ///< Index within GRF file of station.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    38
3780
9555a46e6ca9 (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
    39
	bool allocated; ///< Flag whether this station has been added to a station class list
9555a46e6ca9 (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
    40
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    41
	StationClassID sclass; ///< The class to which this spec belongs.
3594
31fd59e606c8 (svn r4484) - Newstations: Use StringIDs instead of char*s to reference our custom names.
peter1138
parents: 3587
diff changeset
    42
	StringID name; ///< Name of this station.
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    43
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    44
	/**
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    45
	 * Bitmask of number of platforms available for the station.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    46
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 platforms.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    47
	 */
3505
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    48
	byte disallowed_platforms;
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    49
	/**
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    50
	 * Bitmask of platform lengths available for the station.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    51
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 tiles long.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    52
	 */
3505
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    53
	byte disallowed_lengths;
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    54
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    55
	/** Number of tile layouts.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    56
	 * A minimum of 8 is required is required for stations.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    57
	 * 0-1 = plain platform
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    58
	 * 2-3 = platform with building
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    59
	 * 4-5 = platform with roof, left side
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    60
	 * 6-7 = platform with roof, right side
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    61
	 */
3570
f9749bae861e (svn r4452) - NewGRF: switch to unsigned ints for array indices.
peter1138
parents: 3505
diff changeset
    62
	uint tiles;
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    63
	DrawTileSprites *renderdata; ///< Array of tile layouts.
3740
00a9594628b1 (svn r4722) - Newstations: release station sprite layout data when uninitializing NewGRF data.
peter1138
parents: 3688
diff changeset
    64
	bool copied_renderdata;
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    65
3505
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    66
	/** Cargo threshold for choosing between little and lots of cargo
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    67
	 * @note little/lots are equivalent to the moving/loading states for vehicles
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    68
	 */
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    69
	uint16 cargo_threshold;
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    70
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    71
	uint32 cargo_triggers; ///< Bitmask of cargo types which cause trigger re-randomizing
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    72
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    73
	byte callbackmask; ///< Bitmask of callbacks to use, @see newgrf_callbacks.h
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    74
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    75
	byte flags; ///< Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    76
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    77
	byte pylons;  ///< Bitmask of base tiles (0 - 7) which should contain elrail pylons
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    78
	byte wires;   ///< Bitmask of base tiles (0 - 7) which should contain elrail wires
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    79
	byte blocked; ///< Bitmask of base tiles (0 - 7) which are blocked to trains
e9a3a6b79561 (svn r4356) - NewGRF: Load more newstation properties.
peter1138
parents: 2967
diff changeset
    80
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    81
	byte lengths;
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    82
	byte *platforms;
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    83
	StationLayout **layouts;
5060
2d577061b0ec (svn r7113) -Codechange: [NewStations] Add support for copying custom station layouts
peter1138
parents: 4893
diff changeset
    84
	bool copied_layouts;
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    85
10294
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
    86
	uint8  anim_frames;
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
    87
	uint8  anim_status;
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
    88
	uint8  anim_speed;
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
    89
	uint16 anim_triggers;
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
    90
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    91
	/**
6474
24e7ceeb25f5 (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: 5838
diff changeset
    92
	 * NUM_CARGO real cargo plus three pseudo cargo sprite groups.
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    93
	 * Used for obtaining the sprite offset of custom sprites, and for
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    94
	 * evaluating callbacks.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    95
	 */
6474
24e7ceeb25f5 (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: 5838
diff changeset
    96
	const struct SpriteGroup *spritegroup[NUM_CARGO + 3];
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    97
};
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    98
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
    99
/**
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   100
 * Struct containing information relating to station classes.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   101
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   102
struct StationClass {
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   103
	uint32 id;          ///< ID of this class, e.g. 'DFLT', 'WAYP', etc.
3594
31fd59e606c8 (svn r4484) - Newstations: Use StringIDs instead of char*s to reference our custom names.
peter1138
parents: 3587
diff changeset
   104
	StringID name;      ///< Name of this class.
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   105
	uint stations;      ///< Number of stations in this class.
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   106
	StationSpec **spec; ///< Array of station specifications.
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
   107
};
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   108
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6474
diff changeset
   109
void ResetStationClasses();
3900
4984308f9125 (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents: 3866
diff changeset
   110
StationClassID AllocateStationClass(uint32 cls);
3642
a247e07fafdf (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   111
void SetStationClassName(StationClassID sclass, StringID name);
a247e07fafdf (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   112
StringID GetStationClassName(StationClassID sclass);
a247e07fafdf (svn r4551) - NewGRF: add string handling for newstations.
peter1138
parents: 3594
diff changeset
   113
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6474
diff changeset
   114
uint GetNumStationClasses();
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   115
uint GetNumCustomStations(StationClassID sclass);
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   116
3676
48444d881fbe (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   117
void SetCustomStationSpec(StationSpec *statspec);
48444d881fbe (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   118
const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station);
3765
e057e2b740d4 (svn r4757) - Newstations: add saveload support for custom station speclists
peter1138
parents: 3764
diff changeset
   119
const StationSpec *GetCustomStationSpecByGrf(uint32 grfid, byte localidx);
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents:
diff changeset
   120
3769
2fd087fd336f (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   121
/* Evaluate a tile's position within a station, and return the result a bitstuffed format. */
2fd087fd336f (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   122
uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, int y, bool centred);
2fd087fd336f (svn r4761) - Newstations: support platform information in variable 10 (callback parameter 1) when building a station
peter1138
parents: 3767
diff changeset
   123
2967
4208a82bf0d9 (svn r3530) - NewGRF: Move station resolver to newgrf_station
peter1138
parents: 2963
diff changeset
   124
/* Get sprite offset for a given custom station and station structure (may be
3751
785501c18d0d (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   125
 * NULL - that means we are in a build dialog). The station structure is used
785501c18d0d (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   126
 * for variational sprite groups. */
785501c18d0d (svn r4739) - Newstations: remove cargo type parameter of GetCustomStationRelocation() as we can determine it internally
peter1138
parents: 3743
diff changeset
   127
SpriteID GetCustomStationRelocation(const StationSpec *statspec, const Station *st, TileIndex tile);
3775
f3f1ba3111fa (svn r4767) - Newstations: fix loading / use of custom ground sprites
peter1138
parents: 3769
diff changeset
   128
SpriteID GetCustomStationGroundRelocation(const StationSpec *statspec, const Station *st, TileIndex tile);
9694
e72987579514 (svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents: 9599
diff changeset
   129
uint16 GetStationCallback(CallbackID callback, uint32 param1, uint32 param2, const StationSpec *statspec, const Station *st, TileIndex tile);
2967
4208a82bf0d9 (svn r3530) - NewGRF: Move station resolver to newgrf_station
peter1138
parents: 2963
diff changeset
   130
3587
2eb52db0b872 (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   131
/* Allocate a StationSpec to a Station. This is called once per build operation. */
3676
48444d881fbe (svn r4593) CodeChange : Renamed spec (when using StationSpec) to statspec.
belugas
parents: 3642
diff changeset
   132
int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec);
3587
2eb52db0b872 (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   133
2eb52db0b872 (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   134
/* Deallocate a StationSpec from a Station. Called when removing a single station tile. */
4190
24d5420b6242 (svn r5632) Replace a boolean variable in DeallocateSpecFromStation() by a return
tron
parents: 3900
diff changeset
   135
void DeallocateSpecFromStation(Station* st, byte specindex);
3587
2eb52db0b872 (svn r4473) - Newstations:
peter1138
parents: 3570
diff changeset
   136
3764
ebcaf412fb3a (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
/* Draw representation of a station tile for GUI purposes. */
ebcaf412fb3a (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
   138
bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID sclass, uint station);
ebcaf412fb3a (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
   139
10294
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   140
enum StatAnimTrigger {
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   141
	STAT_ANIM_BUILT,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   142
	STAT_ANIM_NEW_CARGO,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   143
	STAT_ANIM_CARGO_TAKEN,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   144
	STAT_ANIM_TRAIN_ARRIVES,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   145
	STAT_ANIM_TRAIN_DEPARTS,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   146
	STAT_ANIM_TRAIN_LOADS,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   147
	STAT_ANIM_250_TICKS,
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   148
};
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   149
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   150
void AnimateStationTile(TileIndex tile);
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   151
void StationAnimationTrigger(const Station *st, TileIndex tile, StatAnimTrigger trigger, CargoID cargo_type = CT_INVALID);
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   152
void StationUpdateAnimTriggers(Station *st);
7798ae816af8 (svn r12826) [NoAI] -Sync: with trunk r12780:12824
glx
parents: 9837
diff changeset
   153
2963
6645da0a5b4a (svn r3525) - Rename station_newgrf.[ch] to newgrf_station.[ch], and update project files.
peter1138
parents: 2625
diff changeset
   154
#endif /* NEWGRF_STATION_H */