mirror of https://github.com/AxioDL/metaforce.git
Fix windows
This commit is contained in:
parent
c6db983c41
commit
4cd8ff3586
|
@ -14,9 +14,8 @@ using namespace Windows::Storage;
|
|||
/* Partial path-selection logic from
|
||||
* https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/UICommon/UICommon.cpp
|
||||
* Modified to not use dolphin-binary-relative paths. */
|
||||
kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot, bool dolphin) {
|
||||
kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlot slot) {
|
||||
if (g_Main->IsUSA() && !g_Main->IsTrilogy()) {
|
||||
if (dolphin) {
|
||||
#if !WINDOWS_STORE
|
||||
/* Detect where the User directory is. There are two different cases
|
||||
* 1. HKCU\Software\Dolphin Emulator\UserConfigPath exists
|
||||
|
@ -62,25 +61,13 @@ kabufuda::SystemString CMemoryCardSys::ResolveDolphinCardPath(kabufuda::ECardSlo
|
|||
return {};
|
||||
|
||||
return path;
|
||||
} else {
|
||||
kabufuda::SystemString path = _GetDolphinCardPath(slot);
|
||||
hecl::SanitizePath(path);
|
||||
if (path.find('/') == kabufuda::SystemString::npos) {
|
||||
path = hecl::GetcwdStr() + _SYS_STR("/") + _GetDolphinCardPath(slot);
|
||||
}
|
||||
hecl::SystemString tmpPath = path.substr(0, path.find_last_of(_SYS_STR("/")));
|
||||
hecl::RecursiveMakeDir(tmpPath.c_str());
|
||||
const auto fp = hecl::FopenUnique(path.c_str(), "wb");
|
||||
if (fp) {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot) {
|
||||
kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot slot, bool dolphin) {
|
||||
if (g_Main->IsUSA() && !g_Main->IsTrilogy()) {
|
||||
if (dolphin) {
|
||||
#if !WINDOWS_STORE
|
||||
/* Detect where the User directory is. There are two different cases
|
||||
* 1. HKCU\Software\Dolphin Emulator\UserConfigPath exists
|
||||
|
@ -130,6 +117,19 @@ kabufuda::SystemString CMemoryCardSys::_CreateDolphinCard(kabufuda::ECardSlot sl
|
|||
}
|
||||
|
||||
return path;
|
||||
} else {
|
||||
kabufuda::SystemString path = _GetDolphinCardPath(slot);
|
||||
hecl::SanitizePath(path);
|
||||
if (path.find('/') == kabufuda::SystemString::npos) {
|
||||
path = hecl::GetcwdStr() + _SYS_STR("/") + _GetDolphinCardPath(slot);
|
||||
}
|
||||
hecl::SystemString tmpPath = path.substr(0, path.find_last_of(_SYS_STR("/")));
|
||||
hecl::RecursiveMakeDir(tmpPath.c_str());
|
||||
const auto fp = hecl::FopenUnique(path.c_str(), "wb");
|
||||
if (fp) {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue