49 for(
int i=1;i<argc;++i) {
50 std::string_view arg = argv[i];
51 if(arg.find(
"-game:")==0) {
53 Log::e(
"-game specified twice");
59 gpath.assign(argv[i],argv[i]+std::strlen(argv[i]));
61 else if(arg==
"-devmode") {
65 else if(arg==
"-save") {
68 if(std::strcmp(argv[i],
"q")==0) {
69 saveDef =
"save_slot_0.sav";
71 saveDef =
string_frm(
"save_slot_",argv[i],
".sav");
80 else if(arg==
"-window") {
83 else if(arg==
"-nomenu") {
86 else if(arg==
"-benchmark") {
88 if(i+1<argc && argv[i+1][0]!=
'-') {
96 else if(arg==
"-g2c") {
102 else if(arg==
"-dx12") {
105 else if(arg==
"-validation" || arg==
"-v") {
108 else if(arg==
"-rt") {
113 else if(arg==
"-aa") {
117 aaPresetId = uint32_t(std::stoul(std::string(argv[i])));
120 catch (
const std::exception& e) {
121 Log::i(
"failed to read cmaa2 preset: \"", std::string(argv[i]),
"\"");
125 else if(arg==
"-gi") {
130 else if(arg==
"-ms") {
135 else if(arg==
"-bl") {
139 isBindlessSh =
boolArg(argv[i]);
141 else if(arg==
"-vsm") {
147 else if(arg==
"-rtsm") {
154 Log::i(
"unreacognized commandline option: \"", arg,
"\"");
160 gpath =
inst.detectG2();
161#if defined(__APPLE__)
162 if(!gpath.empty() && gpath==
inst.applicationSupportDirectory()) {
163 std::filesystem::current_path(gpath);
172 if(gpath.size()>0 && gpath.back()!=
'/')
173 gpath.push_back(
'/');
175 gscript =
nestedPath({u
"_work",u
"Data",u
"Scripts", u
"_compiled"},Dir::FT_Dir);
176 gcutscene =
nestedPath({u
"_work",u
"Data",u
"Scripts", u
"content",u
"CUTSCENE"},Dir::FT_Dir);
178 gmod = TextCodec::toUtf16(mod);
180 gmod =
nestedPath({u
"system",gmod.c_str()},Dir::FT_File);
182 if(!validateGothicPath()) {
184 Log::e(
"Gothic path is not provided. Please use command line argument -g <path>");
186 Log::e(
"Invalid gothic path: \"",TextCodec::toUtf8(gpath),
"\"");