10#include "../../stdafx.h"
13#include "../../openttd.h"
14#include "../../core/random_func.hpp"
15#include "../../core/string_consumer.hpp"
16#include "../../string_func.h"
17#include "../../crashlog.h"
18#include "../../debug.h"
20#include "../../safeguards.h"
22static auto ParseCommandLine(std::string_view line)
24 std::vector<std::string_view> arguments;
27 while (consumer.AnyBytesLeft()) {
29 if (!consumer.AnyBytesLeft())
break;
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.
static const std::string_view WHITESPACE_NO_NEWLINE
ASCII whitespace characters, excluding new-line.
void SkipUntilCharNotIn(std::string_view chars)
Skip 8-bit chars, while they are in 'chars', until they are not.
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.
static void StrMakeValid(Builder &builder, StringConsumer &consumer, StringValidationSettings settings)
Copies the valid (UTF-8) characters from consumer to the builder.
std::string FS2OTTD(std::wstring_view name)
Convert to OpenTTD's encoding from a wide string.