OpenTTD Source 20260711-master-g3fb3006dff
railtypes.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
9
10#ifndef RAILTYPES_H
11#define RAILTYPES_H
12
13#include "table/strings.h"
14
20 { // Main Sprites
26 },
27
28 /* GUI sprites */
29 { 0x4E3, 0x4E4, 0x4E5, 0x4E6,
34 {}
35 },
36
37 {
46 },
47
48 /* strings */
49 {
50 STR_RAIL_NAME_RAILROAD,
51 STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION,
52 STR_RAIL_MENU_RAILROAD_CONSTRUCTION,
53 STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION,
54 STR_REPLACE_RAIL_VEHICLES,
55 STR_ENGINE_PREVIEW_RAILROAD_LOCOMOTIVE,
56 },
57
58 /* Offset of snow tiles */
60
61 /* Powered railtypes */
63
64 /* Compatible railtypes */
66
67 /* bridge offset */
68 0,
69
70 /* fallback_railtype */
71 0,
72
73 /* curve speed advantage (multiplier) */
74 0,
75
76 /* flags */
77 {},
78
79 /* cost multiplier */
80 8,
81
82 /* maintenance cost multiplier */
83 8,
84
85 /* acceleration type */
87
88 /* max speed */
89 0,
90
91 /* rail type label */
92 RAILTYPE_LABEL_RAIL,
93
94 /* alternate labels */
95 {},
96
97 /* map colour */
98 PC_GREY,
99
100 /* introduction date */
102
103 /* railtypes required for this to be introduced */
104 {},
105
106 /* introduction rail types */
108
109 /* sort order */
110 0 << 4 | 7,
111
112 { nullptr },
113 { nullptr },
114 {},
115 },
116
118 { // Main Sprites
124 },
125
126 /* GUI sprites */
127 {
136 {}
137 },
138
139 {
148 },
149
150 /* strings */
151 {
152 STR_RAIL_NAME_ELRAIL,
153 STR_RAIL_TOOLBAR_ELRAIL_CONSTRUCTION_CAPTION,
154 STR_RAIL_MENU_ELRAIL_CONSTRUCTION,
155 STR_BUY_VEHICLE_TRAIN_ELRAIL_CAPTION,
156 STR_REPLACE_ELRAIL_VEHICLES,
157 STR_ENGINE_PREVIEW_ELRAIL_LOCOMOTIVE,
158 },
159
160 /* Offset of snow tiles */
162
163 /* Powered railtypes */
165
166 /* Compatible railtypes */
168
169 /* bridge offset */
170 0,
171
172 /* fallback_railtype */
173 0,
174
175 /* curve speed advantage (multiplier) */
176 0,
177
178 /* flags */
180
181 /* cost multiplier */
182 12,
183
184 /* maintenance cost multiplier */
185 12,
186
187 /* acceleration type */
189
190 /* max speed */
191 0,
192
193 /* rail type label */
194 RAILTYPE_LABEL_ELECTRIC,
195
196 /* alternate labels */
197 {},
198
199 /* map colour */
200 PC_GREY,
201
202 /* introduction date */
204
205 /* railtypes required for this to be introduced */
206 {},
207
208 /* introduction rail types */
210
211 /* sort order */
212 1 << 4 | 7,
213
214 { nullptr },
215 { nullptr },
216 {},
217 },
218
220 { // Main Sprites
226 },
227
228 /* GUI sprites */
229 { 0x4E7, 0x4E8, 0x4E9, 0x4EA,
234 {}
235 },
236
237 {
246 },
247
248 /* strings */
249 {
250 STR_RAIL_NAME_MONORAIL,
251 STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION,
252 STR_RAIL_MENU_MONORAIL_CONSTRUCTION,
253 STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION,
254 STR_REPLACE_MONORAIL_VEHICLES,
255 STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE,
256 },
257
258 /* Offset of snow tiles */
260
261 /* Powered railtypes */
263
264 /* Compatible Railtypes */
266
267 /* bridge offset */
268 16,
269
270 /* fallback_railtype */
271 1,
272
273 /* curve speed advantage (multiplier) */
274 1,
275
276 /* flags */
277 {},
278
279 /* cost multiplier */
280 16,
281
282 /* maintenance cost multiplier */
283 16,
284
285 /* acceleration type */
287
288 /* max speed */
289 0,
290
291 /* rail type label */
292 RAILTYPE_LABEL_MONO,
293
294 /* alternate labels */
295 {},
296
297 /* map colour */
298 PC_GREY,
299
300 /* introduction date */
302
303 /* railtypes required for this to be introduced */
304 {},
305
306 /* introduction rail types */
308
309 /* sort order */
310 2 << 4 | 7,
311
312 { nullptr },
313 { nullptr },
314 {},
315 },
316
318 { // Main sprites
324 },
325
326 /* GUI sprites */
327 { 0x4EB, 0x4EC, 0x4EE, 0x4ED,
332 {}
333 },
334
335 {
344 },
345
346 /* strings */
347 {
348 STR_RAIL_NAME_MAGLEV,
349 STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION,
350 STR_RAIL_MENU_MAGLEV_CONSTRUCTION,
351 STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION,
352 STR_REPLACE_MAGLEV_VEHICLES,
353 STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE,
354 },
355
356 /* Offset of snow tiles */
358
359 /* Powered railtypes */
361
362 /* Compatible Railtypes */
364
365 /* bridge offset */
366 24,
367
368 /* fallback_railtype */
369 2,
370
371 /* curve speed advantage (multiplier) */
372 2,
373
374 /* flags */
375 {},
376
377 /* cost multiplier */
378 24,
379
380 /* maintenance cost multiplier */
381 24,
382
383 /* acceleration type */
385
386 /* max speed */
387 0,
388
389 /* rail type label */
390 RAILTYPE_LABEL_MAGLEV,
391
392 /* alternate labels */
393 {},
394
395 /* map colour */
396 PC_GREY,
397
398 /* introduction date */
400
401 /* railtypes required for this to be introduced */
402 {},
403
404 /* introduction rail types */
406
407 /* sort order */
408 3 << 4 | 7,
409
410 { nullptr },
411 { nullptr },
412 {},
413 },
414};
415
416#endif /* RAILTYPES_H */
This struct contains all the info that is needed to draw and construct tracks.
Definition rail.h:117
static constexpr TimerGame< struct Calendar >::Date INVALID_DATE
@ Maglev
Maglev acceleration model.
Definition engine_type.h:50
@ Normal
Default acceleration model.
Definition engine_type.h:48
@ Monorail
Monorail acceleration model.
Definition engine_type.h:49
static const CursorID SPR_CURSOR_NWSE_TRACK
Definition sprites.h:1601
static const CursorID SPR_CURSOR_NS_TRACK
Definition sprites.h:1598
static const CursorID SPR_CURSOR_TUNNEL_ELRAIL
Definition sprites.h:1621
static const CursorID SPR_CURSOR_RAIL_DEPOT
Definition sprites.h:1632
static const CursorID SPR_CURSOR_NS_MAGLEV
Definition sprites.h:1608
static const CursorID SPR_CURSOR_EW_ELRAIL
Definition sprites.h:1615
static const CursorID SPR_CURSOR_CONVERT_ELRAIL
Definition sprites.h:1638
static const CursorID SPR_CURSOR_SWNE_MAGLEV
Definition sprites.h:1609
static const CursorID SPR_CURSOR_CONVERT_MAGLEV
Definition sprites.h:1640
static const CursorID SPR_CURSOR_SWNE_MONO
Definition sprites.h:1604
static const CursorID SPR_CURSOR_AUTOMAGLEV
Definition sprites.h:1628
static const CursorID SPR_CURSOR_NWSE_MONO
Definition sprites.h:1606
static const CursorID SPR_CURSOR_MAGLEV_DEPOT
Definition sprites.h:1635
static const CursorID SPR_CURSOR_SWNE_ELRAIL
Definition sprites.h:1614
static const CursorID SPR_CURSOR_TUNNEL_MONO
Definition sprites.h:1622
static const CursorID SPR_CURSOR_EW_MONO
Definition sprites.h:1605
static const CursorID SPR_CURSOR_ELRAIL_DEPOT
Definition sprites.h:1633
static const CursorID SPR_CURSOR_NS_ELRAIL
Definition sprites.h:1613
static const CursorID SPR_CURSOR_EW_TRACK
Definition sprites.h:1600
static const CursorID SPR_CURSOR_AUTOELRAIL
Definition sprites.h:1626
static const CursorID SPR_CURSOR_SWNE_TRACK
Definition sprites.h:1599
static const CursorID SPR_CURSOR_NWSE_MAGLEV
Definition sprites.h:1611
static const CursorID SPR_CURSOR_CONVERT_RAIL
Definition sprites.h:1637
static const CursorID SPR_CURSOR_CONVERT_MONO
Definition sprites.h:1639
static const CursorID SPR_CURSOR_TUNNEL_RAIL
Definition sprites.h:1620
static const CursorID SPR_CURSOR_AUTOMONO
Definition sprites.h:1627
static const CursorID SPR_CURSOR_EW_MAGLEV
Definition sprites.h:1610
static const CursorID SPR_CURSOR_MONO_DEPOT
Definition sprites.h:1634
static const CursorID SPR_CURSOR_TUNNEL_MAGLEV
Definition sprites.h:1623
static const CursorID SPR_CURSOR_AUTORAIL
Definition sprites.h:1625
static const CursorID SPR_CURSOR_NWSE_ELRAIL
Definition sprites.h:1616
static const CursorID SPR_CURSOR_NS_MONO
Definition sprites.h:1603
static const SpriteID SPR_RAIL_TRACK_Y
Definition sprites.h:443
static const SpriteID SPR_MONO_SINGLE_EAST
Definition sprites.h:483
static const SpriteID SPR_MGLV_SINGLE_EAST
Definition sprites.h:497
static const SpriteID SPR_RAIL_SINGLE_NORTH
Definition sprites.h:439
static const uint16_t SPR_MONO_SNOW_OFFSET
Sprite number difference between a piece of monorail track on a snowy ground and the corresponding on...
Definition sprites.h:431
static const SpriteID SPR_MONO_TRACK_Y
Definition sprites.h:485
static const SpriteID SPR_MGLV_SINGLE_SOUTH
Definition sprites.h:496
static const SpriteID SPR_MONO_SINGLE_X
Definition sprites.h:479
static const SpriteID SPR_RAIL_SINGLE_X
Definition sprites.h:437
static const SpriteID SPR_MONO_TRACK_N_S
Definition sprites.h:488
static const SpriteID SPR_MONO_SINGLE_Y
Definition sprites.h:480
static const SpriteID SPR_MONO_SINGLE_NORTH
Definition sprites.h:481
static const SpriteID SPR_RAIL_SINGLE_WEST
Definition sprites.h:442
static const SpriteID SPR_RAIL_TRACK_N_S
Definition sprites.h:446
static const SpriteID SPR_MGLV_SINGLE_X
Definition sprites.h:493
static const SpriteID SPR_MGLV_SINGLE_Y
Definition sprites.h:494
static const SpriteID SPR_RAIL_TRACK_BASE
Definition sprites.h:445
static const SpriteID SPR_MONO_TRACK_BASE
Definition sprites.h:487
static const SpriteID SPR_MGLV_TRACK_BASE
Definition sprites.h:501
static const SpriteID SPR_RAIL_SINGLE_SOUTH
Definition sprites.h:440
static const uint16_t SPR_MGLV_SNOW_OFFSET
Sprite number difference between a piece of maglev track on a snowy ground and the corresponding one ...
Definition sprites.h:432
static const SpriteID SPR_MGLV_SINGLE_NORTH
Definition sprites.h:495
static const SpriteID SPR_RAIL_SINGLE_Y
Definition sprites.h:438
static const SpriteID SPR_MONO_SINGLE_WEST
Definition sprites.h:484
static const uint16_t SPR_RAIL_SNOW_OFFSET
Sprite number difference between a piece of rail track on a snowy ground and the corresponding one on...
Definition sprites.h:430
static const SpriteID SPR_MGLV_TRACK_Y
Definition sprites.h:499
static const SpriteID SPR_RAIL_SINGLE_EAST
Definition sprites.h:441
static const SpriteID SPR_MONO_SINGLE_SOUTH
Definition sprites.h:482
static const SpriteID SPR_MGLV_TRACK_N_S
Definition sprites.h:504
static const SpriteID SPR_MGLV_SINGLE_WEST
Definition sprites.h:498
static constexpr PixelColour PC_GREY
Grey palette colour.
@ Catenary
Bit number for drawing a catenary.
Definition rail.h:28
@ RAILTYPE_MONO
Monorail.
Definition rail_type.h:29
@ RAILTYPE_ELECTRIC
Electric rails.
Definition rail_type.h:28
@ RAILTYPE_RAIL
Standard non-electric rails.
Definition rail_type.h:27
@ RAILTYPE_MAGLEV
Maglev.
Definition rail_type.h:30
static const RailTypeInfo _original_railtypes[]
Global Railtype definition.
Definition railtypes.h:18
static const SpriteID SPR_BUILD_EW_ELRAIL
Definition sprites.h:1446
static const SpriteID SPR_BUILD_NS_ELRAIL
Definition sprites.h:1444
static const SpriteID SPR_IMG_DEPOT_MONO
Definition sprites.h:1507
static const SpriteID SPR_IMG_CONVERT_RAIL
Definition sprites.h:1531
static const SpriteID SPR_IMG_DEPOT_RAIL
Definition sprites.h:1505
static const SpriteID SPR_TUNNEL_ENTRY_REAR_MAGLEV
Definition sprites.h:765
static const SpriteID SPR_BRIDGE_DECKS_RAIL
Definition sprites.h:368
static const SpriteID SPR_IMG_TUNNEL_RAIL
Definition sprites.h:1527
static const SpriteID SPR_IMG_AUTOMONO
Definition sprites.h:1500
static const SpriteID SPR_IMG_TUNNEL_MONO
Definition sprites.h:1528
static const SpriteID SPR_BUILD_TUNNEL_ELRAIL
Definition sprites.h:1448
static const SpriteID SPR_TRACKS_FOR_SLOPES_MONO_BASE
Definition sprites.h:217
static const SpriteID SPR_IMG_AUTOELRAIL
Definition sprites.h:1499
static const SpriteID SPR_CROSSING_OFF_X_RAIL
Definition sprites.h:771
static const SpriteID SPR_IMG_DEPOT_ELRAIL
Definition sprites.h:1506
static const SpriteID SPR_CROSSING_OFF_X_MONO
Definition sprites.h:772
static const SpriteID SPR_IMG_CONVERT_ELRAIL
Definition sprites.h:1532
static const SpriteID SPR_TUNNEL_ENTRY_REAR_MONO
Definition sprites.h:764
static const SpriteID SPR_IMG_CONVERT_MAGLEV
Definition sprites.h:1534
static const SpriteID SPR_IMG_DEPOT_MAGLEV
Definition sprites.h:1508
static const SpriteID SPR_BRIDGE_DECKS_MGLV
Definition sprites.h:370
static const SpriteID SPR_BRIDGE_DECKS_MONO
Definition sprites.h:369
static const SpriteID SPR_TRACKS_FOR_SLOPES_MAGLEV_BASE
Definition sprites.h:218
static const SpriteID SPR_IMG_TUNNEL_MAGLEV
Definition sprites.h:1529
static const SpriteID SPR_IMG_AUTOMAGLEV
Definition sprites.h:1501
static const SpriteID SPR_IMG_AUTORAIL
Definition sprites.h:1498
static const SpriteID SPR_BUILD_X_ELRAIL
Definition sprites.h:1445
static const SpriteID SPR_CROSSING_OFF_X_MAGLEV
Definition sprites.h:773
static const SpriteID SPR_TUNNEL_ENTRY_REAR_RAIL
Definition sprites.h:763
static const SpriteID SPR_IMG_CONVERT_MONO
Definition sprites.h:1533
static const SpriteID SPR_BUILD_Y_ELRAIL
Definition sprites.h:1447
static const SpriteID SPR_TRACKS_FOR_SLOPES_RAIL_BASE
Definition sprites.h:216