OpenTTD Source 20261112-master-gbcbec5e63f
survey.cpp
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#include "stdafx.h"
11
12#include "survey.h"
13
14#include "settings_table.h"
15#include "network/network.h"
16#include "rev.h"
17#include "settings_type.h"
20#include "3rdparty/fmt/ranges.h"
21
22#include "company_base.h"
23#include "currency_func.h"
24#include "fontcache.h"
25#include "language.h"
26#include "newgrf_config.h"
27
28#include "ai/ai_info.hpp"
29#include "game/game.hpp"
30#include "game/game_info.hpp"
31
35
36#include "base_media_graphics.h"
37#include "base_media_music.h"
38#include "base_media_sounds.h"
39#include "blitter/factory.hpp"
40
41#include "social_integration.h"
42
43#ifdef WITH_ALLEGRO
44# include <allegro.h>
45#endif /* WITH_ALLEGRO */
46#ifdef WITH_FONTCONFIG
47# include <fontconfig/fontconfig.h>
48#endif /* WITH_FONTCONFIG */
49#ifdef WITH_PNG
50 /* pngconf.h, included by png.h doesn't like something in the
51 * freetype headers. As such it's not alphabetically sorted. */
52# include <png.h>
53#endif /* WITH_PNG */
54#ifdef WITH_FREETYPE
55# include <ft2build.h>
56# include FT_FREETYPE_H
57#endif /* WITH_FREETYPE */
58#ifdef WITH_HARFBUZZ
59# include <hb.h>
60#endif /* WITH_HARFBUZZ */
61#ifdef WITH_ICU_I18N
62# include <unicode/uversion.h>
63#endif /* WITH_ICU_I18N */
64#ifdef WITH_LIBLZMA
65# include <lzma.h>
66#endif
67#ifdef WITH_LZO
68#include <lzo/lzo1x.h>
69#endif
70#ifdef WITH_SDL3
71#include <SDL3/SDL_version.h>
72#endif /* WITH_SDL3 */
73#ifdef WITH_ZLIB
74# include <zlib.h>
75#endif
76#ifdef WITH_CURL
77# include <curl/curl.h>
78#endif
79
80#include "safeguards.h"
81
82#ifndef DOXYGEN_API
83
84NLOHMANN_JSON_SERIALIZE_ENUM(GRFStatus, {
85 {GRFStatus::Unknown, "unknown"},
86 {GRFStatus::Disabled, "disabled"},
87 {GRFStatus::NotFound, "not found"},
88 {GRFStatus::Initialised, "initialised"},
89 {GRFStatus::Activated, "activated"},
90})
91
92NLOHMANN_JSON_SERIALIZE_ENUM(SocialIntegrationPlugin::State, {
100})
101
102#endif /* DOXYGEN_API */
103
106 "train",
107 "roadveh",
108 "ship",
109 "aircraft",
110};
111
124{
125 static const SettingTable _generic_setting_tables[] = {
126 _difficulty_settings,
127 _economy_settings,
128 _game_settings,
129 _gui_settings,
130 _linkgraph_settings,
131 _locale_settings,
132 _multimedia_settings,
133 _network_settings,
134 _news_display_settings,
135 _pathfinding_settings,
136 _script_settings,
137 _world_settings,
138 };
139 return _generic_setting_tables;
140}
141
150static void SurveySettingsTable(nlohmann::json &survey, const SettingTable &table, void *object, bool skip_if_default)
151{
152 for (auto &desc : table) {
153 const SettingDesc *sd = GetSettingDesc(desc);
154 /* Skip any old settings we no longer save/load. */
156
157 const auto &name = sd->GetName();
158 if (skip_if_default && sd->IsDefaultValue(object)) continue;
159 survey[name] = sd->FormatValue(object);
160 }
161}
162
169void SurveySettings(nlohmann::json &survey, bool skip_if_default)
170{
171 SurveySettingsTable(survey, _misc_settings, nullptr, skip_if_default);
172#if defined(_WIN32) && !defined(DEDICATED)
173 SurveySettingsTable(survey, _win32_settings, nullptr, skip_if_default);
174#endif
175 for (auto &table : GenericSettingTables()) {
176 SurveySettingsTable(survey, table, &_settings_game, skip_if_default);
177 }
178 SurveySettingsTable(survey, _currency_settings, &GetCustomCurrency(), skip_if_default);
179 SurveySettingsTable(survey, _company_settings, &_settings_client.company, skip_if_default);
180}
181
187void SurveyCompiler(nlohmann::json &survey)
188{
189#if defined(_MSC_VER)
190 survey["name"] = "MSVC";
191 survey["version"] = _MSC_VER;
192#elif defined(__GNUC__)
193 survey["name"] = "GCC";
194 survey["version"] = fmt::format("{}.{}.{}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
195#else
196 survey["name"] = "unknown";
197#endif
198
199#if defined(__VERSION__)
200 survey["extra"] = __VERSION__;
201#endif
202}
203
209void SurveyOpenTTD(nlohmann::json &survey)
210{
211 survey["version"]["revision"] = std::string(_openttd_revision);
212 survey["version"]["modified"] = _openttd_revision_modified;
213 survey["version"]["tagged"] = _openttd_revision_tagged;
214 survey["version"]["hash"] = std::string(_openttd_revision_hash);
215 survey["version"]["newgrf"] = fmt::format("{:X}", _openttd_newgrf_version);
216 survey["version"]["content"] = std::string(_openttd_content_version);
217 survey["build_date"] = std::string(_openttd_build_date);
218 survey["bits"] =
219#ifdef POINTER_IS_64BIT
220 64
221#else
222 32
223#endif
224 ;
225 if constexpr (std::endian::native == std::endian::little) survey["endian"] = "little";
226 if constexpr (std::endian::native == std::endian::big) survey["endian"] = "big";
227 survey["dedicated_build"] =
228#ifdef DEDICATED
229 "yes"
230#else
231 "no"
232#endif
233 ;
234}
235
241void SurveyGameSession(nlohmann::json &survey)
242{
243 survey["id"] = _game_session_stats.savegame_id;
244 survey["seconds"] = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - _game_session_stats.start_time).count();
245 if (_game_session_stats.savegame_size.has_value()) {
246 survey["savegame_size"] = _game_session_stats.savegame_size.value();
247 }
248}
249
255void SurveyConfiguration(nlohmann::json &survey)
256{
257 survey["network"] = _networking ? (_network_server ? "server" : "client") : "no";
258 if (_current_language != nullptr) {
259 survey["language"]["filename"] = FS2OTTD(_current_language->file.filename().native());
260 survey["language"]["name"] = _current_language->name;
261 survey["language"]["isocode"] = _current_language->isocode;
262 }
263 if (BlitterFactory::GetCurrentBlitter() != nullptr) {
264 survey["blitter"] = BlitterFactory::GetCurrentBlitter()->GetName();
265 }
266 if (MusicDriver::GetInstance() != nullptr) {
267 survey["music_driver"] = MusicDriver::GetInstance()->GetName();
268 }
269 if (SoundDriver::GetInstance() != nullptr) {
270 survey["sound_driver"] = SoundDriver::GetInstance()->GetName();
271 }
272 if (VideoDriver::GetInstance() != nullptr) {
273 survey["video_driver"] = VideoDriver::GetInstance()->GetName();
274 survey["video_info"] = VideoDriver::GetInstance()->GetInfoString();
275 }
276 if (BaseGraphics::GetUsedSet() != nullptr) {
277 survey["graphics_set"] = fmt::format("{}.{}", BaseGraphics::GetUsedSet()->name, fmt::join(BaseGraphics::GetUsedSet()->version, "."));
278 const GRFConfig *extra_cfg = BaseGraphics::GetUsedSet()->GetExtraConfig();
279 if (extra_cfg != nullptr && !extra_cfg->param.empty()) {
280 survey["graphics_set_parameters"] = std::span<const uint32_t>(extra_cfg->param);
281 } else {
282 survey["graphics_set_parameters"] = std::span<const uint32_t>();
283 }
284 }
285 if (BaseMusic::GetUsedSet() != nullptr) {
286 survey["music_set"] = fmt::format("{}.{}", BaseMusic::GetUsedSet()->name, fmt::join(BaseMusic::GetUsedSet()->version, "."));
287 }
288 if (BaseSounds::GetUsedSet() != nullptr) {
289 survey["sound_set"] = fmt::format("{}.{}", BaseSounds::GetUsedSet()->name, fmt::join(BaseSounds::GetUsedSet()->version, "."));
290 }
291}
292
298void SurveyFont(nlohmann::json &survey)
299{
300 survey["small"] = FontCache::Get(FontSize::Small)->GetFontName();
301 survey["medium"] = FontCache::Get(FontSize::Normal)->GetFontName();
302 survey["large"] = FontCache::Get(FontSize::Large)->GetFontName();
304}
305
311void SurveyCompanies(nlohmann::json &survey)
312{
313 for (const Company *c : Company::Iterate()) {
314 auto &company = survey[fmt::format("{}", c->index.base())];
315 if (c->ai_info == nullptr) {
316 company["type"] = "human";
317 } else {
318 company["type"] = "ai";
319 company["script"] = fmt::format("{}.{}", c->ai_info->GetName(), c->ai_info->GetVersion());
320 }
321
323 uint amount = c->group_all[type].num_vehicle;
324 company["vehicles"][_vehicle_type_to_string[type]] = amount;
325 }
326
327 company["infrastructure"]["road"] = c->infrastructure.GetRoadTotal();
328 company["infrastructure"]["tram"] = c->infrastructure.GetTramTotal();
329 company["infrastructure"]["rail"] = c->infrastructure.GetRailTotal();
330 company["infrastructure"]["signal"] = c->infrastructure.signal;
331 company["infrastructure"]["water"] = c->infrastructure.water;
332 company["infrastructure"]["station"] = c->infrastructure.station;
333 company["infrastructure"]["airport"] = c->infrastructure.airport;
334 }
335}
336
342void SurveyTimers(nlohmann::json &survey)
343{
344 survey["ticks"] = TimerGameTick::counter;
345
346 TimerGameEconomy::YearMonthDay economy_ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
347 survey["economy"] = fmt::format("{:04}-{:02}-{:02} ({})", economy_ymd.year, economy_ymd.month + 1, economy_ymd.day, TimerGameEconomy::date_fract);
348
349 TimerGameCalendar::YearMonthDay ymd = TimerGameCalendar::ConvertDateToYMD(TimerGameCalendar::date);
350 survey["calendar"] = fmt::format("{:04}-{:02}-{:02} ({})", ymd.year, ymd.month + 1, ymd.day, TimerGameCalendar::date_fract);
351}
352
358void SurveyGrfs(nlohmann::json &survey)
359{
360 for (const auto &c : _grfconfig) {
361 auto grfid = fmt::format("{}", FormatArrayAsHex(c->ident.grfid));
362 auto &grf = survey[std::move(grfid)];
363
364 grf["md5sum"] = FormatArrayAsHex(c->ident.md5sum);
365 grf["status"] = c->status;
366
367 if ((c->palette & GRFP_GRF_MASK) == GRFP_GRF_UNSET) grf["palette"] = "unset";
368 if ((c->palette & GRFP_GRF_MASK) == GRFP_GRF_DOS) grf["palette"] = "dos";
369 if ((c->palette & GRFP_GRF_MASK) == GRFP_GRF_WINDOWS) grf["palette"] = "windows";
370 if ((c->palette & GRFP_GRF_MASK) == GRFP_GRF_ANY) grf["palette"] = "any";
371
372 if ((c->palette & GRFP_BLT_MASK) == GRFP_BLT_UNSET) grf["blitter"] = "unset";
373 if ((c->palette & GRFP_BLT_MASK) == GRFP_BLT_32BPP) grf["blitter"] = "32bpp";
374
375 grf["is_static"] = c->flags.Test(GRFConfigFlag::Static);
376 grf["parameters"] = std::span<const uint32_t>(c->param);
377 }
378}
379
385void SurveyGameScript(nlohmann::json &survey)
386{
387 if (Game::GetInfo() == nullptr) return;
388
389 survey = fmt::format("{}.{}", Game::GetInfo()->GetName(), Game::GetInfo()->GetVersion());
390}
391
397void SurveyLibraries(nlohmann::json &survey)
398{
399#ifdef WITH_ALLEGRO
400 survey["allegro"] = std::string(allegro_id);
401#endif /* WITH_ALLEGRO */
402
403#ifdef WITH_FONTCONFIG
404 int version = FcGetVersion();
405 survey["fontconfig"] = fmt::format("{}.{}.{}", version / 10000, (version / 100) % 100, version % 100);
406#endif /* WITH_FONTCONFIG */
407
408#ifdef WITH_FREETYPE
409 FT_Library library;
410 int major, minor, patch;
411 FT_Init_FreeType(&library);
412 FT_Library_Version(library, &major, &minor, &patch);
413 FT_Done_FreeType(library);
414 survey["freetype"] = fmt::format("{}.{}.{}", major, minor, patch);
415#endif /* WITH_FREETYPE */
416
417#if defined(WITH_HARFBUZZ)
418 survey["harfbuzz"] = hb_version_string();
419#endif /* WITH_HARFBUZZ */
420
421#if defined(WITH_ICU_I18N)
422 /* 4 times 0-255, separated by dots (.) and a trailing '\0' */
423 char buf[4 * 3 + 3 + 1];
424 UVersionInfo ver;
425 u_getVersion(ver);
426 u_versionToString(ver, buf);
427 survey["icu_i18n"] = buf;
428#endif /* WITH_ICU_I18N */
429
430#ifdef WITH_LIBLZMA
431 survey["lzma"] = lzma_version_string();
432#endif
433
434#ifdef WITH_LZO
435 survey["lzo"] = lzo_version_string();
436#endif
437
438#ifdef WITH_PNG
439 survey["png"] = png_get_libpng_ver(nullptr);
440#endif /* WITH_PNG */
441
442#ifdef WITH_SDL3
443 int sdl_v = SDL_GetVersion();
444 survey["sdl3"] = fmt::format("{}.{}.{} ({})", SDL_VERSIONNUM_MAJOR(sdl_v), SDL_VERSIONNUM_MINOR(sdl_v), SDL_VERSIONNUM_MICRO(sdl_v), SDL_GetRevision());
445#endif
446
447#ifdef WITH_ZLIB
448 survey["zlib"] = zlibVersion();
449#endif
450
451#ifdef WITH_CURL
452 auto *curl_v = curl_version_info(CURLVERSION_NOW);
453 survey["curl"] = curl_v->version;
454 survey["curl_ssl"] = curl_v->ssl_version == nullptr ? "none" : curl_v->ssl_version;
455#endif
456}
457
463void SurveyPlugins(nlohmann::json &survey)
464{
466
467 for (auto &plugin : _plugins) {
468 auto &platform = survey[plugin->social_platform];
469 platform.push_back({
470 {"name", plugin->name},
471 {"version", plugin->version},
472 {"basepath", plugin->basepath},
473 {"state", plugin->state},
474 });
475 }
476}
477
486std::string SurveyMemoryToText(uint64_t memory)
487{
488 memory = memory / 1024; // KiB
489 memory = CeilDiv(memory, 1024); // MiB
490
491 /* Anything above 512 MiB we represent in GiB. */
492 if (memory > 512) {
493 return fmt::format("{} GiB", CeilDiv(memory, 1024));
494 }
495
496 /* Anything above 64 MiB we represent in a multiplier of 128 MiB. */
497 if (memory > 64) {
498 return fmt::format("{} MiB", Ceil(memory, 128));
499 }
500
501 /* Anything else in a multiplier of 4 MiB. */
502 return fmt::format("{} MiB", Ceil(memory, 4));
503}
AIInfo keeps track of all information of an AI, like Author, Description, ...
Generic functions for replacing base graphics data.
Generic functions for replacing base music data.
Generic functions for replacing base sounds data.
static const GraphicsSet * GetUsedSet()
static Blitter * GetCurrentBlitter()
Get the current active blitter (always set by calling SelectBlitter).
Definition factory.hpp:139
virtual std::string_view GetName()=0
Get the name of the blitter, the same as the Factory-instance returns.
virtual std::string_view GetName() const =0
Get the name of this driver.
Iterate a range of enum values.
virtual std::string GetFontName()=0
Get the name of this font.
static FontCache * Get(FontSize fs)
Get the font cache of a given font size.
Definition fontcache.h:136
static class GameInfo * GetInfo()
Get the current GameInfo.
Definition game.hpp:72
static MusicDriver * GetInstance()
Get the currently active instance of the music driver.
@ PLATFORM_NOT_RUNNING
The plugin failed to initialize because the Social Platform is not running.
@ UNSUPPORTED_API
The plugin does not support the current API version.
@ RUNNING
The plugin is successfully loaded and running.
@ FAILED
The plugin failed to initialize.
@ DUPLICATE
Another plugin of the same Social Platform is already loaded.
@ INVALID_SIGNATURE
The signature of the plugin is invalid.
@ UNLOADED
The plugin is unloaded upon request.
static std::vector< SocialIntegrationPlugin * > GetPlugins()
Get the list of loaded social integration plugins.
static SoundDriver * GetInstance()
Get the currently active instance of the sound driver.
static YearMonthDay ConvertDateToYMD(Date date)
Converts a Date to a Year, Month & Day.
static Date date
Current date in days (day counter).
static DateFract date_fract
Fractional part of the day.
static Date date
Current date in days (day counter).
static DateFract date_fract
Fractional part of the day.
static YearMonthDay ConvertDateToYMD(Date date)
Converts a Date to a Year, Month & Day.
static TickCounter counter
Monotonic counter, in ticks, since start of game.
virtual std::string_view GetInfoString() const
Get some information about the selected driver/backend to be shown to the user.
static VideoDriver * GetInstance()
Get the currently active instance of the video driver.
Definition of stuff that is very close to a company, like the company struct itself.
Functions to handle different currencies.
CurrencySpec & GetCustomCurrency()
Get the custom currency.
Factory to 'query' all available blitters.
Functions to read fonts from files and cache them.
Base functions for all Games.
GameInfo keeps track of all information of an Game, like Author, Description, ...
GameSessionStats _game_session_stats
Statistics about the current session.
Definition gfx.cpp:47
@ Small
Index of the small font in the font tables.
Definition gfx_type.h:250
@ Large
Index of the large font in the font tables.
Definition gfx_type.h:251
@ Normal
Index of the normal font in the font tables.
Definition gfx_type.h:249
@ Monospace
Index of the monospaced font in the font tables.
Definition gfx_type.h:252
Information about languages and their files.
const LanguageMetadata * _current_language
The currently loaded language.
Definition strings.cpp:53
constexpr uint CeilDiv(uint a, uint b)
Computes ceil(a / b) for non-negative a and b.
constexpr uint Ceil(uint a, uint b)
Computes ceil(a / b) * b for non-negative a and b.
Base for all music playback.
bool _networking
are we in networking mode?
Definition network.cpp:63
bool _network_server
network-server is active
Definition network.cpp:64
Basic functions/variables used all over the place.
GRFConfigList _grfconfig
First item in list of current GRF set up.
Functions to find and configure NewGRFs.
GRFStatus
Status of GRF.
@ NotFound
GRF file was not found in the local cache.
@ Initialised
GRF file has been initialised.
@ Unknown
The status of this grf file is unknown.
@ Disabled
GRF file is disabled.
@ Activated
GRF file has been activated.
@ Static
GRF file is used statically (can be used in any MP game).
@ GRFP_GRF_UNSET
The NewGRF provided no information.
@ GRFP_BLT_UNSET
The NewGRF provided no information or doesn't care about a 32 bpp blitter.
@ GRFP_GRF_WINDOWS
The NewGRF says the Windows palette can be used.
@ GRFP_GRF_DOS
The NewGRF says the DOS palette can be used.
@ GRFP_GRF_ANY
The NewGRF says any palette can be used.
@ GRFP_BLT_MASK
Bitmask to only get the blitter information.
@ GRFP_BLT_32BPP
The NewGRF prefers a 32 bpp blitter.
@ GRFP_GRF_MASK
Bitmask to get only the NewGRF supplied information.
Declaration of OTTD revision dependent variables.
A number of safeguards to prevent using unsafe methods.
bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLoadVersion version_to)
Checks if some version from/to combination falls within the range of the active savegame version.
Definition saveload.h:1252
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition settings.cpp:61
ClientSettings _settings_client
The current settings for this game.
Definition settings.cpp:60
static constexpr const SettingDesc * GetSettingDesc(const SettingVariant &desc)
Helper to convert the type of the iterated settings description to a pointer to it.
Definition of the configuration tables of the settings.
Types related to global configuration settings.
static std::vector< std::unique_ptr< InternalSocialIntegrationPlugin > > _plugins
List of loaded plugins.
Interface definitions for game to report/respond to social integration.
Base for all sound drivers.
Definition of base types and functions in a cross-platform compatible way.
std::string FormatArrayAsHex(std::span< const uint8_t > data)
Format a byte array into a continuous hex string.
Definition string.cpp:76
Information about GRF, used in the game and (part of it) in savegames.
std::vector< uint32_t > param
GRF parameters.
static Pool::IterateWrapper< Company > Iterate(size_t from=0)
SaveLoadVersion version_to
Save/load the variable before this savegame version.
Definition saveload.h:780
SaveLoadVersion version_from
Save/load the variable starting from this savegame version.
Definition saveload.h:779
Properties of config file settings.
constexpr const std::string & GetName() const
Get the name of this setting.
virtual std::string FormatValue(const void *object) const =0
Format the value of the setting associated with this object.
virtual bool IsDefaultValue(void *object) const =0
Check whether the value is the same as the default value.
SaveLoad save
Internal structure (going to savegame, parts to config).
void SurveySettings(nlohmann::json &survey, bool skip_if_default)
Convert settings to JSON.
Definition survey.cpp:169
static constexpr VehicleTypeIndexArray< std::string_view > _vehicle_type_to_string
Lookup table to convert a VehicleType to a string.
Definition survey.cpp:105
void SurveyPlugins(nlohmann::json &survey)
Convert plugin information to JSON.
Definition survey.cpp:463
void SurveyTimers(nlohmann::json &survey)
Convert timer information to JSON.
Definition survey.cpp:342
static void SurveySettingsTable(nlohmann::json &survey, const SettingTable &table, void *object, bool skip_if_default)
Convert a settings table to JSON.
Definition survey.cpp:150
void SurveyGameSession(nlohmann::json &survey)
Convert game session information to JSON.
Definition survey.cpp:241
std::string SurveyMemoryToText(uint64_t memory)
Change the bytes of memory into a textual version rounded up to the biggest unit.
Definition survey.cpp:486
void SurveyGameScript(nlohmann::json &survey)
Convert game-script information to JSON.
Definition survey.cpp:385
void SurveyConfiguration(nlohmann::json &survey)
Convert generic game information to JSON.
Definition survey.cpp:255
void SurveyOpenTTD(nlohmann::json &survey)
Convert generic OpenTTD information to JSON.
Definition survey.cpp:209
void SurveyFont(nlohmann::json &survey)
Convert font information to JSON.
Definition survey.cpp:298
void SurveyCompanies(nlohmann::json &survey)
Convert company information to JSON.
Definition survey.cpp:311
static auto & GenericSettingTables()
List of all the generic setting tables.
Definition survey.cpp:123
void SurveyCompiler(nlohmann::json &survey)
Convert compiler information to JSON.
Definition survey.cpp:187
void SurveyLibraries(nlohmann::json &survey)
Convert compiled libraries information to JSON.
Definition survey.cpp:397
void SurveyGrfs(nlohmann::json &survey)
Convert GRF information to JSON.
Definition survey.cpp:358
Functions to survey the current game / system, for crashlog and network-survey.
Definition of the game-calendar-timer.
Definition of the game-economy-timer.
VehicleType
Available vehicle types.
@ CompanyEnd
Last company-ownable type.
EnumIndexArray< T, VehicleType, Tend > VehicleTypeIndexArray
Array with VehicleType as index.
Base of all video drivers.
std::string FS2OTTD(std::wstring_view name)
Convert to OpenTTD's encoding from a wide string.
Definition win32.cpp:373