22static auto ParseCommandLine(std::string_view line)
24 std::vector<std::string_view> arguments;
31 std::string_view argument;
32 if (consumer.
ReadIf(
"\"")) {
39 arguments.push_back(argument);
47int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)
58 SetConsoleOutputCP(CP_UTF8);
64 _set_error_mode(_OUT_TO_MSGBOX);
69 auto arguments = ParseCommandLine(cmdline);
static void InitialiseCrashLog()
Initialiser for crash logs; do the appropriate things so crashes are handled by our crash handler ins...
Parse data from a string / buffer.
@ SKIP_ONE_SEPARATOR
Read and discard one separator, do not include it in the result.
bool AnyBytesLeft() const noexcept
Check whether any bytes left to read.
std::string_view ReadUntil(std::string_view str, SeparatorUsage sep)
Read data until the first occurrence of 'str', and advance reader.
static const std::string_view WHITESPACE_NO_NEWLINE
ASCII whitespace characters, excluding new-line.
bool ReadIf(std::string_view str)
Check whether the next data matches 'str', and skip it.
void SkipUntilCharNotIn(std::string_view chars)
Skip 8-bit chars, while they are in 'chars', until they are not.
std::string_view ReadUntilCharIn(std::string_view chars)
Read 8-bit chars, while they are not in 'chars', until they are; and advance reader.
Functions to be called to log a crash.
Functions related to debugging.
int openttd_main(std::span< std::string_view > arguments)
Main entry point for this lovely game.
void SetRandomSeed(uint32_t seed)
(Re)set the state of the random number generators.
Pseudo random number generator.
A number of safeguards to prevent using unsafe methods.
Definition of base types and functions in a cross-platform compatible way.
static void StrMakeValid(Builder &builder, StringConsumer &consumer, StringValidationSettings settings)
Copies the valid (UTF-8) characters from consumer to the builder.
Functions related to low-level strings.
std::string FS2OTTD(std::wstring_view name)
Convert to OpenTTD's encoding from a wide string.