Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 5 additions & 0 deletions src/AndroidMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
5 changes: 5 additions & 0 deletions src/DesktopMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
3 changes: 2 additions & 1 deletion src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Options::Options(const int argc, const char* argv[])
("dlssrr", "Enable NVIDIA DLSS Ray Reconstruction.", cxxopts::value<bool>(DLSSRR)->default_value("false"))
("hwquery", "Forcing hardware raytracing not supported.", cxxopts::value<bool>(HardwareQuery)->default_value("true"))
("validation", "Force enable validation layers.", cxxopts::value<bool>(Validation)->default_value("false"))

("fastexit", "Enable fast exit by skipping task wait.", cxxopts::value<bool>(FastExit)->default_value("true"))

("h,help", "Print usage");
try
{
Expand Down
1 change: 1 addition & 0 deletions src/Options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Options final
bool ForceSoftGen{};
bool HardwareQuery{};
bool Validation{};
bool FastExit{true};
std::string locale{};

// Renderer options.
Expand Down
9 changes: 7 additions & 2 deletions src/Runtime/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<void(double)> callback)
Expand Down