mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-20 23:54:48 +00:00
Win32: Set current directory at startup to where the exe is.
Fixes the "out-of-the-box" experience in MSVC.
This commit is contained in:
parent
85270d5898
commit
af1ae8fde7
@ -62,6 +62,17 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
{
|
||||
Common::EnableCrashingOnCrashes();
|
||||
|
||||
wchar_t modulePath[MAX_PATH];
|
||||
GetModuleFileName(NULL, modulePath, MAX_PATH);
|
||||
for (int i = wcslen(modulePath) - 1; i > 0; i--) {
|
||||
if (modulePath[i] == '\\') {
|
||||
modulePath[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SetCurrentDirectory(modulePath);
|
||||
// GetCurrentDirectory(MAX_PATH, modulePath); // for checking in the debugger
|
||||
|
||||
bool hideLog = true;
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user