mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 20:31:41 +00:00
add argument to use current working directory
This commit is contained in:
parent
2f8852137c
commit
cbe533c538
1 changed files with 8 additions and 3 deletions
|
|
@ -186,9 +186,6 @@ int main(int argc, char *argv[])
|
||||||
timeBeginPeriod(1);
|
timeBeginPeriod(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set the current working directory to the executable's path.
|
|
||||||
std::filesystem::current_path(os::process::GetExecutablePath().parent_path());
|
|
||||||
|
|
||||||
os::process::CheckConsole();
|
os::process::CheckConsole();
|
||||||
|
|
||||||
if (!os::registry::Init())
|
if (!os::registry::Init())
|
||||||
|
|
@ -198,12 +195,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
bool forceInstaller = false;
|
bool forceInstaller = false;
|
||||||
bool forceDLCInstaller = false;
|
bool forceDLCInstaller = false;
|
||||||
|
bool useDefaultWorkingDirectory = false;
|
||||||
const char *sdlVideoDriver = nullptr;
|
const char *sdlVideoDriver = nullptr;
|
||||||
|
|
||||||
for (uint32_t i = 1; i < argc; i++)
|
for (uint32_t i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
forceInstaller = forceInstaller || (strcmp(argv[i], "--install") == 0);
|
forceInstaller = forceInstaller || (strcmp(argv[i], "--install") == 0);
|
||||||
forceDLCInstaller = forceDLCInstaller || (strcmp(argv[i], "--install-dlc") == 0);
|
forceDLCInstaller = forceDLCInstaller || (strcmp(argv[i], "--install-dlc") == 0);
|
||||||
|
useDefaultWorkingDirectory = useDefaultWorkingDirectory || (strcmp(argv[i], "--use-cwd") == 0);
|
||||||
|
|
||||||
if (strcmp(argv[i], "--sdl-video-driver") == 0)
|
if (strcmp(argv[i], "--sdl-video-driver") == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -214,6 +213,12 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!useDefaultWorkingDirectory)
|
||||||
|
{
|
||||||
|
// Set the current working directory to the executable's path.
|
||||||
|
std::filesystem::current_path(os::process::GetExecutablePath().parent_path());
|
||||||
|
}
|
||||||
|
|
||||||
Config::Load();
|
Config::Load();
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
|
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue