mirror of
https://github.com/open-goal/jak-project
synced 2026-09-05 18:58:14 -04:00
Add imgui option to restart in retail mode (#4404)
This commit is contained in:
@@ -242,6 +242,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
bool force_debug_next_time = false;
|
||||
bool force_retail_next_time = false;
|
||||
// always start with an empty arg, as internally kmachine starts at `1` not `0`
|
||||
std::vector<const char*> arg_ptrs = {""};
|
||||
for (auto& str : game_args) {
|
||||
@@ -261,6 +262,15 @@ int main(int argc, char** argv) {
|
||||
arg_ptrs.push_back(str.data());
|
||||
}
|
||||
}
|
||||
if (force_retail_next_time) {
|
||||
force_retail_next_time = false;
|
||||
arg_ptrs = {""}; // see above for rationale
|
||||
for (auto& str : game_args) {
|
||||
if (str != "-debug") {
|
||||
arg_ptrs.push_back(str.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// run the runtime in a loop so we can reset the game and have it restart cleanly
|
||||
lg::info("OpenGOAL Runtime {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
|
||||
@@ -276,6 +286,9 @@ int main(int argc, char** argv) {
|
||||
case RuntimeExitStatus::RESTART_IN_DEBUG:
|
||||
force_debug_next_time = true;
|
||||
break;
|
||||
case RuntimeExitStatus::RESTART_IN_RETAIL:
|
||||
force_retail_next_time = true;
|
||||
break;
|
||||
}
|
||||
} catch (std::exception& ex) {
|
||||
lg::error("Unexpected exception occurred - {}", ex.what());
|
||||
|
||||
Reference in New Issue
Block a user