mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
HiresTextures: Refactor getting directory
This commit is contained in:
parent
42237dc511
commit
03091ce180
@ -87,12 +87,7 @@ void HiresTexture::Update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const std::string& game_id = SConfig::GetInstance().m_strUniqueID;
|
const std::string& game_id = SConfig::GetInstance().m_strUniqueID;
|
||||||
std::string texture_directory = GetTextureFolder(game_id);
|
const std::string texture_directory = GetTextureDirectory(game_id);
|
||||||
|
|
||||||
// If there's no directory with the region-specific ID, look for a 3-character region-free one
|
|
||||||
if (!File::Exists(texture_directory))
|
|
||||||
texture_directory = GetTextureFolder(game_id.substr(0, 3));
|
|
||||||
|
|
||||||
std::vector<std::string> extensions {
|
std::vector<std::string> extensions {
|
||||||
".png",
|
".png",
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -439,9 +434,15 @@ std::unique_ptr<HiresTexture> HiresTexture::Load(const std::string& base_filenam
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string HiresTexture::GetTextureFolder(const std::string& game_id)
|
std::string HiresTexture::GetTextureDirectory(const std::string& game_id)
|
||||||
{
|
{
|
||||||
return File::GetUserPath(D_HIRESTEXTURES_IDX) + game_id;
|
const std::string texture_directory = File::GetUserPath(D_HIRESTEXTURES_IDX) + game_id;
|
||||||
|
|
||||||
|
// If there's no directory with the region-specific ID, look for a 3-character region-free one
|
||||||
|
if (!File::Exists(texture_directory))
|
||||||
|
return File::GetUserPath(D_HIRESTEXTURES_IDX) + game_id.substr(0, 3);
|
||||||
|
|
||||||
|
return texture_directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
HiresTexture::~HiresTexture()
|
HiresTexture::~HiresTexture()
|
||||||
|
@ -51,7 +51,7 @@ private:
|
|||||||
static std::unique_ptr<HiresTexture> Load(const std::string& base_filename, u32 width, u32 height);
|
static std::unique_ptr<HiresTexture> Load(const std::string& base_filename, u32 width, u32 height);
|
||||||
static void Prefetch();
|
static void Prefetch();
|
||||||
|
|
||||||
static std::string GetTextureFolder(const std::string& game_id);
|
static std::string GetTextureDirectory(const std::string& game_id);
|
||||||
|
|
||||||
HiresTexture() {}
|
HiresTexture() {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user