Merge pull request #2665 from AdmiralCurtiss/relative-memory-card-paths

GameCube Config: Store paths relatively when selected file is within Dolphin's directory. (Windows)
This commit is contained in:
skidau
2015-07-20 14:09:36 +10:00
2 changed files with 21 additions and 13 deletions

View File

@ -731,8 +731,12 @@ std::string& GetExeDirectory()
if (DolphinPath.empty())
{
TCHAR Dolphin_exe_Path[2048];
TCHAR Dolphin_exe_Clean_Path[MAX_PATH];
GetModuleFileName(nullptr, Dolphin_exe_Path, 2048);
DolphinPath = TStrToUTF8(Dolphin_exe_Path);
if (_tfullpath(Dolphin_exe_Clean_Path, Dolphin_exe_Path, MAX_PATH) != nullptr)
DolphinPath = TStrToUTF8(Dolphin_exe_Clean_Path);
else
DolphinPath = TStrToUTF8(Dolphin_exe_Path);
DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\'));
}
return DolphinPath;