mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 14:01:17 +12:00
more changes.
This commit is contained in:
parent
fc639bcac3
commit
b1a01ecfdc
4 changed files with 8 additions and 6 deletions
|
@ -12,7 +12,7 @@ class FSPath : public fs::path {
|
||||||
template <class T>
|
template <class T>
|
||||||
static FSPath Convert(const T& input)
|
static FSPath Convert(const T& input)
|
||||||
{
|
{
|
||||||
return FSPath{} / input;
|
return FSPath{} / FSPath{input};
|
||||||
}
|
}
|
||||||
FSPath& operator/= (const FSPath & other);
|
FSPath& operator/= (const FSPath & other);
|
||||||
FSPath& operator/ (const FSPath & other);
|
FSPath& operator/ (const FSPath & other);
|
||||||
|
|
|
@ -158,11 +158,13 @@ bool FSCVirtualFile_Host::fscDirNext(FSCDirEntry* dirEntry)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FSCVirtualFile* FSCVirtualFile_Host::OpenFile(const FSPath& path, FSC_ACCESS_FLAG accessFlags, sint32& fscStatus)
|
FSCVirtualFile* FSCVirtualFile_Host::OpenFile(const fs::path& rawPath, FSC_ACCESS_FLAG accessFlags, sint32& fscStatus)
|
||||||
{
|
{
|
||||||
if (!HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_FILE) && !HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_DIR))
|
if (!HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_FILE) && !HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_DIR))
|
||||||
cemu_assert_debug(false); // not allowed. At least one of both flags must be set
|
cemu_assert_debug(false); // not allowed. At least one of both flags must be set
|
||||||
|
|
||||||
|
auto path = FSPath::Convert(rawPath);
|
||||||
|
|
||||||
// attempt to open as file
|
// attempt to open as file
|
||||||
if (HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_FILE))
|
if (HAS_FLAG(accessFlags, FSC_ACCESS_FLAG::OPEN_FILE))
|
||||||
{
|
{
|
||||||
|
@ -225,7 +227,7 @@ public:
|
||||||
FSCVirtualFile* fscDeviceOpenByPath(std::wstring_view path, FSC_ACCESS_FLAG accessFlags, void* ctx, sint32* fscStatus) override
|
FSCVirtualFile* fscDeviceOpenByPath(std::wstring_view path, FSC_ACCESS_FLAG accessFlags, void* ctx, sint32* fscStatus) override
|
||||||
{
|
{
|
||||||
*fscStatus = FSC_STATUS_OK;
|
*fscStatus = FSC_STATUS_OK;
|
||||||
FSCVirtualFile* vf = FSCVirtualFile_Host::OpenFile(FSPath::Convert(path), accessFlags, *fscStatus);
|
FSCVirtualFile* vf = FSCVirtualFile_Host::OpenFile(path, accessFlags, *fscStatus);
|
||||||
cemu_assert_debug((bool)vf == (*fscStatus == FSC_STATUS_OK));
|
cemu_assert_debug((bool)vf == (*fscStatus == FSC_STATUS_OK));
|
||||||
return vf;
|
return vf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
class FSCVirtualFile_Host : public FSCVirtualFile
|
class FSCVirtualFile_Host : public FSCVirtualFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static FSCVirtualFile* OpenFile(const FSPath& path, FSC_ACCESS_FLAG accessFlags, sint32& fscStatus);
|
static FSCVirtualFile* OpenFile(const fs::path& path, FSC_ACCESS_FLAG accessFlags, sint32& fscStatus);
|
||||||
~FSCVirtualFile_Host() override;
|
~FSCVirtualFile_Host() override;
|
||||||
|
|
||||||
sint32 fscGetType() override;
|
sint32 fscGetType() override;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
|
|
||||||
std::mutex sSLMutex;
|
std::mutex sSLMutex;
|
||||||
fs::path sSLMLCPath;
|
FSPath sSLMLCPath;
|
||||||
|
|
||||||
std::vector<SaveInfo*> sSLList;
|
std::vector<SaveInfo*> sSLList;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ void CafeSaveList::RefreshThreadWorker()
|
||||||
sSLList.clear();
|
sSLList.clear();
|
||||||
|
|
||||||
sSLMutex.lock();
|
sSLMutex.lock();
|
||||||
fs::path mlcPath = sSLMLCPath;
|
FSPath mlcPath = sSLMLCPath;
|
||||||
sSLMutex.unlock();
|
sSLMutex.unlock();
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
for (auto it_titleHigh : fs::directory_iterator(mlcPath / "usr/save", ec))
|
for (auto it_titleHigh : fs::directory_iterator(mlcPath / "usr/save", ec))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue