diff --git a/run.ps1 b/run.ps1 index dc38f292..7e99f6ed 100644 --- a/run.ps1 +++ b/run.ps1 @@ -217,18 +217,8 @@ if ($DryRun) { exit 0 } Push-Location $ResolvedBin try { - $ProcessArgs = @{ - FilePath = ".\$ExeName" - Wait = $true - PassThru = $true - NoNewWindow = $true - } - if ($LaunchArgs.Count -gt 0) { - $ProcessArgs["ArgumentList"] = $LaunchArgs - } - - $Proc = Start-Process @ProcessArgs - exit $Proc.ExitCode + & ".\$ExeName" $LaunchArgs + exit $LASTEXITCODE } finally { Pop-Location } \ No newline at end of file diff --git a/src/AndroidMain.cpp b/src/AndroidMain.cpp index e97aa433..a0256850 100644 --- a/src/AndroidMain.cpp +++ b/src/AndroidMain.cpp @@ -91,6 +91,11 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result) // Shutdown GApplication->End(); + if (GOption->FastExit) + { + std::quick_exit(0); + } + GApplication.reset(); GOptionPtr.reset(); } diff --git a/src/DesktopMain.cpp b/src/DesktopMain.cpp index acf452cb..b39c1b12 100644 --- a/src/DesktopMain.cpp +++ b/src/DesktopMain.cpp @@ -92,6 +92,11 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result) // Shutdown GApplication->End(); + if (GOption->FastExit) + { + std::quick_exit(0); + } + GApplication.reset(); GOptionPtr.reset(); } diff --git a/src/Options.cpp b/src/Options.cpp index b9d2239d..f5b5e0be 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -37,7 +37,8 @@ Options::Options(const int argc, const char* argv[]) ("dlssrr", "Enable NVIDIA DLSS Ray Reconstruction.", cxxopts::value(DLSSRR)->default_value("false")) ("hwquery", "Forcing hardware raytracing not supported.", cxxopts::value(HardwareQuery)->default_value("true")) ("validation", "Force enable validation layers.", cxxopts::value(Validation)->default_value("false")) - + ("fastexit", "Enable fast exit by skipping task wait.", cxxopts::value(FastExit)->default_value("true")) + ("h,help", "Print usage"); try { diff --git a/src/Options.hpp b/src/Options.hpp index 4ed5fc16..dfb134d9 100644 --- a/src/Options.hpp +++ b/src/Options.hpp @@ -33,6 +33,7 @@ class Options final bool ForceSoftGen{}; bool HardwareQuery{}; bool Validation{}; + bool FastExit{true}; std::string locale{}; // Renderer options. diff --git a/src/Runtime/Engine.cpp b/src/Runtime/Engine.cpp index 816b4733..7d1884e0 100644 --- a/src/Runtime/Engine.cpp +++ b/src/Runtime/Engine.cpp @@ -523,8 +523,11 @@ bool NextEngine::Tick() void NextEngine::End() { - TaskCoordinator::GetInstance()->CancelAllParralledTasks(); - TaskCoordinator::GetInstance()->WaitForAllParralledTask(); + if (!GOption->FastExit) + { + TaskCoordinator::GetInstance()->CancelAllParralledTasks(); + TaskCoordinator::GetInstance()->WaitForAllParralledTask(); + } // sound manager unit soundDataMaps_.clear(); @@ -543,6 +546,8 @@ void NextEngine::End() gameInstance_->OnDestroy(); renderer_->End(); userInterface_.reset(); + + Utilities::Localization::SaveLocTexts(fmt::format("assets/locale/{}.txt", GOption->locale).c_str()); } void NextEngine::RegisterJSCallback(std::function callback)