author | darkvater |
Sun, 14 Nov 2004 11:04:59 +0000 | |
changeset 393 | 82c2bf635cd9 |
parent 389 | 2d394eeba5e5 |
child 399 | ad3dcbfd2d48 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef STATION_H |
2 |
#define STATION_H |
|
3 |
||
4 |
#include "vehicle.h" |
|
5 |
||
6 |
typedef struct GoodsEntry { |
|
7 |
uint16 waiting_acceptance; |
|
8 |
byte days_since_pickup; |
|
9 |
byte rating; |
|
10 |
byte enroute_from; |
|
11 |
byte enroute_time; |
|
12 |
byte last_speed; |
|
13 |
byte last_age; |
|
14 |
} GoodsEntry; |
|
15 |
||
16 |
struct Station { |
|
17 |
TileIndex xy; |
|
18 |
TileIndex bus_tile; |
|
19 |
TileIndex lorry_tile; |
|
20 |
TileIndex train_tile; |
|
21 |
TileIndex airport_tile; |
|
22 |
TileIndex dock_tile; |
|
23 |
Town *town; |
|
24 |
// alpha_order is obsolete since savegame format 4 |
|
25 |
byte alpha_order_obsolete; |
|
26 |
uint16 string_id; |
|
27 |
||
28 |
ViewportSign sign; |
|
29 |
||
30 |
uint16 had_vehicle_of_type; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
123
diff
changeset
|
31 |
|
0 | 32 |
byte time_since_load; |
33 |
byte time_since_unload; |
|
34 |
byte delete_ctr; |
|
35 |
byte owner; |
|
36 |
byte facilities; |
|
37 |
byte airport_type; |
|
38 |
byte truck_stop_status; |
|
39 |
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
|
40 |
byte blocked_months_obsolete; |
0 | 41 |
|
42 |
// trainstation width/height |
|
43 |
byte trainst_w, trainst_h; |
|
44 |
||
393
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
45 |
byte class_id; // custom graphics station class |
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
46 |
byte stat_id; // custom graphics station id in the @class_id class |
0 | 47 |
uint16 build_date; |
48 |
||
49 |
//uint16 airport_flags; |
|
393
82c2bf635cd9
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
darkvater
parents:
389
diff
changeset
|
50 |
uint32 airport_flags; |
0 | 51 |
uint16 index; |
52 |
||
53 |
VehicleID last_vehicle; |
|
54 |
GoodsEntry goods[NUM_CARGO]; |
|
55 |
}; |
|
56 |
||
57 |
enum { |
|
58 |
FACIL_TRAIN = 1, |
|
59 |
FACIL_TRUCK_STOP = 2, |
|
60 |
FACIL_BUS_STOP = 4, |
|
61 |
FACIL_AIRPORT = 8, |
|
62 |
FACIL_DOCK = 0x10, |
|
63 |
}; |
|
64 |
||
65 |
enum { |
|
66 |
// HVOT_PENDING_DELETE = 1<<0, // not needed anymore |
|
67 |
HVOT_TRAIN = 1<<1, |
|
68 |
HVOT_BUS = 1 << 2, |
|
69 |
HVOT_TRUCK = 1 << 3, |
|
70 |
HVOT_AIRCRAFT = 1<<4, |
|
71 |
HVOT_SHIP = 1 << 5, |
|
72 |
HVOT_BUOY = 1 << 6 |
|
73 |
}; |
|
74 |
||
75 |
void ModifyStationRatingAround(TileIndex tile, byte owner, int amount, uint radius); |
|
76 |
||
55
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
0
diff
changeset
|
77 |
TileIndex GetStationTileForVehicle(Vehicle *v, Station *st); |
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
0
diff
changeset
|
78 |
|
0 | 79 |
void ShowStationViewWindow(int station); |
80 |
void UpdateAllStationVirtCoord(); |
|
81 |
||
82 |
VARDEF Station _stations[250]; |
|
243
9a40daa560ae
(svn r244) -Fix: Stations were not sorted for non-player-0 players
darkvater
parents:
193
diff
changeset
|
83 |
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
|
84 |
VARDEF bool _global_station_sort_dirty; |
0 | 85 |
|
86 |
#define DEREF_STATION(i) (&_stations[i]) |
|
87 |
#define FOR_ALL_STATIONS(st) for(st=_stations; st != endof(_stations); st++) |
|
88 |
||
89 |
||
90 |
void GetProductionAroundTiles(uint *produced, uint tile, int w, int h); |
|
91 |
void GetAcceptanceAroundTiles(uint *accepts, uint tile, int w, int h); |
|
92 |
uint GetStationPlatforms(Station *st, uint tile); |
|
384
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
93 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
94 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
95 |
typedef struct DrawTileSeqStruct { |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
96 |
int8 delta_x; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
97 |
int8 delta_y; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
98 |
int8 delta_z; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
99 |
byte width,height; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
100 |
byte unk; // 'depth', just z-size; TODO: rename |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
101 |
uint32 image; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
102 |
} DrawTileSeqStruct; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
103 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
104 |
typedef struct DrawTileSprites { |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
105 |
SpriteID ground_sprite; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
106 |
DrawTileSeqStruct const *seq; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
107 |
} DrawTileSprites; |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
108 |
|
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
109 |
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
bf1303e754ff
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents:
243
diff
changeset
|
110 |
|
389
2d394eeba5e5
(svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
celestar
parents:
384
diff
changeset
|
111 |
void SetCustomStation(uint32 classid, byte stid, DrawTileSprites *data, byte tiles); |
2d394eeba5e5
(svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
celestar
parents:
384
diff
changeset
|
112 |
DrawTileSprites *GetCustomStation(uint32 classid, byte stid); |
2d394eeba5e5
(svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
celestar
parents:
384
diff
changeset
|
113 |
int GetCustomStationsCount(uint32 classid); |
2d394eeba5e5
(svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
celestar
parents:
384
diff
changeset
|
114 |
|
0 | 115 |
#endif /* STATION_H */ |