Unify the way of setting game ID, title ID, revision

The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
This commit is contained in:
JosJuice
2017-03-09 09:47:43 +01:00
parent 883bec873f
commit ced1614cac
21 changed files with 126 additions and 117 deletions

View File

@ -87,7 +87,7 @@ void HiresTexture::Update()
s_textureCache.clear();
}
const std::string& game_id = SConfig::GetInstance().m_strGameID;
const std::string& game_id = SConfig::GetInstance().GetGameID();
const std::string texture_directory = GetTextureDirectory(game_id);
std::vector<std::string> extensions{
".png", ".bmp", ".tga", ".dds",
@ -226,7 +226,7 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co
u64 tlut_hash = tlut_size ? GetHashHiresTexture(tlut, (int)tlut_size,
g_ActiveConfig.iSafeTextureCache_ColorSamples) :
0;
name = StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_strGameID.c_str(),
name = StringFromFormat("%s_%08x_%i", SConfig::GetInstance().GetGameID().c_str(),
(u32)(tex_hash ^ tlut_hash), (u16)format);
if (s_textureMap.find(name) != s_textureMap.end())
{

View File

@ -437,7 +437,7 @@ TextureCacheBase::DoPartialTextureUpdates(TCacheEntryBase* entry_to_update, u8*
void TextureCacheBase::DumpTexture(TCacheEntryBase* entry, std::string basename, unsigned int level)
{
std::string szDir = File::GetUserPath(D_DUMPTEXTURES_IDX) + SConfig::GetInstance().m_strGameID;
std::string szDir = File::GetUserPath(D_DUMPTEXTURES_IDX) + SConfig::GetInstance().GetGameID();
// make sure that the directory exists
if (!File::Exists(szDir) || !File::IsDirectory(szDir))