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

OpenTTD Source 15.0-RC2

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
13#ifndef RAILTYPES_H
14#define RAILTYPES_H
15
16#include "table/strings.h"
17
21 static const RailTypeInfo _original_railtypes[] = {
23 { // Main Sprites
24 { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
25 SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
26 SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
27 SPR_CROSSING_OFF_X_RAIL,
28 SPR_TUNNEL_ENTRY_REAR_RAIL, SPR_BRIDGE_DECKS_RAIL,
29 },
30
31 /* GUI sprites */
32 { 0x4E3, 0x4E4, 0x4E5, 0x4E6,
33 SPR_IMG_AUTORAIL,
34 SPR_IMG_DEPOT_RAIL,
35 SPR_IMG_TUNNEL_RAIL,
36 SPR_IMG_CONVERT_RAIL,
37 {}
38 },
39
40 {
41 SPR_CURSOR_NS_TRACK,
42 SPR_CURSOR_SWNE_TRACK,
43 SPR_CURSOR_EW_TRACK,
44 SPR_CURSOR_NWSE_TRACK,
45 SPR_CURSOR_AUTORAIL,
46 SPR_CURSOR_RAIL_DEPOT,
47 SPR_CURSOR_TUNNEL_RAIL,
48 SPR_CURSOR_CONVERT_RAIL
49 },
50
51 /* strings */
52 {
53 STR_RAIL_NAME_RAILROAD,
54 STR_RAIL_TOOLBAR_RAILROAD_CONSTRUCTION_CAPTION,
55 STR_RAIL_MENU_RAILROAD_CONSTRUCTION,
56 STR_BUY_VEHICLE_TRAIN_RAIL_CAPTION,
57 STR_REPLACE_RAIL_VEHICLES,
58 STR_ENGINE_PREVIEW_RAILROAD_LOCOMOTIVE,
59 },
60
61 /* Offset of snow tiles */
62 SPR_RAIL_SNOW_OFFSET,
63
64 /* Powered railtypes */
65 {RAILTYPE_RAIL, RAILTYPE_ELECTRIC},
66
67 /* Compatible railtypes */
68 {RAILTYPE_RAIL, RAILTYPE_ELECTRIC},
69
70 /* bridge offset */
71 0,
72
73 /* fallback_railtype */
74 0,
75
76 /* curve speed advantage (multiplier) */
77 0,
78
79 /* flags */
80 {},
81
82 /* cost multiplier */
83 8,
84
85 /* maintenance cost multiplier */
86 8,
87
88 /* acceleration type */
89 VehicleAccelerationModel::Normal,
90
91 /* max speed */
92 0,
93
94 /* rail type label */
95 RAILTYPE_LABEL_RAIL,
96
97 /* alternate labels */
98 {},
99
100 /* map colour */
101 PC_GREY,
102
103 /* introduction date */
104 CalendarTime::INVALID_DATE,
105
106 /* railtypes required for this to be introduced */
107 {},
108
109 /* introduction rail types */
110 {RAILTYPE_RAIL},
111
112 /* sort order */
113 0 << 4 | 7,
114
115 { nullptr },
116 { nullptr },
117 {},
118 },
119
121 { // Main Sprites
122 { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
123 SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
124 SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
125 SPR_CROSSING_OFF_X_RAIL,
126 SPR_TUNNEL_ENTRY_REAR_RAIL, SPR_BRIDGE_DECKS_RAIL,
127 },
128
129 /* GUI sprites */
130 {
131 SPR_BUILD_NS_ELRAIL,
132 SPR_BUILD_X_ELRAIL,
133 SPR_BUILD_EW_ELRAIL,
134 SPR_BUILD_Y_ELRAIL,
135 SPR_IMG_AUTOELRAIL,
136 SPR_IMG_DEPOT_ELRAIL,
137 SPR_BUILD_TUNNEL_ELRAIL,
138 SPR_IMG_CONVERT_ELRAIL,
139 {}
140 },
141
142 {
143 SPR_CURSOR_NS_ELRAIL,
144 SPR_CURSOR_SWNE_ELRAIL,
145 SPR_CURSOR_EW_ELRAIL,
146 SPR_CURSOR_NWSE_ELRAIL,
147 SPR_CURSOR_AUTOELRAIL,
148 SPR_CURSOR_ELRAIL_DEPOT,
149 SPR_CURSOR_TUNNEL_ELRAIL,
150 SPR_CURSOR_CONVERT_ELRAIL
151 },
152
153 /* strings */
154 {
155 STR_RAIL_NAME_ELRAIL,
156 STR_RAIL_TOOLBAR_ELRAIL_CONSTRUCTION_CAPTION,
157 STR_RAIL_MENU_ELRAIL_CONSTRUCTION,
158 STR_BUY_VEHICLE_TRAIN_ELRAIL_CAPTION,
159 STR_REPLACE_ELRAIL_VEHICLES,
160 STR_ENGINE_PREVIEW_ELRAIL_LOCOMOTIVE,
161 },
162
163 /* Offset of snow tiles */
164 SPR_RAIL_SNOW_OFFSET,
165
166 /* Powered railtypes */
167 {RAILTYPE_ELECTRIC},
168
169 /* Compatible railtypes */
170 {RAILTYPE_RAIL, RAILTYPE_ELECTRIC},
171
172 /* bridge offset */
173 0,
174
175 /* fallback_railtype */
176 0,
177
178 /* curve speed advantage (multiplier) */
179 0,
180
181 /* flags */
182 {RailTypeFlag::Catenary},
183
184 /* cost multiplier */
185 12,
186
187 /* maintenance cost multiplier */
188 12,
189
190 /* acceleration type */
191 VehicleAccelerationModel::Normal,
192
193 /* max speed */
194 0,
195
196 /* rail type label */
197 RAILTYPE_LABEL_ELECTRIC,
198
199 /* alternate labels */
200 {},
201
202 /* map colour */
203 PC_GREY,
204
205 /* introduction date */
206 CalendarTime::INVALID_DATE,
207
208 /* railtypes required for this to be introduced */
209 {},
210
211 /* introduction rail types */
212 {RAILTYPE_ELECTRIC},
213
214 /* sort order */
215 1 << 4 | 7,
216
217 { nullptr },
218 { nullptr },
219 {},
220 },
221
223 { // Main Sprites
224 { SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_X, SPR_MONO_SINGLE_Y,
225 SPR_MONO_SINGLE_NORTH, SPR_MONO_SINGLE_SOUTH, SPR_MONO_SINGLE_EAST, SPR_MONO_SINGLE_WEST,
226 SPR_TRACKS_FOR_SLOPES_MONO_BASE,
227 SPR_CROSSING_OFF_X_MONO,
228 SPR_TUNNEL_ENTRY_REAR_MONO, SPR_BRIDGE_DECKS_MONO,
229 },
230
231 /* GUI sprites */
232 { 0x4E7, 0x4E8, 0x4E9, 0x4EA,
233 SPR_IMG_AUTOMONO,
234 SPR_IMG_DEPOT_MONO,
235 SPR_IMG_TUNNEL_MONO,
236 SPR_IMG_CONVERT_MONO,
237 {}
238 },
239
240 {
241 SPR_CURSOR_NS_MONO,
242 SPR_CURSOR_SWNE_MONO,
243 SPR_CURSOR_EW_MONO,
244 SPR_CURSOR_NWSE_MONO,
245 SPR_CURSOR_AUTOMONO,
246 SPR_CURSOR_MONO_DEPOT,
247 SPR_CURSOR_TUNNEL_MONO,
248 SPR_CURSOR_CONVERT_MONO
249 },
250
251 /* strings */
252 {
253 STR_RAIL_NAME_MONORAIL,
254 STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION,
255 STR_RAIL_MENU_MONORAIL_CONSTRUCTION,
256 STR_BUY_VEHICLE_TRAIN_MONORAIL_CAPTION,
257 STR_REPLACE_MONORAIL_VEHICLES,
258 STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE,
259 },
260
261 /* Offset of snow tiles */
262 SPR_MONO_SNOW_OFFSET,
263
264 /* Powered railtypes */
265 {RAILTYPE_MONO},
266
267 /* Compatible Railtypes */
268 {RAILTYPE_MONO},
269
270 /* bridge offset */
271 16,
272
273 /* fallback_railtype */
274 1,
275
276 /* curve speed advantage (multiplier) */
277 1,
278
279 /* flags */
280 {},
281
282 /* cost multiplier */
283 16,
284
285 /* maintenance cost multiplier */
286 16,
287
288 /* acceleration type */
289 VehicleAccelerationModel::Monorail,
290
291 /* max speed */
292 0,
293
294 /* rail type label */
295 RAILTYPE_LABEL_MONO,
296
297 /* alternate labels */
298 {},
299
300 /* map colour */
301 PC_GREY,
302
303 /* introduction date */
304 CalendarTime::INVALID_DATE,
305
306 /* railtypes required for this to be introduced */
307 {},
308
309 /* introduction rail types */
310 {RAILTYPE_MONO},
311
312 /* sort order */
313 2 << 4 | 7,
314
315 { nullptr },
316 { nullptr },
317 {},
318 },
319
321 { // Main sprites
322 { SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_X, SPR_MGLV_SINGLE_Y,
323 SPR_MGLV_SINGLE_NORTH, SPR_MGLV_SINGLE_SOUTH, SPR_MGLV_SINGLE_EAST, SPR_MGLV_SINGLE_WEST,
324 SPR_TRACKS_FOR_SLOPES_MAGLEV_BASE,
325 SPR_CROSSING_OFF_X_MAGLEV,
326 SPR_TUNNEL_ENTRY_REAR_MAGLEV, SPR_BRIDGE_DECKS_MGLV,
327 },
328
329 /* GUI sprites */
330 { 0x4EB, 0x4EC, 0x4EE, 0x4ED,
331 SPR_IMG_AUTOMAGLEV,
332 SPR_IMG_DEPOT_MAGLEV,
333 SPR_IMG_TUNNEL_MAGLEV,
334 SPR_IMG_CONVERT_MAGLEV,
335 {}
336 },
337
338 {
339 SPR_CURSOR_NS_MAGLEV,
340 SPR_CURSOR_SWNE_MAGLEV,
341 SPR_CURSOR_EW_MAGLEV,
342 SPR_CURSOR_NWSE_MAGLEV,
343 SPR_CURSOR_AUTOMAGLEV,
344 SPR_CURSOR_MAGLEV_DEPOT,
345 SPR_CURSOR_TUNNEL_MAGLEV,
346 SPR_CURSOR_CONVERT_MAGLEV
347 },
348
349 /* strings */
350 {
351 STR_RAIL_NAME_MAGLEV,
352 STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION,
353 STR_RAIL_MENU_MAGLEV_CONSTRUCTION,
354 STR_BUY_VEHICLE_TRAIN_MAGLEV_CAPTION,
355 STR_REPLACE_MAGLEV_VEHICLES,
356 STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE,
357 },
358
359 /* Offset of snow tiles */
360 SPR_MGLV_SNOW_OFFSET,
361
362 /* Powered railtypes */
363 {RAILTYPE_MAGLEV},
364
365 /* Compatible Railtypes */
366 {RAILTYPE_MAGLEV},
367
368 /* bridge offset */
369 24,
370
371 /* fallback_railtype */
372 2,
373
374 /* curve speed advantage (multiplier) */
375 2,
376
377 /* flags */
378 {},
379
380 /* cost multiplier */
381 24,
382
383 /* maintenance cost multiplier */
384 24,
385
386 /* acceleration type */
387 VehicleAccelerationModel::Maglev,
388
389 /* max speed */
390 0,
391
392 /* rail type label */
393 RAILTYPE_LABEL_MAGLEV,
394
395 /* alternate labels */
396 {},
397
398 /* map colour */
399 PC_GREY,
400
401 /* introduction date */
402 CalendarTime::INVALID_DATE,
403
404 /* railtypes required for this to be introduced */
405 {},
406
407 /* introduction rail types */
408 {RAILTYPE_MAGLEV},
409
410 /* sort order */
411 3 << 4 | 7,
412
413 { nullptr },
414 { nullptr },
415 {},
416 },
417};
418
419#endif /* RAILTYPES_H */
RailTypeInfo
This struct contains all the info that is needed to draw and construct tracks.
Definition rail.h:115
TimerGameConst< struct Calendar >::INVALID_DATE
static constexpr TimerGame< struct Calendar >::Date INVALID_DATE
Representation of an invalid date.
Definition timer_game_common.h:193
VehicleAccelerationModel::Maglev
@ Maglev
Maglev acceleration model.
VehicleAccelerationModel::Normal
@ Normal
Default acceleration model.
VehicleAccelerationModel::Monorail
@ Monorail
Monorail acceleration model.
PC_GREY
static constexpr PixelColour PC_GREY
Grey palette colour.
Definition palette_func.h:98
RailTypeFlag::Catenary
@ Catenary
Bit number for drawing a catenary.
RAILTYPE_MONO
@ RAILTYPE_MONO
Monorail.
Definition rail_type.h:29
RAILTYPE_ELECTRIC
@ RAILTYPE_ELECTRIC
Electric rails.
Definition rail_type.h:28
RAILTYPE_RAIL
@ RAILTYPE_RAIL
Standard non-electric rails.
Definition rail_type.h:27
RAILTYPE_MAGLEV
@ RAILTYPE_MAGLEV
Maglev.
Definition rail_type.h:30
_original_railtypes
static const RailTypeInfo _original_railtypes[]
Global Railtype definition.
Definition railtypes.h:21