mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-15 16:33:15 -03:00
Merge pull request #14247 from jordan-woyak/fix-wiiware
DiscIO/Volume: Fix CreateVolume for WiiWare.
This commit is contained in:
@@ -88,7 +88,7 @@ std::map<Language, std::string> Volume::ReadWiiNames(const std::vector<char16_t>
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T = std::identity>
|
template <typename T = std::identity>
|
||||||
static std::unique_ptr<VolumeDisc> TryCreateDisc(std::unique_ptr<BlobReader> reader,
|
static std::unique_ptr<VolumeDisc> TryCreateDisc(std::unique_ptr<BlobReader>& reader,
|
||||||
const T& reader_adapter_factory = {})
|
const T& reader_adapter_factory = {})
|
||||||
{
|
{
|
||||||
if (!reader)
|
if (!reader)
|
||||||
@@ -109,7 +109,7 @@ static std::unique_ptr<VolumeDisc> TryCreateDisc(std::unique_ptr<BlobReader> rea
|
|||||||
|
|
||||||
std::unique_ptr<VolumeDisc> CreateDisc(std::unique_ptr<BlobReader> reader)
|
std::unique_ptr<VolumeDisc> CreateDisc(std::unique_ptr<BlobReader> reader)
|
||||||
{
|
{
|
||||||
return TryCreateDisc(std::move(reader));
|
return TryCreateDisc(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VolumeDisc> CreateDisc(const std::string& path)
|
std::unique_ptr<VolumeDisc> CreateDisc(const std::string& path)
|
||||||
@@ -119,13 +119,15 @@ std::unique_ptr<VolumeDisc> CreateDisc(const std::string& path)
|
|||||||
|
|
||||||
std::unique_ptr<VolumeDisc> CreateDiscForCore(const std::string& path)
|
std::unique_ptr<VolumeDisc> CreateDiscForCore(const std::string& path)
|
||||||
{
|
{
|
||||||
if (Config::Get(Config::MAIN_LOAD_GAME_INTO_MEMORY))
|
auto reader = CreateBlobReader(path);
|
||||||
return TryCreateDisc(CreateBlobReader(path), CreateScrubbingCachedBlobReader);
|
|
||||||
|
|
||||||
return CreateDisc(path);
|
if (Config::Get(Config::MAIN_LOAD_GAME_INTO_MEMORY))
|
||||||
|
return TryCreateDisc(reader, CreateScrubbingCachedBlobReader);
|
||||||
|
|
||||||
|
return TryCreateDisc(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<VolumeWAD> TryCreateWAD(std::unique_ptr<BlobReader> reader)
|
static std::unique_ptr<VolumeWAD> TryCreateWAD(std::unique_ptr<BlobReader>& reader)
|
||||||
{
|
{
|
||||||
if (!reader)
|
if (!reader)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -142,7 +144,7 @@ static std::unique_ptr<VolumeWAD> TryCreateWAD(std::unique_ptr<BlobReader> reade
|
|||||||
|
|
||||||
std::unique_ptr<VolumeWAD> CreateWAD(std::unique_ptr<BlobReader> reader)
|
std::unique_ptr<VolumeWAD> CreateWAD(std::unique_ptr<BlobReader> reader)
|
||||||
{
|
{
|
||||||
return TryCreateWAD(std::move(reader));
|
return TryCreateWAD(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VolumeWAD> CreateWAD(const std::string& path)
|
std::unique_ptr<VolumeWAD> CreateWAD(const std::string& path)
|
||||||
@@ -152,11 +154,11 @@ std::unique_ptr<VolumeWAD> CreateWAD(const std::string& path)
|
|||||||
|
|
||||||
std::unique_ptr<Volume> CreateVolume(std::unique_ptr<BlobReader> reader)
|
std::unique_ptr<Volume> CreateVolume(std::unique_ptr<BlobReader> reader)
|
||||||
{
|
{
|
||||||
std::unique_ptr<VolumeDisc> disc = TryCreateDisc(std::move(reader));
|
std::unique_ptr<VolumeDisc> disc = TryCreateDisc(reader);
|
||||||
if (disc)
|
if (disc)
|
||||||
return disc;
|
return disc;
|
||||||
|
|
||||||
std::unique_ptr<VolumeWAD> wad = TryCreateWAD(std::move(reader));
|
std::unique_ptr<VolumeWAD> wad = TryCreateWAD(reader);
|
||||||
if (wad)
|
if (wad)
|
||||||
return wad;
|
return wad;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user