OpenTTD Source 20241224-master-gf74b0cf984
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 <http://www.gnu.org/licenses/>.
6 */
7
13#ifndef RAILTYPES_H
14#define RAILTYPES_H
15
21 { // Main Sprites
22 { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
23 SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
24 SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
25 SPR_CROSSING_OFF_X_RAIL,
26 SPR_TUNNEL_ENTRY_REAR_RAIL
27 },
28
29 /* GUI sprites */
30 { 0x4E3, 0x4E4, 0x4E5, 0x4E6,
31 SPR_IMG_AUTORAIL,
32 SPR_IMG_DEPOT_RAIL,
33 SPR_IMG_TUNNEL_RAIL,
34 SPR_IMG_CONVERT_RAIL,
35 {}
36 },
37
38 {
39 SPR_CURSOR_NS_TRACK,
40 SPR_CURSOR_SWNE_TRACK,
41 SPR_CURSOR_EW_TRACK,
42 SPR_CURSOR_NWSE_TRACK,
43 SPR_CURSOR_AUTORAIL,
44 SPR_CURSOR_RAIL_DEPOT,
45 SPR_CURSOR_TUNNEL_RAIL,
46 SPR_CURSOR_CONVERT_RAIL
47 },
48
49 /* strings */
50 {
51 STR_RAIL_NAME_RAILROAD,
52 STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION,
53 STR_RAIL_MENU_RAILROAD_CONSTRUCTION,
54 STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION,
55 STR_REPLACE_RAIL_VEHICLES,
56 STR_ENGINE_PREVIEW_RAILROAD_LOCOMOTIVE,
57 },
58
59 /* Offset of snow tiles */
60 SPR_RAIL_SNOW_OFFSET,
61
62 /* Powered railtypes */
64
65 /* Compatible railtypes */
67
68 /* bridge offset */
69 0,
70
71 /* fallback_railtype */
72 0,
73
74 /* curve speed advantage (multiplier) */
75 0,
76
77 /* flags */
79
80 /* cost multiplier */
81 8,
82
83 /* maintenance cost multiplier */
84 8,
85
86 /* acceleration type */
87 0,
88
89 /* max speed */
90 0,
91
92 /* rail type label */
93 RAILTYPE_LABEL_RAIL,
94
95 /* alternate labels */
97
98 /* map colour */
99 0x0A,
100
101 /* introduction date */
103
104 /* railtypes required for this to be introduced */
106
107 /* introduction rail types */
109
110 /* sort order */
111 0 << 4 | 7,
112
113 { nullptr },
114 { nullptr },
115 },
116
118 { // Main Sprites
119 { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
120 SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
121 SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
122 SPR_CROSSING_OFF_X_RAIL,
123 SPR_TUNNEL_ENTRY_REAR_RAIL
124 },
125
126 /* GUI sprites */
127 {
128 SPR_BUILD_NS_ELRAIL,
129 SPR_BUILD_X_ELRAIL,
130 SPR_BUILD_EW_ELRAIL,
131 SPR_BUILD_Y_ELRAIL,
132 SPR_IMG_AUTOELRAIL,
133 SPR_IMG_DEPOT_ELRAIL,
134 SPR_BUILD_TUNNEL_ELRAIL,
135 SPR_IMG_CONVERT_ELRAIL,
136 {}
137 },
138
139 {
140 SPR_CURSOR_NS_ELRAIL,
141 SPR_CURSOR_SWNE_ELRAIL,
142 SPR_CURSOR_EW_ELRAIL,
143 SPR_CURSOR_NWSE_ELRAIL,
144 SPR_CURSOR_AUTOELRAIL,
145 SPR_CURSOR_ELRAIL_DEPOT,
146 SPR_CURSOR_TUNNEL_ELRAIL,
147 SPR_CURSOR_CONVERT_ELRAIL
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 */
161 SPR_RAIL_SNOW_OFFSET,
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 */
188 0,
189
190 /* max speed */
191 0,
192
193 /* rail type label */
194 RAILTYPE_LABEL_ELECTRIC,
195
196 /* alternate labels */
198
199 /* map colour */
200 0x0A,
201
202 /* introduction date */
204
205 /* railtypes required for this to be introduced */
207
208 /* introduction rail types */
210
211 /* sort order */
212 1 << 4 | 7,
213
214 { nullptr },
215 { nullptr },
216 },
217
219 { // Main Sprites
220 { SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_X, SPR_MONO_SINGLE_Y,
221 SPR_MONO_SINGLE_NORTH, SPR_MONO_SINGLE_SOUTH, SPR_MONO_SINGLE_EAST, SPR_MONO_SINGLE_WEST,
222 SPR_TRACKS_FOR_SLOPES_MONO_BASE,
223 SPR_CROSSING_OFF_X_MONO,
224 SPR_TUNNEL_ENTRY_REAR_MONO
225 },
226
227 /* GUI sprites */
228 { 0x4E7, 0x4E8, 0x4E9, 0x4EA,
229 SPR_IMG_AUTOMONO,
230 SPR_IMG_DEPOT_MONO,
231 SPR_IMG_TUNNEL_MONO,
232 SPR_IMG_CONVERT_MONO,
233 {}
234 },
235
236 {
237 SPR_CURSOR_NS_MONO,
238 SPR_CURSOR_SWNE_MONO,
239 SPR_CURSOR_EW_MONO,
240 SPR_CURSOR_NWSE_MONO,
241 SPR_CURSOR_AUTOMONO,
242 SPR_CURSOR_MONO_DEPOT,
243 SPR_CURSOR_TUNNEL_MONO,
244 SPR_CURSOR_CONVERT_MONO
245 },
246
247 /* strings */
248 {
249 STR_RAIL_NAME_MONORAIL,
250 STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION,
251 STR_RAIL_MENU_MONORAIL_CONSTRUCTION,
252 STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION,
253 STR_REPLACE_MONORAIL_VEHICLES,
254 STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE,
255 },
256
257 /* Offset of snow tiles */
258 SPR_MONO_SNOW_OFFSET,
259
260 /* Powered railtypes */
262
263 /* Compatible Railtypes */
265
266 /* bridge offset */
267 16,
268
269 /* fallback_railtype */
270 1,
271
272 /* curve speed advantage (multiplier) */
273 1,
274
275 /* flags */
276 RTFB_NONE,
277
278 /* cost multiplier */
279 16,
280
281 /* maintenance cost multiplier */
282 16,
283
284 /* acceleration type */
285 1,
286
287 /* max speed */
288 0,
289
290 /* rail type label */
291 RAILTYPE_LABEL_MONO,
292
293 /* alternate labels */
295
296 /* map colour */
297 0x0A,
298
299 /* introduction date */
301
302 /* railtypes required for this to be introduced */
304
305 /* introduction rail types */
307
308 /* sort order */
309 2 << 4 | 7,
310
311 { nullptr },
312 { nullptr },
313 },
314
316 { // Main sprites
317 { SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_X, SPR_MGLV_SINGLE_Y,
318 SPR_MGLV_SINGLE_NORTH, SPR_MGLV_SINGLE_SOUTH, SPR_MGLV_SINGLE_EAST, SPR_MGLV_SINGLE_WEST,
319 SPR_TRACKS_FOR_SLOPES_MAGLEV_BASE,
320 SPR_CROSSING_OFF_X_MAGLEV,
321 SPR_TUNNEL_ENTRY_REAR_MAGLEV
322 },
323
324 /* GUI sprites */
325 { 0x4EB, 0x4EC, 0x4EE, 0x4ED,
326 SPR_IMG_AUTOMAGLEV,
327 SPR_IMG_DEPOT_MAGLEV,
328 SPR_IMG_TUNNEL_MAGLEV,
329 SPR_IMG_CONVERT_MAGLEV,
330 {}
331 },
332
333 {
334 SPR_CURSOR_NS_MAGLEV,
335 SPR_CURSOR_SWNE_MAGLEV,
336 SPR_CURSOR_EW_MAGLEV,
337 SPR_CURSOR_NWSE_MAGLEV,
338 SPR_CURSOR_AUTOMAGLEV,
339 SPR_CURSOR_MAGLEV_DEPOT,
340 SPR_CURSOR_TUNNEL_MAGLEV,
341 SPR_CURSOR_CONVERT_MAGLEV
342 },
343
344 /* strings */
345 {
346 STR_RAIL_NAME_MAGLEV,
347 STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION,
348 STR_RAIL_MENU_MAGLEV_CONSTRUCTION,
349 STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION,
350 STR_REPLACE_MAGLEV_VEHICLES,
351 STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE,
352 },
353
354 /* Offset of snow tiles */
355 SPR_MGLV_SNOW_OFFSET,
356
357 /* Powered railtypes */
359
360 /* Compatible Railtypes */
362
363 /* bridge offset */
364 24,
365
366 /* fallback_railtype */
367 2,
368
369 /* curve speed advantage (multiplier) */
370 2,
371
372 /* flags */
373 RTFB_NONE,
374
375 /* cost multiplier */
376 24,
377
378 /* maintenance cost multiplier */
379 24,
380
381 /* acceleration type */
382 2,
383
384 /* max speed */
385 0,
386
387 /* rail type label */
388 RAILTYPE_LABEL_MAGLEV,
389
390 /* alternate labels */
392
393 /* map colour */
394 0x0A,
395
396 /* introduction date */
398
399 /* railtypes required for this to be introduced */
401
402 /* introduction rail types */
404
405 /* sort order */
406 3 << 4 | 7,
407
408 { nullptr },
409 { nullptr },
410 },
411};
412
413#endif /* RAILTYPES_H */
This struct contains all the info that is needed to draw and construct tracks.
Definition rail.h:127
static constexpr TimerGame< struct Calendar >::Date INVALID_DATE
Representation of an invalid date.
std::vector< RailTypeLabel > RailTypeLabelList
List of rail type labels.
Definition rail.h:122
@ RTFB_CATENARY
Value for drawing a catenary.
Definition rail.h:37
@ RTFB_NONE
All flags cleared.
Definition rail.h:36
@ RAILTYPES_ELECTRIC
Electrified rails.
Definition rail_type.h:47
@ RAILTYPES_MAGLEV
Ever fast maglev.
Definition rail_type.h:49
@ RAILTYPES_RAIL
Non-electrified rails.
Definition rail_type.h:46
@ RAILTYPES_NONE
No rail types.
Definition rail_type.h:45
@ RAILTYPES_MONO
Monorail!
Definition rail_type.h:48
static const RailTypeInfo _original_railtypes[]
Global Railtype definition.
Definition railtypes.h:19