Don't change the working dir on startup.

This commit is contained in:
Unknown W. Brackets 2015-10-30 21:04:45 -07:00
parent 293ab099bc
commit 05d5aae801

View file

@ -359,25 +359,15 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
EnableCrashingOnCrashes();
wchar_t modulePath[MAX_PATH];
GetModuleFileName(NULL, modulePath, MAX_PATH);
for (size_t 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
#ifndef _DEBUG
bool showLog = false;
#else
bool showLog = false;
#endif
VFSRegister("", new DirectoryAssetReader("assets/"));
VFSRegister("", new DirectoryAssetReader(""));
const std::string &exePath = File::GetExeDirectory();
VFSRegister("", new DirectoryAssetReader((exePath + "/assets/").c_str()));
VFSRegister("", new DirectoryAssetReader(exePath.c_str()));
wchar_t lcCountry[256];