OpenTTD Source: src/table/elrail_data.h Source File

OpenTTD Source 15.0-RC2

elrail_data.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
13#ifndef ELRAIL_DATA_H
14#define ELRAIL_DATA_H
15
20 enum TileLocationGroup : uint8_t {
21 XEVEN_YEVEN = 0,
22 XEVEN_YODD = 1,
23 XODD_YEVEN = 2,
24 XODD_YODD = 3,
25 TLG_END
26};
27
33 enum TileSource : uint8_t {
34 TS_HOME = 0,
35 TS_NEIGHBOUR = 1,
36
37 TS_END
38};
39
40static const uint NUM_TRACKS_AT_PCP = 6;
41
43 static const Directions _allowed_ppp_on_pcp[DIAGDIR_END] = {
44 {DIR_N, DIR_E, DIR_SE, DIR_S, DIR_W, DIR_NW},
45 {DIR_N, DIR_NE, DIR_E, DIR_S, DIR_SW, DIR_W},
46 {DIR_N, DIR_E, DIR_SE, DIR_S, DIR_W, DIR_NW},
47 {DIR_N, DIR_NE, DIR_E, DIR_S, DIR_SW, DIR_W},
48};
49
55 static const Directions _owned_ppp_on_pcp[DIAGDIR_END] = {
56 {DIR_SE, DIR_S, DIR_SW, DIR_W},
57 {DIR_N, DIR_SW, DIR_W, DIR_NW},
58 {DIR_N, DIR_NE, DIR_E, DIR_NW},
59 {DIR_NE, DIR_E, DIR_SE, DIR_S},
60};
61
63 static const DiagDirection _pcp_positions[TRACK_END][2] = {
64 {DIAGDIR_NE, DIAGDIR_SW}, // X
65 {DIAGDIR_SE, DIAGDIR_NW}, // Y
66 {DIAGDIR_NW, DIAGDIR_NE}, // UPPER
67 {DIAGDIR_SE, DIAGDIR_SW}, // LOWER
68 {DIAGDIR_SW, DIAGDIR_NW}, // LEFT
69 {DIAGDIR_NE, DIAGDIR_SE}, // RIGHT
70};
71
78 static const Directions _preferred_ppp_of_track_at_pcp[TRACK_END][DIAGDIR_END] = {
79 { // X
80 {DIR_NE, DIR_SE, DIR_NW}, // NE
81 DIRECTIONS_ALL, // SE
82 {DIR_SE, DIR_SW, DIR_NW}, // SW
83 DIRECTIONS_ALL // NE
84 },
85 { // Y
86 DIRECTIONS_ALL,
87 {DIR_NE, DIR_SE, DIR_SW},
88 DIRECTIONS_ALL,
89 {DIR_SW, DIR_NW, DIR_NE},
90 },
91 { // UPPER
92 {DIR_E, DIR_N, DIR_S},
93 DIRECTIONS_ALL,
94 DIRECTIONS_ALL,
95 {DIR_W, DIR_N, DIR_S},
96 },
97 { // LOWER
98 DIRECTIONS_ALL,
99 {DIR_E, DIR_N, DIR_S},
100 {DIR_W, DIR_N, DIR_S},
101 DIRECTIONS_ALL,
102 },
103 { // LEFT
104 DIRECTIONS_ALL,
105 DIRECTIONS_ALL,
106 {DIR_S, DIR_E, DIR_W},
107 {DIR_N, DIR_E, DIR_W},
108 },
109 { // RIGHT
110 {DIR_N, DIR_E, DIR_W},
111 {DIR_S, DIR_E, DIR_W},
112 DIRECTIONS_ALL,
113 DIRECTIONS_ALL,
114 },
115};
116
117#define NUM_IGNORE_GROUPS 3
123 static const Directions _ignored_pcp[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
124 { // Ignore group 1, X and Y tracks
125 { // X even, Y even
126 DIRECTIONS_ALL,
127 {DIR_NE, DIR_SW},
128 {DIR_NW, DIR_SE},
129 DIRECTIONS_ALL,
130 }, { // X even, Y odd
131 DIRECTIONS_ALL,
132 DIRECTIONS_ALL,
133 {DIR_NW, DIR_SE},
134 {DIR_NE, DIR_SW},
135 }, { // X odd, Y even
136 {DIR_NW, DIR_SE},
137 {DIR_NE, DIR_SW},
138 DIRECTIONS_ALL,
139 DIRECTIONS_ALL,
140 }, { // X odd, Y odd
141 {DIR_NW, DIR_SE},
142 DIRECTIONS_ALL,
143 DIRECTIONS_ALL,
144 {DIR_NE, DIR_SW},
145 }
146 },
147 { // Ignore group 2, LEFT and RIGHT tracks
148 {
149 {DIR_E, DIR_W},
150 DIRECTIONS_ALL,
151 DIRECTIONS_ALL,
152 {DIR_E, DIR_W},
153 }, {
154 DIRECTIONS_ALL,
155 {DIR_E, DIR_W},
156 {DIR_E, DIR_W},
157 DIRECTIONS_ALL,
158 }, {
159 DIRECTIONS_ALL,
160 {DIR_E, DIR_W},
161 {DIR_E, DIR_W},
162 DIRECTIONS_ALL,
163 }, {
164 {DIR_E, DIR_W},
165 DIRECTIONS_ALL,
166 DIRECTIONS_ALL,
167 {DIR_E, DIR_W},
168 }
169 },
170 { // Ignore group 3, UPPER and LOWER tracks
171 {
172 {DIR_N, DIR_S},
173 {DIR_N, DIR_S},
174 DIRECTIONS_ALL,
175 DIRECTIONS_ALL,
176 }, {
177 DIRECTIONS_ALL,
178 DIRECTIONS_ALL,
179 {DIR_N, DIR_S},
180 {DIR_N, DIR_S},
181 }, {
182 DIRECTIONS_ALL,
183 DIRECTIONS_ALL,
184 {DIR_N, DIR_S},
185 {DIR_N, DIR_S},
186 }, {
187 {DIR_N, DIR_S},
188 {DIR_N, DIR_S},
189 DIRECTIONS_ALL,
190 DIRECTIONS_ALL,
191 }
192 }
193};
194
196 static const Directions _disallowed_ppp_of_track_at_pcp[TRACK_END][DIAGDIR_END] = {
197 {{DIR_SW, DIR_NE}, {}, {DIR_SW, DIR_NE}, {} }, // X
198 {{}, {DIR_NW, DIR_SE}, {}, {DIR_NW, DIR_SE}}, // Y
199 {{DIR_W, DIR_E}, {}, {}, {DIR_W, DIR_E} }, // UPPER
200 {{}, {DIR_W, DIR_E}, {DIR_W, DIR_E}, {} }, // LOWER
201 {{}, {}, {DIR_S, DIR_N}, {DIR_N, DIR_S} }, // LEFT
202 {{DIR_S, DIR_N}, {DIR_S, DIR_N}, {}, {}, }, // RIGHT
203};
204
205/* This array stores which track bits can meet at a tile edge */
206static const Track _tracks_at_pcp[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
207 {TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
208 {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
209 {TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
210 {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
211};
212
213/* takes each of the 6 track bits from the array above and
214 * assigns it to the home tile or neighbour tile */
215static const TileSource _track_source_tile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
216 {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME },
217 {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME },
218 {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_HOME , TS_NEIGHBOUR},
219 {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR},
220};
221
222/* Several PPPs maybe exist, here they are sorted in order of preference. */
223static const Direction _ppp_order[DIAGDIR_END][TLG_END][DIR_END] = { // X - Y
224 { // PCP 0
225 {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_E, DIR_S, DIR_W}, // evn - evn
226 {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, // evn - odd
227 {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_W, DIR_N, DIR_E}, // odd - evn
228 {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, // odd - odd
229 }, {// PCP 1
230 {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_E, DIR_N, DIR_W}, // evn - evn
231 {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, // evn - odd
232 {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_W, DIR_S, DIR_E}, // odd - evn
233 {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, // odd - odd
234 }, {// PCP 2
235 {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_W, DIR_N, DIR_E}, // evn - evn
236 {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, // evn - odd
237 {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_E, DIR_S, DIR_W}, // odd - evn
238 {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, // odd - odd
239 }, {// PCP 3
240 {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_W, DIR_S, DIR_E}, // evn - evn
241 {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, // evn - odd
242 {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_E, DIR_N, DIR_W}, // odd - evn
243 {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, // odd - odd
244 }
245};
246/* Geometric placement of the PCP relative to the tile origin */
247static const int8_t _x_pcp_offsets[DIAGDIR_END] = {0, 8, 16, 8};
248static const int8_t _y_pcp_offsets[DIAGDIR_END] = {8, 16, 8, 0};
249/* Geometric placement of the PPP relative to the PCP*/
250static const int8_t _x_ppp_offsets[DIR_END] = {-2, -4, -2, 0, 2, 4, 2, 0};
251static const int8_t _y_ppp_offsets[DIR_END] = {-2, 0, 2, 4, 2, 0, -2, -4};
252
256 enum PylonSpriteOffset : uint8_t {
257 PSO_Y_NE,
258 PSO_Y_SW,
259 PSO_X_NW,
260 PSO_X_SE,
261 PSO_EW_N,
262 PSO_EW_S,
263 PSO_NS_W,
264 PSO_NS_E,
265};
266
267/* The type of pylon to draw at each PPP */
268static const uint8_t _pylon_sprites[] = {
269 PSO_EW_N,
270 PSO_Y_NE,
271 PSO_NS_E,
272 PSO_X_SE,
273 PSO_EW_S,
274 PSO_Y_SW,
275 PSO_NS_W,
276 PSO_X_NW,
277};
278
282 enum WireSpriteOffset : uint8_t {
283 WSO_X_SHORT,
284 WSO_Y_SHORT,
285 WSO_EW_SHORT,
286 WSO_NS_SHORT,
287 WSO_X_SHORT_DOWN,
288 WSO_Y_SHORT_UP,
289 WSO_X_SHORT_UP,
290 WSO_Y_SHORT_DOWN,
291
292 WSO_X_SW,
293 WSO_Y_SE,
294 WSO_EW_E,
295 WSO_NS_S,
296 WSO_X_SW_DOWN,
297 WSO_Y_SE_UP,
298 WSO_X_SW_UP,
299 WSO_Y_SE_DOWN,
300
301 WSO_X_NE,
302 WSO_Y_NW,
303 WSO_EW_W,
304 WSO_NS_N,
305 WSO_X_NE_DOWN,
306 WSO_Y_NW_UP,
307 WSO_X_NE_UP,
308 WSO_Y_NW_DOWN,
309
310 WSO_ENTRANCE_SW,
311 WSO_ENTRANCE_NW,
312 WSO_ENTRANCE_NE,
313 WSO_ENTRANCE_SE,
314};
315
316 struct SortableSpriteStruct : SpriteBounds {
317 uint8_t image_offset;
318
319 constexpr SortableSpriteStruct(uint8_t image_offset, const SpriteBounds &bounds) : SpriteBounds(bounds), image_offset(image_offset) {}
320 constexpr SortableSpriteStruct(uint8_t image_offset, int8_t x_offset, int8_t y_offset, uint8_t x_size, uint8_t y_size, uint8_t z_size, int8_t z_offset) :
321 SpriteBounds({x_offset, y_offset, z_offset}, {x_size, y_size, z_size}, {}), image_offset(image_offset) {}
322};
323
325 static const uint ELRAIL_ELEVATION = 10;
327 static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT + 1;
329 static const uint ELRAIL_ELEVLOWER = ELRAIL_ELEVATION - 1;
330
331static const SortableSpriteStruct _rail_catenary_sprite_data[] = {
332/* X direction
333 * Flat tiles:
334 * Wires */
335 { WSO_X_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
336 { WSO_X_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
337 { WSO_X_SHORT, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
338
339 /* "up" tiles
340 * Wires */
341 { WSO_X_SW_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
342 { WSO_X_NE_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
343 { WSO_X_SHORT_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
344
345 /* "down" tiles
346 * Wires */
347 { WSO_X_SW_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
348 { WSO_X_NE_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
349 { WSO_X_SHORT_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
350
351
352/* Y direction
353 * Flat tiles:
354 * Wires */
355 { WSO_Y_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
356 { WSO_Y_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
357 { WSO_Y_SHORT, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
358
359 /* "up" tiles
360 * Wires */
361 { WSO_Y_SE_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
362 { WSO_Y_NW_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
363 { WSO_Y_SHORT_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
364
365 /* "down" tiles
366 * Wires */
367 { WSO_Y_SE_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
368 { WSO_Y_NW_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
369 { WSO_Y_SHORT_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
370
371/* NS Direction */
372 { WSO_NS_SHORT, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
373 { WSO_NS_SHORT, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
374
375 { WSO_NS_N, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
376 { WSO_NS_N, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
377
378 { WSO_NS_S, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
379 { WSO_NS_S, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
380
381/* EW Direction */
382 { WSO_EW_SHORT, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
383 { WSO_EW_SHORT, 15, 8, 3, 3, 1, ELRAIL_ELEVATION },
384
385 { WSO_EW_W, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
386 { WSO_EW_W, 15, 8, 3, 3, 1, ELRAIL_ELEVATION },
387
388 { WSO_EW_E, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
389 { WSO_EW_E, 15, 8, 3, 3, 1, ELRAIL_ELEVATION }
390};
391
392static const SortableSpriteStruct _rail_catenary_sprite_data_depot[] = {
393 { WSO_ENTRANCE_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
394 { WSO_ENTRANCE_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
395 { WSO_ENTRANCE_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
396 { WSO_ENTRANCE_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION }
397};
398
403 static const int8_t ELRAIL_TUNNEL_OFFSET = ELRAIL_ELEVATION - BB_Z_SEPARATOR;
404
405static const SortableSpriteStruct _rail_catenary_sprite_data_tunnel[] = {
406 { WSO_ENTRANCE_SW, {{0, 0, BB_Z_SEPARATOR}, {16, 15, 1}, {0, 7, ELRAIL_TUNNEL_OFFSET}} },
407 { WSO_ENTRANCE_NW, {{0, 0, BB_Z_SEPARATOR}, {15, 16, 1}, {7, 0, ELRAIL_TUNNEL_OFFSET}} },
408 { WSO_ENTRANCE_NE, {{0, 0, BB_Z_SEPARATOR}, {16, 15, 1}, {0, 7, ELRAIL_TUNNEL_OFFSET}} },
409 { WSO_ENTRANCE_SE, {{0, 0, BB_Z_SEPARATOR}, {15, 16, 1}, {7, 0, ELRAIL_TUNNEL_OFFSET}} }
410};
411
412
425 enum RailCatenarySprite : uint8_t {
426 WIRE_X_FLAT_SW,
427 WIRE_X_FLAT_NE,
428 WIRE_X_FLAT_BOTH,
429
430 WIRE_X_UP_SW,
431 WIRE_X_UP_NE,
432 WIRE_X_UP_BOTH,
433
434 WIRE_X_DOWN_SW,
435 WIRE_X_DOWN_NE,
436 WIRE_X_DOWN_BOTH,
437
438 WIRE_Y_FLAT_SE,
439 WIRE_Y_FLAT_NW,
440 WIRE_Y_FLAT_BOTH,
441
442 WIRE_Y_UP_SE,
443 WIRE_Y_UP_NW,
444 WIRE_Y_UP_BOTH,
445
446 WIRE_Y_DOWN_SE,
447 WIRE_Y_DOWN_NW,
448 WIRE_Y_DOWN_BOTH,
449
450 WIRE_NS_W_BOTH,
451 WIRE_NS_E_BOTH,
452
453 WIRE_NS_W_N,
454 WIRE_NS_E_N,
455
456 WIRE_NS_W_S,
457 WIRE_NS_E_S,
458
459 WIRE_EW_N_BOTH,
460 WIRE_EW_S_BOTH,
461
462 WIRE_EW_N_W,
463 WIRE_EW_S_W,
464
465 WIRE_EW_N_E,
466 WIRE_EW_S_E,
467
468 INVALID_CATENARY = 0xFF
469};
470
471/* Selects a Wire (with white and grey ends) depending on whether:
472 * a) none (should never happen)
473 * b) the first
474 * c) the second
475 * d) both
476 * PCP exists.*/
477static const RailCatenarySprite _rail_wires[5][TRACK_END][4] = {
478 { // Tileh == 0
479 {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH},
480 {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH},
481 {INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH},
482 {INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH},
483 {INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH},
484 {INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH},
485 }, { // Tileh == 3
486 {INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH},
487 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
488 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
489 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
490 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
491 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
492 }, { // Tileh == 6
493 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
494 {INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH},
495 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
496 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
497 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
498 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
499 }, { // Tileh == 9
500 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
501 {INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH},
502 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
503 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
504 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
505 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
506 }, { // Tileh == 12
507 {INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH},
508 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
509 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
510 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
511 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
512 {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
513 }
514};
515
516#endif /* ELRAIL_DATA_H */
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
Direction
Direction
Defines the 8 directions on the map.
Definition direction_type.h:24
DIR_SW
@ DIR_SW
Southwest.
Definition direction_type.h:31
DIR_NW
@ DIR_NW
Northwest.
Definition direction_type.h:33
DIR_N
@ DIR_N
North.
Definition direction_type.h:26
DIR_SE
@ DIR_SE
Southeast.
Definition direction_type.h:29
DIR_S
@ DIR_S
South.
Definition direction_type.h:30
DIR_NE
@ DIR_NE
Northeast.
Definition direction_type.h:27
DIR_END
@ DIR_END
Used to iterate.
Definition direction_type.h:34
DIR_W
@ DIR_W
West.
Definition direction_type.h:32
DIR_E
@ DIR_E
East.
Definition direction_type.h:28
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition direction_type.h:78
DIAGDIR_NE
@ DIAGDIR_NE
Northeast, upper right on your monitor.
Definition direction_type.h:80
DIAGDIR_NW
@ DIAGDIR_NW
Northwest.
Definition direction_type.h:83
DIAGDIR_SE
@ DIAGDIR_SE
Southeast.
Definition direction_type.h:81
DIAGDIR_END
@ DIAGDIR_END
Used for iterations.
Definition direction_type.h:84
DIAGDIR_SW
@ DIAGDIR_SW
Southwest.
Definition direction_type.h:82
DIRECTIONS_ALL
static constexpr Directions DIRECTIONS_ALL
All possible directions.
Definition direction_type.h:44
ELRAIL_ELEVRAISE
static const uint ELRAIL_ELEVRAISE
Wires that a draw one level higher than the north corner.
Definition elrail_data.h:327
PylonSpriteOffset
PylonSpriteOffset
Offset for pylon sprites from the base pylon sprite.
Definition elrail_data.h:256
ELRAIL_ELEVLOWER
static const uint ELRAIL_ELEVLOWER
Wires that a draw one level lower than the north corner.
Definition elrail_data.h:329
TileSource
TileSource
When determining the pylon configuration on the edge, two tiles are taken into account: the tile bein...
Definition elrail_data.h:33
RailCatenarySprite
RailCatenarySprite
Refers to a certain element of the catenary.
Definition elrail_data.h:425
_owned_ppp_on_pcp
static const Directions _owned_ppp_on_pcp[DIAGDIR_END]
Which of the PPPs are inside the tile.
Definition elrail_data.h:55
WireSpriteOffset
WireSpriteOffset
Offset for wire sprites from the base wire sprite.
Definition elrail_data.h:282
_disallowed_ppp_of_track_at_pcp
static const Directions _disallowed_ppp_of_track_at_pcp[TRACK_END][DIAGDIR_END]
Which pylons can definitely NOT be built.
Definition elrail_data.h:196
_pcp_positions
static const DiagDirection _pcp_positions[TRACK_END][2]
Maps a track bit onto two PCP positions.
Definition elrail_data.h:63
_ignored_pcp
static const Directions _ignored_pcp[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END]
In case we have a straight line, we place pylon only every two tiles, so there are certain tiles whic...
Definition elrail_data.h:123
_preferred_ppp_of_track_at_pcp
static const Directions _preferred_ppp_of_track_at_pcp[TRACK_END][DIAGDIR_END]
Preferred points of each trackbit.
Definition elrail_data.h:78
ELRAIL_TUNNEL_OFFSET
static const int8_t ELRAIL_TUNNEL_OFFSET
In tunnelheads, the bounding box for wires covers nearly the full tile, and is lowered a bit.
Definition elrail_data.h:403
_allowed_ppp_on_pcp
static const Directions _allowed_ppp_on_pcp[DIAGDIR_END]
Which PPPs are possible at all on a given PCP.
Definition elrail_data.h:43
TileLocationGroup
TileLocationGroup
Tile Location group.
Definition elrail_data.h:20
ELRAIL_ELEVATION
static const uint ELRAIL_ELEVATION
Distance between wire and rail.
Definition elrail_data.h:325
SortableSpriteStruct
Definition elrail_data.h:316
SpriteBounds
Definition sprite.h:18
TILE_HEIGHT
static constexpr uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in ZOOM_BASE.
Definition tile_type.h:18
Track
Track
These are used to specify a single track.
Definition track_type.h:19
TRACK_Y
@ TRACK_Y
Track along the y-axis (north-west to south-east)
Definition track_type.h:22
TRACK_LOWER
@ TRACK_LOWER
Track in the lower corner of the tile (south)
Definition track_type.h:24
TRACK_END
@ TRACK_END
Used for iterations.
Definition track_type.h:27
TRACK_LEFT
@ TRACK_LEFT
Track in the left corner of the tile (west)
Definition track_type.h:25
TRACK_RIGHT
@ TRACK_RIGHT
Track in the right corner of the tile (east)
Definition track_type.h:26
TRACK_X
@ TRACK_X
Track along the x-axis (north-east to south-west)
Definition track_type.h:21
TRACK_UPPER
@ TRACK_UPPER
Track in the upper corner of the tile (north)
Definition track_type.h:23
BB_Z_SEPARATOR
static constexpr int BB_Z_SEPARATOR
Separates the bridge/tunnel from the things under/above it.
Definition viewport_type.h:93