OpenTTD Source  20241108-master-g80f628063a
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 <http://www.gnu.org/licenses/>.
6  */
7 
13 #ifndef ELRAIL_DATA_H
14 #define ELRAIL_DATA_H
15 
20 enum TLG {
21  XEVEN_YEVEN = 0,
22  XEVEN_YODD = 1,
23  XODD_YEVEN = 2,
24  XODD_YODD = 3,
25  TLG_END
26 };
27 
33 enum TileSource {
34  TS_HOME = 0,
35  TS_NEIGHBOUR = 1,
36 
37  TS_END
38 };
39 
40 static const uint NUM_TRACKS_AT_PCP = 6;
41 
43 static const uint8_t AllowedPPPonPCP[DIAGDIR_END] = {
44  1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
45  1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
46  1 << DIR_N | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W | 1 << DIR_NW,
47  1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
48 };
49 
55 static const uint8_t OwnedPPPonPCP[DIAGDIR_END] = {
56  1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
57  1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW,
58  1 << DIR_N | 1 << DIR_NE | 1 << DIR_E | 1 << DIR_NW,
59  1 << DIR_NE | 1 << DIR_E | 1 << DIR_SE | 1 << DIR_S
60 };
61 
63 static const DiagDirection PCPpositions[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 
72 #define PCP_NOT_ON_TRACK 0xFF
80  { // X
81  1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE
82  PCP_NOT_ON_TRACK, // SE
83  1 << DIR_SE | 1 << DIR_SW | 1 << DIR_NW, // SW
84  PCP_NOT_ON_TRACK // NE
85  }, { // Y
86  PCP_NOT_ON_TRACK,
87  1 << DIR_NE | 1 << DIR_SE | 1 << DIR_SW,
88  PCP_NOT_ON_TRACK,
89  1 << DIR_SW | 1 << DIR_NW | 1 << DIR_NE
90  }, { // UPPER
91  1 << DIR_E | 1 << DIR_N | 1 << DIR_S,
92  PCP_NOT_ON_TRACK,
93  PCP_NOT_ON_TRACK,
94  1 << DIR_W | 1 << DIR_N | 1 << DIR_S
95  }, { // LOWER
96  PCP_NOT_ON_TRACK,
97  1 << DIR_E | 1 << DIR_N | 1 << DIR_S,
98  1 << DIR_W | 1 << DIR_N | 1 << DIR_S,
99  PCP_NOT_ON_TRACK
100  }, { // LEFT
101  PCP_NOT_ON_TRACK,
102  PCP_NOT_ON_TRACK,
103  1 << DIR_S | 1 << DIR_E | 1 << DIR_W,
104  1 << DIR_N | 1 << DIR_E | 1 << DIR_W
105  }, { // RIGHT
106  1 << DIR_N | 1 << DIR_E | 1 << DIR_W,
107  1 << DIR_S | 1 << DIR_E | 1 << DIR_W,
108  PCP_NOT_ON_TRACK,
109  PCP_NOT_ON_TRACK
110  }
111 };
112 #undef PCP_NOT_ON_TRACK
113 
114 
115 #define NUM_IGNORE_GROUPS 3
116 #define IGNORE_NONE 0xFF
122 static const uint8_t IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
123  { // Ignore group 1, X and Y tracks
124  { // X even, Y even
125  IGNORE_NONE,
126  1 << DIR_NE | 1 << DIR_SW,
127  1 << DIR_NW | 1 << DIR_SE,
128  IGNORE_NONE
129  }, { // X even, Y odd
130  IGNORE_NONE,
131  IGNORE_NONE,
132  1 << DIR_NW | 1 << DIR_SE,
133  1 << DIR_NE | 1 << DIR_SW
134  }, { // X odd, Y even
135  1 << DIR_NW | 1 << DIR_SE,
136  1 << DIR_NE | 1 << DIR_SW,
137  IGNORE_NONE,
138  IGNORE_NONE
139  }, { // X odd, Y odd
140  1 << DIR_NW | 1 << DIR_SE,
141  IGNORE_NONE,
142  IGNORE_NONE,
143  1 << DIR_NE | 1 << DIR_SW
144  }
145  },
146  { // Ignore group 2, LEFT and RIGHT tracks
147  {
148  1 << DIR_E | 1 << DIR_W,
149  IGNORE_NONE,
150  IGNORE_NONE,
151  1 << DIR_E | 1 << DIR_W
152  }, {
153  IGNORE_NONE,
154  1 << DIR_E | 1 << DIR_W,
155  1 << DIR_E | 1 << DIR_W,
156  IGNORE_NONE
157  }, {
158  IGNORE_NONE,
159  1 << DIR_E | 1 << DIR_W,
160  1 << DIR_E | 1 << DIR_W,
161  IGNORE_NONE
162  }, {
163  1 << DIR_E | 1 << DIR_W,
164  IGNORE_NONE,
165  IGNORE_NONE,
166  1 << DIR_E | 1 << DIR_W
167  }
168  },
169  { // Ignore group 3, UPPER and LOWER tracks
170  {
171  1 << DIR_N | 1 << DIR_S,
172  1 << DIR_N | 1 << DIR_S,
173  IGNORE_NONE,
174  IGNORE_NONE
175  }, {
176  IGNORE_NONE,
177  IGNORE_NONE,
178  1 << DIR_N | 1 << DIR_S,
179  1 << DIR_N | 1 << DIR_S
180  }, {
181  IGNORE_NONE,
182  IGNORE_NONE,
183  1 << DIR_N | 1 << DIR_S ,
184  1 << DIR_N | 1 << DIR_S
185  }, {
186  1 << DIR_N | 1 << DIR_S,
187  1 << DIR_N | 1 << DIR_S,
188  IGNORE_NONE,
189  IGNORE_NONE
190  }
191  }
192 };
193 
194 #undef NO_IGNORE
195 
198  {1 << DIR_SW | 1 << DIR_NE, 0, 1 << DIR_SW | 1 << DIR_NE, 0 }, // X
199  {0, 1 << DIR_NW | 1 << DIR_SE, 0, 1 << DIR_NW | 1 << DIR_SE}, // Y
200  {1 << DIR_W | 1 << DIR_E, 0, 0, 1 << DIR_W | 1 << DIR_E }, // UPPER
201  {0, 1 << DIR_W | 1 << DIR_E, 1 << DIR_W | 1 << DIR_E, 0 }, // LOWER
202  {0, 0, 1 << DIR_S | 1 << DIR_N, 1 << DIR_N | 1 << DIR_S }, // LEFT
203  {1 << DIR_S | 1 << DIR_N, 1 << DIR_S | 1 << DIR_N, 0, 0, }, // RIGHT
204 };
205 
206 /* This array stores which track bits can meet at a tile edge */
207 static const Track TracksAtPCP[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
212 };
213 
214 /* takes each of the 6 track bits from the array above and
215  * assigns it to the home tile or neighbour tile */
216 static const TileSource TrackSourceTile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
217  {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME },
218  {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME },
219  {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_HOME , TS_NEIGHBOUR},
220  {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR},
221 };
222 
223 /* Several PPPs maybe exist, here they are sorted in order of preference. */
224 static const Direction PPPorder[DIAGDIR_END][TLG_END][DIR_END] = { // X - Y
225  { // PCP 0
226  {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_E, DIR_S, DIR_W}, // evn - evn
227  {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, // evn - odd
228  {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_W, DIR_N, DIR_E}, // odd - evn
229  {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, // odd - odd
230  }, {// PCP 1
231  {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_E, DIR_N, DIR_W}, // evn - evn
232  {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, // evn - odd
233  {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_W, DIR_S, DIR_E}, // odd - evn
234  {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, // odd - odd
235  }, {// PCP 2
236  {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_W, DIR_N, DIR_E}, // evn - evn
237  {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, // evn - odd
238  {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_E, DIR_S, DIR_W}, // odd - evn
239  {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, // odd - odd
240  }, {// PCP 3
241  {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_W, DIR_S, DIR_E}, // evn - evn
242  {DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, // evn - odd
243  {DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_E, DIR_N, DIR_W}, // odd - evn
244  {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, // odd - odd
245  }
246 };
247 /* Geometric placement of the PCP relative to the tile origin */
248 static const int8_t x_pcp_offsets[DIAGDIR_END] = {0, 8, 16, 8};
249 static const int8_t y_pcp_offsets[DIAGDIR_END] = {8, 16, 8, 0};
250 /* Geometric placement of the PPP relative to the PCP*/
251 static const int8_t x_ppp_offsets[DIR_END] = {-2, -4, -2, 0, 2, 4, 2, 0};
252 static const int8_t y_ppp_offsets[DIR_END] = {-2, 0, 2, 4, 2, 0, -2, -4};
253 
258  PSO_Y_NE,
259  PSO_Y_SW,
260  PSO_X_NW,
261  PSO_X_SE,
262  PSO_EW_N,
263  PSO_EW_S,
264  PSO_NS_W,
265  PSO_NS_E,
266 };
267 
268 /* The type of pylon to draw at each PPP */
269 static const uint8_t pylon_sprites[] = {
270  PSO_EW_N,
271  PSO_Y_NE,
272  PSO_NS_E,
273  PSO_X_SE,
274  PSO_EW_S,
275  PSO_Y_SW,
276  PSO_NS_W,
277  PSO_X_NW,
278 };
279 
284  WSO_X_SHORT,
285  WSO_Y_SHORT,
286  WSO_EW_SHORT,
287  WSO_NS_SHORT,
288  WSO_X_SHORT_DOWN,
289  WSO_Y_SHORT_UP,
290  WSO_X_SHORT_UP,
291  WSO_Y_SHORT_DOWN,
292 
293  WSO_X_SW,
294  WSO_Y_SE,
295  WSO_EW_E,
296  WSO_NS_S,
297  WSO_X_SW_DOWN,
298  WSO_Y_SE_UP,
299  WSO_X_SW_UP,
300  WSO_Y_SE_DOWN,
301 
302  WSO_X_NE,
303  WSO_Y_NW,
304  WSO_EW_W,
305  WSO_NS_N,
306  WSO_X_NE_DOWN,
307  WSO_Y_NW_UP,
308  WSO_X_NE_UP,
309  WSO_Y_NW_DOWN,
310 
311  WSO_ENTRANCE_SW,
312  WSO_ENTRANCE_NW,
313  WSO_ENTRANCE_NE,
314  WSO_ENTRANCE_SE,
315 };
316 
318  uint8_t image_offset;
319  int8_t x_offset;
320  int8_t y_offset;
321  int8_t x_size;
322  int8_t y_size;
323  int8_t z_size;
324  int8_t z_offset;
325 };
326 
328 static const uint ELRAIL_ELEVATION = 10;
332 static const uint ELRAIL_ELEVLOWER = ELRAIL_ELEVATION - 1;
333 
334 static const SortableSpriteStruct RailCatenarySpriteData[] = {
335 /* X direction
336  * Flat tiles:
337  * Wires */
338  { WSO_X_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
339  { WSO_X_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
340  { WSO_X_SHORT, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
341 
342  /* "up" tiles
343  * Wires */
344  { WSO_X_SW_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
345  { WSO_X_NE_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
346  { WSO_X_SHORT_UP, 0, 7, 15, 8, 1, ELRAIL_ELEVRAISE },
347 
348  /* "down" tiles
349  * Wires */
350  { WSO_X_SW_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
351  { WSO_X_NE_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
352  { WSO_X_SHORT_DOWN, 0, 7, 15, 8, 1, ELRAIL_ELEVLOWER },
353 
354 
355 /* Y direction
356  * Flat tiles:
357  * Wires */
358  { WSO_Y_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
359  { WSO_Y_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
360  { WSO_Y_SHORT, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
361 
362  /* "up" tiles
363  * Wires */
364  { WSO_Y_SE_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
365  { WSO_Y_NW_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
366  { WSO_Y_SHORT_UP, 7, 0, 8, 15, 1, ELRAIL_ELEVRAISE },
367 
368  /* "down" tiles
369  * Wires */
370  { WSO_Y_SE_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
371  { WSO_Y_NW_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
372  { WSO_Y_SHORT_DOWN, 7, 0, 8, 15, 1, ELRAIL_ELEVLOWER },
373 
374 /* NS Direction */
375  { WSO_NS_SHORT, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
376  { WSO_NS_SHORT, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
377 
378  { WSO_NS_N, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
379  { WSO_NS_N, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
380 
381  { WSO_NS_S, 8, 0, 8, 8, 1, ELRAIL_ELEVATION },
382  { WSO_NS_S, 0, 8, 8, 8, 1, ELRAIL_ELEVATION },
383 
384 /* EW Direction */
385  { WSO_EW_SHORT, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
386  { WSO_EW_SHORT, 15, 8, 3, 3, 1, ELRAIL_ELEVATION },
387 
388  { WSO_EW_W, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
389  { WSO_EW_W, 15, 8, 3, 3, 1, ELRAIL_ELEVATION },
390 
391  { WSO_EW_E, 7, 0, 1, 1, 1, ELRAIL_ELEVATION },
392  { WSO_EW_E, 15, 8, 3, 3, 1, ELRAIL_ELEVATION }
393 };
394 
395 static const SortableSpriteStruct RailCatenarySpriteData_Depot[] = {
396  { WSO_ENTRANCE_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
397  { WSO_ENTRANCE_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
398  { WSO_ENTRANCE_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
399  { WSO_ENTRANCE_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION }
400 };
401 
402 static const SortableSpriteStruct RailCatenarySpriteData_Tunnel[] = {
403  { WSO_ENTRANCE_SW, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
404  { WSO_ENTRANCE_NW, 7, 0, 1, 15, 1, ELRAIL_ELEVATION },
405  { WSO_ENTRANCE_NE, 0, 7, 15, 1, 1, ELRAIL_ELEVATION },
406  { WSO_ENTRANCE_SE, 7, 0, 1, 15, 1, ELRAIL_ELEVATION }
407 };
408 
409 
423  WIRE_X_FLAT_SW,
424  WIRE_X_FLAT_NE,
425  WIRE_X_FLAT_BOTH,
426 
427  WIRE_X_UP_SW,
428  WIRE_X_UP_NE,
429  WIRE_X_UP_BOTH,
430 
431  WIRE_X_DOWN_SW,
432  WIRE_X_DOWN_NE,
433  WIRE_X_DOWN_BOTH,
434 
435  WIRE_Y_FLAT_SE,
436  WIRE_Y_FLAT_NW,
437  WIRE_Y_FLAT_BOTH,
438 
439  WIRE_Y_UP_SE,
440  WIRE_Y_UP_NW,
441  WIRE_Y_UP_BOTH,
442 
443  WIRE_Y_DOWN_SE,
444  WIRE_Y_DOWN_NW,
445  WIRE_Y_DOWN_BOTH,
446 
447  WIRE_NS_W_BOTH,
448  WIRE_NS_E_BOTH,
449 
450  WIRE_NS_W_N,
451  WIRE_NS_E_N,
452 
453  WIRE_NS_W_S,
454  WIRE_NS_E_S,
455 
456  WIRE_EW_N_BOTH,
457  WIRE_EW_S_BOTH,
458 
459  WIRE_EW_N_W,
460  WIRE_EW_S_W,
461 
462  WIRE_EW_N_E,
463  WIRE_EW_S_E,
464 
465  INVALID_CATENARY = 0xFF
466 };
467 
468 /* Selects a Wire (with white and grey ends) depending on whether:
469  * a) none (should never happen)
470  * b) the first
471  * c) the second
472  * d) both
473  * PCP exists.*/
474 static const RailCatenarySprite Wires[5][TRACK_END][4] = {
475  { // Tileh == 0
476  {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH},
477  {INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH},
478  {INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH},
479  {INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH},
480  {INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH},
481  {INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH},
482  }, { // Tileh == 3
483  {INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH},
484  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
485  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
486  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
487  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
488  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
489  }, { // Tileh == 6
490  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
491  {INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH},
492  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
493  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
494  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
495  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
496  }, { // Tileh == 9
497  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
498  {INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH},
499  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
500  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
501  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
502  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
503  }, { // Tileh == 12
504  {INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH},
505  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
506  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
507  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
508  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
509  {INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
510  }
511 };
512 
513 #endif /* ELRAIL_DATA_H */
Direction
Defines the 8 directions on the map.
@ DIR_SW
Southwest.
@ DIR_NW
Northwest.
@ DIR_N
North.
@ DIR_SE
Southeast.
@ DIR_S
South.
@ DIR_NE
Northeast.
@ DIR_END
Used to iterate.
@ DIR_W
West.
@ DIR_E
East.
DiagDirection
Enumeration for diagonal directions.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
@ DIAGDIR_NW
Northwest.
@ DIAGDIR_SE
Southeast.
@ DIAGDIR_END
Used for iterations.
@ DIAGDIR_SW
Southwest.
TLG
Tile Location group.
Definition: elrail_data.h:20
PylonSpriteOffset
Offset for pylon sprites from the base pylon sprite.
Definition: elrail_data.h:257
static const uint ELRAIL_ELEVRAISE
Wires that a draw one level higher than the north corner.
Definition: elrail_data.h:330
static const uint ELRAIL_ELEVLOWER
Wires that a draw one level lower than the north corner.
Definition: elrail_data.h:332
RailCatenarySprite
Refers to a certain element of the catenary.
Definition: elrail_data.h:422
WireSpriteOffset
Offset for wire sprites from the base wire sprite.
Definition: elrail_data.h:283
static const uint8_t IgnoredPCP[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:122
static const uint8_t OwnedPPPonPCP[DIAGDIR_END]
Which of the PPPs are inside the tile.
Definition: elrail_data.h:55
static const uint8_t PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END]
Preferred points of each trackbit.
Definition: elrail_data.h:79
static const uint8_t DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END]
Which pylons can definitely NOT be built.
Definition: elrail_data.h:197
static const uint8_t AllowedPPPonPCP[DIAGDIR_END]
Which PPPs are possible at all on a given PCP.
Definition: elrail_data.h:43
static const DiagDirection PCPpositions[TRACK_END][2]
Maps a track bit onto two PCP positions.
Definition: elrail_data.h:63
TileSource
When determining the pylon configuration on the edge, two tiles are taken into account: the tile bein...
Definition: elrail_data.h:33
static const uint ELRAIL_ELEVATION
Distance between wire and rail.
Definition: elrail_data.h:328
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_BASE.
Definition: tile_type.h:18
Track
These are used to specify a single track.
Definition: track_type.h:19
@ TRACK_Y
Track along the y-axis (north-west to south-east)
Definition: track_type.h:22
@ TRACK_LOWER
Track in the lower corner of the tile (south)
Definition: track_type.h:24
@ TRACK_END
Used for iterations.
Definition: track_type.h:27
@ TRACK_LEFT
Track in the left corner of the tile (west)
Definition: track_type.h:25
@ TRACK_RIGHT
Track in the right corner of the tile (east)
Definition: track_type.h:26
@ TRACK_X
Track along the x-axis (north-east to south-west)
Definition: track_type.h:21
@ TRACK_UPPER
Track in the upper corner of the tile (north)
Definition: track_type.h:23