diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index ec5e229499..151d21822d 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -87,12 +87,7 @@ void HiresTexture::Update() } const std::string& game_id = SConfig::GetInstance().m_strUniqueID; - std::string texture_directory = GetTextureFolder(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)); - + const std::string texture_directory = GetTextureDirectory(game_id); std::vector extensions { ".png", ".bmp", @@ -439,9 +434,15 @@ std::unique_ptr HiresTexture::Load(const std::string& base_filenam 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() diff --git a/Source/Core/VideoCommon/HiresTextures.h b/Source/Core/VideoCommon/HiresTextures.h index 998984ed75..be5b14bc59 100644 --- a/Source/Core/VideoCommon/HiresTextures.h +++ b/Source/Core/VideoCommon/HiresTextures.h @@ -51,7 +51,7 @@ private: static std::unique_ptr Load(const std::string& base_filename, u32 width, u32 height); static void Prefetch(); - static std::string GetTextureFolder(const std::string& game_id); + static std::string GetTextureDirectory(const std::string& game_id); HiresTexture() {}