Fix Windows path separator issue

This commit is contained in:
Random06457 2022-05-06 10:25:39 +09:00
commit 47acc08996
2 changed files with 1 additions and 6 deletions

View file

@ -52,7 +52,7 @@ public:
for (auto& p : fs::recursive_directory_iterator(dir))
{
if (!p.is_directory())
lst.push_back(p.path().string());
lst.push_back(p.path().generic_string());
}
}

View file

@ -242,12 +242,7 @@ namespace Ship {
}
std::shared_ptr<ResourcePromise> ResourceMgr::LoadResourceAsync(std::string FilePath) {
// todo: what?
#ifdef _WIN32
StringHelper::ReplaceOriginal(FilePath, "/", "\\");
#else
StringHelper::ReplaceOriginal(FilePath, "\\", "/");
#endif
if (StringHelper::StartsWith(FilePath, "__OTR__"))
FilePath = StringHelper::Split(FilePath, "__OTR__")[1];