station.h
author pasky
Fri, 26 Nov 2004 21:14:42 +0000
changeset 513 a6eaa0d97d8d
parent 449 2856e9ce0754
child 568 b0d0df062880
permissions -rw-r--r--
(svn r828) Everyone welcome table/sprites.h in trunk - so far not in use besides enum AnimCursors migrated from viewport.h and tiny fragment of enum Sprites migrated from ttd.h (we should slowly convert trunk to use the symbolic names instead of sprite numbers too to reduce the delta to map). Ported from the map branch, where the work was done by Darkvater, Celestar and Tron.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     1
#ifndef STATION_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     2
#define STATION_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
405
415546028e8d (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky)
darkvater
parents: 403
diff changeset
     4
#include "sprite.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#include "vehicle.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
typedef struct GoodsEntry {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
	uint16 waiting_acceptance;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
	byte days_since_pickup;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
	byte rating;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
	byte enroute_from;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
	byte enroute_time;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
	byte last_speed;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
	byte last_age;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
} GoodsEntry;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
struct Station {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
	TileIndex xy;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
	TileIndex bus_tile;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
	TileIndex lorry_tile;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
	TileIndex train_tile;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    22
	TileIndex airport_tile;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
	TileIndex dock_tile;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
	Town *town;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    25
	// alpha_order is obsolete since savegame format 4
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
	byte alpha_order_obsolete;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    27
	uint16 string_id;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
	ViewportSign sign;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
	uint16 had_vehicle_of_type;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 123
diff changeset
    32
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
	byte time_since_load;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
	byte time_since_unload;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    35
	byte delete_ctr;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
	byte owner;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
	byte facilities;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
	byte airport_type;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    39
	byte truck_stop_status;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
	byte bus_stop_status;
123
d550772c61e6 (svn r124) Prepared code for removal of block_months variable in next major savegame version
dominik
parents: 55
diff changeset
    41
	byte blocked_months_obsolete;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
	// trainstation width/height
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
	byte trainst_w, trainst_h;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
393
e1128b94f3fb (svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents: 389
diff changeset
    46
	byte class_id; // custom graphics station class
e1128b94f3fb (svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents: 389
diff changeset
    47
	byte stat_id; // custom graphics station id in the @class_id class
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    48
	uint16 build_date;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    49
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
	//uint16 airport_flags;
393
e1128b94f3fb (svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents: 389
diff changeset
    51
	uint32 airport_flags;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
	uint16 index;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
	VehicleID last_vehicle;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
	GoodsEntry goods[NUM_CARGO];
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    58
enum {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    59
	FACIL_TRAIN = 1,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    60
	FACIL_TRUCK_STOP = 2,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
	FACIL_BUS_STOP = 4,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
	FACIL_AIRPORT = 8,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
	FACIL_DOCK = 0x10,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    66
enum {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
//	HVOT_PENDING_DELETE = 1<<0, // not needed anymore
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    68
	HVOT_TRAIN = 1<<1,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    69
	HVOT_BUS = 1 << 2,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
	HVOT_TRUCK = 1 << 3,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    71
	HVOT_AIRCRAFT = 1<<4,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
	HVOT_SHIP = 1 << 5,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    73
	HVOT_BUOY = 1 << 6
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    74
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    75
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    76
void ModifyStationRatingAround(TileIndex tile, byte owner, int amount, uint radius);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    77
55
73fae6c6568e (svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents: 0
diff changeset
    78
TileIndex GetStationTileForVehicle(Vehicle *v, Station *st);
73fae6c6568e (svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents: 0
diff changeset
    79
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    80
void ShowStationViewWindow(int station);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    81
void UpdateAllStationVirtCoord();
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    82
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    83
VARDEF Station _stations[250];
243
9a40daa560ae (svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents: 193
diff changeset
    84
VARDEF bool _station_sort_dirty[MAX_PLAYERS];
9a40daa560ae (svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents: 193
diff changeset
    85
VARDEF bool _global_station_sort_dirty;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    86
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    87
#define DEREF_STATION(i) (&_stations[i])
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    88
#define FOR_ALL_STATIONS(st) for(st=_stations; st != endof(_stations); st++)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    89
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    90
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    91
void GetProductionAroundTiles(uint *produced, uint tile, int w, int h);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    92
void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    93
uint GetStationPlatforms(Station *st, uint tile);
384
809833b4068d (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 243
diff changeset
    94
809833b4068d (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 243
diff changeset
    95
449
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
    96
/* Station layout for given dimensions - it is a two-dimensional array
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
    97
 * where index is computed as (x * platforms) + platform. */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
    98
typedef byte *StationLayout;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
    99
399
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   100
struct StationSpec {
400
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   101
	uint32 grfid;
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   102
	int localidx; // per-GRFFile station index + 1; SetCustomStation() takes care of this
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   103
438
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   104
	enum StationClass {
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   105
		STAT_CLASS_NONE, // unused station slot or so
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   106
		STAT_CLASS_DFLT, // default station class
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   107
		STAT_CLASS_WAYP, // waypoints
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   108
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   109
		/* TODO: When we actually support custom classes, they are
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   110
		 * going to be allocated dynamically (with some classid->sclass
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   111
		 * mapping, there's a TTDPatch limit on 16 custom classes in
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   112
		 * the whole game at the same time) with base at
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   113
		 * STAT_CLASS_CUSTOM. --pasky */
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   114
		STAT_CLASS_CUSTOM, // some custom class
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   115
	} sclass;
400
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   116
449
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   117
	/* Bitmask of platform numbers/lengths available for the station.  Bits
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   118
	 * 0..6 correspond to 1..7, while bit 7 corresponds to >7 platforms or
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   119
	 * lenght. */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   120
	byte allowed_platforms;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   121
	byte allowed_lengths;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   122
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   123
	/* Custom sprites */
399
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   124
	byte tiles;
449
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   125
	/* 00 = plain platform
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   126
	 * 02 = platform with building
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   127
	 * 04 = platform with roof, left side
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   128
	 * 06 = platform with roof, right side
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   129
	 *
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   130
	 * These numbers are used for stations in NE-SW direction, or these
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   131
	 * numbers plus one for stations in the NW-SE direction.  */
399
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   132
	DrawTileSprites renderdata[8];
403
dc7aef17c13e (svn r600) -newgrf: Relocation offset for custom station sprites is now stored separately, making it possible to show different sprites in waypoint selection dialog (pasky).
darkvater
parents: 400
diff changeset
   133
449
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   134
	/* Custom layouts */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   135
	/* The layout array is organized like [lenghts][platforms], both being
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   136
	 * dynamic arrays, the field itself is length*platforms array containing
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   137
	 * indexes to @renderdata (only even numbers allowed) for the given
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   138
	 * station tile. */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   139
	/* @lengths is length of the @platforms and @layouts arrays, that is
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   140
	 * number of maximal length for which the layout is defined (since
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   141
	 * arrays are indexed from 0, the length itself is at [length - 1]). */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   142
	byte lengths;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   143
	/* @platforms is array of number of platforms defined for each length.
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   144
	 * Zero means no platforms defined. */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   145
	byte *platforms;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   146
	/* @layout is @layouts-sized array of @platforms-sized arrays,
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   147
	 * containing pointers to length*platforms-sized arrays or NULL if
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   148
	 * default OTTD station layout should be used for stations of these
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   149
	 * dimensions. */
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   150
	StationLayout **layouts;
2856e9ce0754 (svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
tron
parents: 438
diff changeset
   151
408
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   152
	/* Sprite offsets for renderdata->seq->image. spritegroup[0] is default
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   153
	 * whilst spritegroup[1] is "CID_PURCHASE". */
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   154
	struct SpriteGroup spritegroup[2];
399
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   155
};
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   156
400
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   157
/* Here, @stid is local per-GRFFile station index. If spec->localidx is not yet
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   158
 * set, it gets new dynamically allocated global index and spec->localidx is
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   159
 * set to @stid, otherwise we take it as that we are replacing it and try to
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   160
 * search for it first (that isn't much fast but we do it only very seldom). */
399
b156fa8bcd63 (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky).
darkvater
parents: 393
diff changeset
   161
void SetCustomStation(byte stid, struct StationSpec *spec);
400
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   162
/* Here, @stid is global station index (in continous range 0..GetCustomStationsCount())
ad545734c8de (svn r592) -newgrf: Dynamically allocate global custom station IDs (pasky).
darkvater
parents: 399
diff changeset
   163
 * (lookup is therefore very fast as we do this very frequently). */
438
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   164
struct StationSpec *GetCustomStation(enum StationClass sclass, byte stid);
408
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   165
/* Get sprite offset for a given custom station and station structure (may be
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   166
 * NULL if ctype is set - that means we are in a build dialog). The station
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   167
 * structure is used for variational sprite groups. */
48da21eb9ff2 (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents: 405
diff changeset
   168
uint32 GetCustomStationRelocation(struct StationSpec *spec, struct Station *stat, byte ctype);
438
f80cc59e69c2 (svn r647) Cleanup custom station classes handling. (pasky)
miham
parents: 408
diff changeset
   169
int GetCustomStationsCount(enum StationClass sclass);
389
16ee9854091e (svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
celestar
parents: 384
diff changeset
   170
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   171
#endif /* STATION_H */