author | tron |
Mon, 10 Apr 2006 07:15:58 +0000 | |
changeset 3491 | 35d747bb5e82 |
parent 3474 | acaa3ba24f2e |
child 3540 | 3bcf5348842b |
permissions | -rw-r--r-- |
3315
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
2 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
3 |
#ifndef STATION_MAP_H |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
4 |
#define STATION_MAP_H |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
5 |
|
3315
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
6 |
#include "station.h" |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
7 |
|
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
8 |
static inline StationID GetStationIndex(TileIndex t) |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
9 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
10 |
assert(IsTileType(t, MP_STATION)); |
3315
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
11 |
return (StationID)_m[t].m2; |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
12 |
} |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
13 |
|
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
14 |
static inline Station* GetStationByTile(TileIndex t) |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
15 |
{ |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
16 |
return GetStation(GetStationIndex(t)); |
c9d989783c55
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
tron
parents:
diff
changeset
|
17 |
} |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
18 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
19 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
20 |
enum { |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
21 |
RAILWAY_BASE = 0x0, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
22 |
AIRPORT_BASE = 0x8, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
23 |
TRUCK_BASE = 0x43, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
24 |
BUS_BASE = 0x47, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
25 |
OILRIG_BASE = 0x4B, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
26 |
DOCK_BASE = 0x4C, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
27 |
DOCK_BASE_WATER_PART = 0x50, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
28 |
BUOY_BASE = 0x52, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
29 |
AIRPORT_BASE_EXTENDED = 0x53, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
30 |
|
3353
d7309672109b
(svn r4143) -[FS#86]: Fixed and obi-wan error in station_map.h that would lead to assertions in the airport handling (of international airports)
celestar
parents:
3338
diff
changeset
|
31 |
BASE_END = 0x73 |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
32 |
}; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
33 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
34 |
enum { |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
35 |
RAILWAY_SIZE = AIRPORT_BASE - RAILWAY_BASE, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
36 |
AIRPORT_SIZE = TRUCK_BASE - AIRPORT_BASE, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
37 |
TRUCK_SIZE = BUS_BASE - TRUCK_BASE, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
38 |
BUS_SIZE = OILRIG_BASE - BUS_BASE, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
39 |
DOCK_SIZE_TOTAL = BUOY_BASE - DOCK_BASE, |
3353
d7309672109b
(svn r4143) -[FS#86]: Fixed and obi-wan error in station_map.h that would lead to assertions in the airport handling (of international airports)
celestar
parents:
3338
diff
changeset
|
40 |
AIRPORT_SIZE_EXTENDED = BASE_END - AIRPORT_BASE_EXTENDED |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
41 |
}; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
42 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
43 |
typedef enum HangarTiles { |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
44 |
HANGAR_TILE_0 = 32, |
3337
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
45 |
HANGAR_TILE_1 = 65, |
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
46 |
HANGAR_TILE_2 = 86 |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
47 |
} HangarTiles; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
48 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
49 |
typedef enum StationType { |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
50 |
STATION_RAIL, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
51 |
STATION_HANGAR, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
52 |
STATION_AIRPORT, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
53 |
STATION_TRUCK, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
54 |
STATION_BUS, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
55 |
STATION_OILRIG, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
56 |
STATION_DOCK, |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
57 |
STATION_BUOY |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
58 |
} StationType; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
59 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
60 |
StationType GetStationType(TileIndex); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
61 |
|
3360
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
62 |
static inline RoadStopType GetRoadStopType(TileIndex t) |
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
63 |
{ |
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
64 |
assert(GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS); |
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
65 |
return GetStationType(t) == STATION_TRUCK ? RS_TRUCK : RS_BUS; |
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
66 |
} |
4fddbd48d36c
(svn r4155) -Changed GetRoadStopByTile to use GetStationType and moved it. TODO: unify RS_TRUCK and STATION_TRUCK (same for bus)
celestar
parents:
3353
diff
changeset
|
67 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
68 |
static inline bool IsRailwayStation(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
69 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
70 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
71 |
return _m[t].m5 < RAILWAY_BASE + RAILWAY_SIZE; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
72 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
73 |
|
3442
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
74 |
static inline bool IsRailwayStationTile(TileIndex t) |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
75 |
{ |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
76 |
return IsTileType(t, MP_STATION) && IsRailwayStation(t); |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
77 |
} |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
78 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
79 |
static inline bool IsHangar(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
80 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
81 |
assert(IsTileType(t, MP_STATION)); |
3337
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
82 |
return |
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
83 |
_m[t].m5 == HANGAR_TILE_0 || |
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
84 |
_m[t].m5 == HANGAR_TILE_1 || |
3a9b086c6369
(svn r4119) There's one more possible hangar tile. Check for this in IsHangar(), too
tron
parents:
3334
diff
changeset
|
85 |
_m[t].m5 == HANGAR_TILE_2; |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
86 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
87 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
88 |
static inline bool IsAirport(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
89 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
90 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
91 |
return |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
92 |
IS_INT_INSIDE(_m[t].m5, AIRPORT_BASE, AIRPORT_BASE + AIRPORT_SIZE) || |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
93 |
IS_INT_INSIDE(_m[t].m5, AIRPORT_BASE_EXTENDED, AIRPORT_BASE_EXTENDED + AIRPORT_SIZE_EXTENDED); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
94 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
95 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
96 |
static inline bool IsTruckStop(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
97 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
98 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
99 |
return IS_INT_INSIDE(_m[t].m5, TRUCK_BASE, TRUCK_BASE + TRUCK_SIZE); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
100 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
101 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
102 |
static inline bool IsBusStop(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
103 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
104 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
105 |
return IS_INT_INSIDE(_m[t].m5, BUS_BASE, BUS_BASE + BUS_SIZE); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
106 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
107 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
108 |
static inline bool IsRoadStop(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
109 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
110 |
return IsTruckStop(t) || IsBusStop(t); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
111 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
112 |
|
3404
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
113 |
static inline bool IsRoadStopTile(TileIndex t) |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
114 |
{ |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
115 |
return IsTileType(t, MP_STATION) && IsRoadStop(t); |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
116 |
} |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
117 |
|
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
118 |
/** |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
119 |
* Gets the direction the road stop entrance points towards. |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
120 |
*/ |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
121 |
static inline DiagDirection GetRoadStopDir(TileIndex tile) |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
122 |
{ |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
123 |
assert(IsRoadStopTile(tile)); |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
124 |
return (_m[tile].m5 - TRUCK_BASE) & 3; |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
125 |
} |
eb8ebfe5df67
(svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency
celestar
parents:
3371
diff
changeset
|
126 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
127 |
static inline bool IsOilRig(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
128 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
129 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
130 |
return _m[t].m5 == OILRIG_BASE; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
131 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
132 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
133 |
static inline bool IsDock(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
134 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
135 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
136 |
return IS_INT_INSIDE(_m[t].m5, DOCK_BASE, DOCK_BASE + DOCK_SIZE_TOTAL); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
137 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
138 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
139 |
static inline bool IsBuoy_(TileIndex t) // XXX _ due to naming conflict |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
140 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
141 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
142 |
return _m[t].m5 == BUOY_BASE; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
143 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
144 |
|
3442
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
145 |
static inline bool IsBuoyTile(TileIndex t) |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
146 |
{ |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
147 |
return IsTileType(t, MP_STATION) && IsBuoy_(t); |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
148 |
} |
41d828e2d5ab
(svn r4272) -Codechange: Moved the map-accessing stuff from station.h into station_map.h
celestar
parents:
3404
diff
changeset
|
149 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
150 |
|
3338
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
151 |
static inline bool IsHangarTile(TileIndex t) |
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
152 |
{ |
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
153 |
return IsTileType(t, MP_STATION) && IsHangar(t); |
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
154 |
} |
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
155 |
|
7cff208f0446
(svn r4120) Use the new station functions where appropriate
tron
parents:
3337
diff
changeset
|
156 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
157 |
static inline Axis GetRailStationAxis(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
158 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
159 |
assert(IsRailwayStation(t)); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
160 |
return HASBIT(_m[t].m5, 0) ? AXIS_Y : AXIS_X; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
161 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
162 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
163 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
164 |
static inline Track GetRailStationTrack(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
165 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
166 |
return GetRailStationAxis(t) == AXIS_X ? TRACK_X : TRACK_Y; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
167 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
168 |
|
3444
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
169 |
static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2) |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
170 |
{ |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
171 |
assert(IsRailwayStationTile(t2)); |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
172 |
return |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
173 |
IsRailwayStationTile(t1) && |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
174 |
IsCompatibleRail(GetRailType(t1), GetRailType(t2)) && |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
175 |
GetRailStationAxis(t1) == GetRailStationAxis(t2); |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
176 |
} |
80cfd2f70922
(svn r4275) -Codechange: Use of map accessor functions inside station_map.h when possible
celestar
parents:
3443
diff
changeset
|
177 |
|
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
178 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
179 |
static inline DiagDirection GetDockDirection(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
180 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
181 |
assert(IsTileType(t, MP_STATION)); |
3370
d0c7cab7b5f4
(svn r4168) -Fix: Fixed a typo in previous commit
celestar
parents:
3369
diff
changeset
|
182 |
assert(_m[t].m5 < DOCK_BASE_WATER_PART); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
183 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
184 |
return (DiagDirection)(_m[t].m5 - DOCK_BASE); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
185 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
186 |
|
3472
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
187 |
static inline TileIndexDiffC GetDockOffset(TileIndex t) |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
188 |
{ |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
189 |
static const TileIndexDiffC buoy_offset = {0, 0}; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
190 |
static const TileIndexDiffC oilrig_offset = {2, 0}; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
191 |
static const TileIndexDiffC dock_offset[DIAGDIR_END] = { |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
192 |
{-2, 0}, |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
193 |
{ 0, 2}, |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
194 |
{ 2, 0}, |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
195 |
{ 0, -2}, |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
196 |
}; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
197 |
assert(IsTileType(t, MP_STATION)); |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
198 |
|
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
199 |
if (IsBuoy_(t)) return buoy_offset; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
200 |
if (IsOilRig(t)) return oilrig_offset; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
201 |
|
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
202 |
assert(IsDock(t)); |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
203 |
|
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
204 |
return dock_offset[GetDockDirection(t)]; |
04173b5ed0d2
(svn r4317) -Codechange: More map accessors for ship_cmd. it is now map-access free, but still requires a huge cleanup
celestar
parents:
3444
diff
changeset
|
205 |
} |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
206 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
207 |
static inline bool IsCustomStationSprite(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
208 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
209 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
210 |
return HASBIT(_m[t].m3, 4); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
211 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
212 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
213 |
static inline void SetCustomStationSprite(TileIndex t, byte sprite) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
214 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
215 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
216 |
SETBIT(_m[t].m3, 4); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
217 |
_m[t].m4 = sprite; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
218 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
219 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
220 |
static inline uint GetCustomStationSprite(TileIndex t) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
221 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3360
diff
changeset
|
222 |
assert(IsTileType(t, MP_STATION)); |
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
223 |
return _m[t].m4; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
224 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
225 |
|
3474 | 226 |
static inline byte GetStationGfx(TileIndex t) |
227 |
{ |
|
228 |
assert(IsTileType(t, MP_STATION)); |
|
229 |
return _m[t].m5; |
|
230 |
} |
|
231 |
||
3334
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
232 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
233 |
static inline void MakeStation(TileIndex t, Owner o, StationID sid, byte m5) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
234 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
235 |
SetTileType(t, MP_STATION); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
236 |
SetTileOwner(t, o); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
237 |
_m[t].m2 = sid; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
238 |
_m[t].m3 = 0; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
239 |
_m[t].m4 = 0; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
240 |
_m[t].m5 = m5; |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
241 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
242 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
243 |
static inline void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
244 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
245 |
MakeStation(t, o, sid, section + a); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
246 |
SetRailType(t, rt); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
247 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
248 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
249 |
static inline void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, DiagDirection d) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
250 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
251 |
MakeStation(t, o, sid, (rst == RS_BUS ? BUS_BASE : TRUCK_BASE) + d); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
252 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
253 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
254 |
static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
255 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
256 |
MakeStation(t, o, sid, section); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
257 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
258 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
259 |
static inline void MakeBuoy(TileIndex t, StationID sid) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
260 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
261 |
MakeStation(t, OWNER_NONE, sid, BUOY_BASE); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
262 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
263 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
264 |
static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
265 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
266 |
MakeStation(t, o, sid, DOCK_BASE + d); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
267 |
MakeStation(t + TileOffsByDir(d), o, sid, DOCK_BASE_WATER_PART + DiagDirToAxis(d)); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
268 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
269 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
270 |
static inline void MakeOilrig(TileIndex t, StationID sid) |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
271 |
{ |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
272 |
MakeStation(t, OWNER_NONE, sid, OILRIG_BASE); |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
273 |
} |
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
274 |
|
2999d2ddc0f9
(svn r4113) Moved all relevant map functions for stations to station_map.[ch]
celestar
parents:
3315
diff
changeset
|
275 |
#endif |