|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
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 int ParseCommandLine(
char *line,
char **argv,
int max_argc)
27 while (*line ==
' ' || *line ==
'\t') line++;
30 if (*line ==
'\0')
break;
35 while (*line !=
'"') {
36 if (*line ==
'\0')
return n;
41 while (*line !=
' ' && *line !=
'\t') {
42 if (*line ==
'\0')
return n;
47 }
while (n != max_argc);
54 int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)
62 std::string cmdline =
FS2OTTD(GetCommandLine());
65 SetConsoleOutputCP(CP_UTF8);
71 _set_error_mode(_OUT_TO_MSGBOX);
77 int argc = ParseCommandLine(cmdline.data(), argv,
lengthof(argv));
int openttd_main(int argc, char *argv[])
Main entry point for this lovely game.
std::string FS2OTTD(const std::wstring &name)
Convert to OpenTTD's encoding from a wide string.
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).
void SetRandomSeed(uint32_t seed)
(Re)set the state of the random number generators.
static void InitialiseCrashLog()
Initialiser for crash logs; do the appropriate things so crashes are handled by our crash handler ins...
#define lengthof(x)
Return the length of an fixed size array.