10 #include "../../stdafx.h"
13 #include "../../openttd.h"
14 #include "../../core/random_func.hpp"
15 #include "../../string_func.h"
16 #include "../../crashlog.h"
17 #include "../../debug.h"
19 #include "../../safeguards.h"
21 static auto ParseCommandLine(
char *line)
23 std::vector<char *> arguments;
26 while (*line ==
' ' || *line ==
'\t') line++;
29 if (*line ==
'\0')
break;
33 arguments.push_back(++line);
34 while (*line !=
'"') {
35 if (*line ==
'\0')
return arguments;
39 arguments.push_back(line);
40 while (*line !=
' ' && *line !=
'\t') {
41 if (*line ==
'\0')
return arguments;
53 int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)
61 std::string cmdline =
FS2OTTD(GetCommandLine());
64 SetConsoleOutputCP(CP_UTF8);
70 _set_error_mode(_OUT_TO_MSGBOX);
75 auto arguments = ParseCommandLine(cmdline.data());
static void InitialiseCrashLog()
Initialiser for crash logs; do the appropriate things so crashes are handled by our crash handler ins...
int openttd_main(std::span< char *const > arguments)
Main entry point for this lovely game.
void SetRandomSeed(uint32_t seed)
(Re)set the state of the random number generators.
void StrMakeValidInPlace(char *str, const char *last, StringValidationSettings settings)
Scans the string for invalid characters and replaces then with a question mark '?' (if not ignored).
std::string FS2OTTD(const std::wstring &name)
Convert to OpenTTD's encoding from a wide string.