mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-18 11:23:38 +00:00
Merge c3892ff5f2 into 3564a256bf
This commit is contained in:
commit
dabe17a2ff
@ -130,6 +130,12 @@ const std::string SConfig::GetGameTDBID() const
|
||||
return m_gametdb_id;
|
||||
}
|
||||
|
||||
const std::string SConfig::GetGameIDElfDol() const
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
|
||||
return m_game_id_elf_dol;
|
||||
}
|
||||
|
||||
const std::string SConfig::GetTitleName() const
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
|
||||
@ -158,6 +164,7 @@ void SConfig::ResetRunningGameMetadata()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
|
||||
SetRunningGameMetadata("00000000", "", 0, 0, DiscIO::Region::Unknown);
|
||||
SetElfDolID("");
|
||||
}
|
||||
|
||||
void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
|
||||
@ -258,6 +265,12 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
|
||||
DolphinAnalytics::Instance().ReportGameStart();
|
||||
}
|
||||
|
||||
void SConfig::SetElfDolID(const std::string& game_id)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
|
||||
m_game_id_elf_dol = game_id;
|
||||
}
|
||||
|
||||
void SConfig::OnESTitleChanged()
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
@ -357,7 +370,9 @@ struct SetGameMetadata
|
||||
constexpr char BACKSLASH = '\\';
|
||||
constexpr char FORWARDSLASH = '/';
|
||||
std::ranges::replace(executable_path, BACKSLASH, FORWARDSLASH);
|
||||
config->SetRunningGameMetadata(SConfig::MakeGameID(PathToFileName(executable_path)));
|
||||
std::string made_game_id = SConfig::MakeGameID(PathToFileName(executable_path));
|
||||
config->SetRunningGameMetadata(made_game_id);
|
||||
config->SetElfDolID(made_game_id);
|
||||
|
||||
Host_TitleChanged();
|
||||
|
||||
|
||||
@ -61,6 +61,7 @@ struct SConfig
|
||||
|
||||
const std::string GetGameID() const;
|
||||
const std::string GetGameTDBID() const;
|
||||
const std::string GetGameIDElfDol() const;
|
||||
const std::string GetTitleName() const;
|
||||
const std::string GetTitleDescription() const;
|
||||
u64 GetTitleID() const;
|
||||
@ -70,6 +71,8 @@ struct SConfig
|
||||
void SetRunningGameMetadata(const IOS::ES::TMDReader& tmd, DiscIO::Platform platform);
|
||||
void SetRunningGameMetadata(const std::string& game_id);
|
||||
|
||||
void SetElfDolID(const std::string& game_id);
|
||||
|
||||
// Triggered when Dolphin loads a title directly
|
||||
// Reloads title-specific map files, patches, etc.
|
||||
static void OnTitleDirectlyBooted(const Core::CPUThreadGuard& guard);
|
||||
@ -125,6 +128,7 @@ private:
|
||||
mutable std::recursive_mutex m_metadata_lock;
|
||||
|
||||
std::string m_game_id;
|
||||
std::string m_game_id_elf_dol;
|
||||
std::string m_gametdb_id;
|
||||
std::string m_title_name;
|
||||
std::string m_title_description;
|
||||
|
||||
@ -25,8 +25,9 @@ void DynamicInputTextureManager::Load()
|
||||
m_configuration.clear();
|
||||
|
||||
const std::string& game_id = SConfig::GetInstance().GetGameID();
|
||||
const std::set<std::string> dynamic_input_directories =
|
||||
GetTextureDirectoriesWithGameId(File::GetUserPath(D_DYNAMICINPUT_IDX), game_id);
|
||||
const std::string& game_id_elf_dol = SConfig::GetInstance().GetGameIDElfDol();
|
||||
const std::set<std::string> dynamic_input_directories = GetTextureDirectoriesWithGameId(
|
||||
File::GetUserPath(D_DYNAMICINPUT_IDX), game_id_elf_dol.empty() ? game_id : game_id_elf_dol);
|
||||
|
||||
for (const auto& dynamic_input_directory : dynamic_input_directories)
|
||||
{
|
||||
|
||||
@ -85,8 +85,12 @@ void HiresTexture::Update()
|
||||
}
|
||||
|
||||
const std::string& game_id = SConfig::GetInstance().GetGameID();
|
||||
const std::set<std::string> texture_directories =
|
||||
GetTextureDirectoriesWithGameId(File::GetUserPath(D_HIRESTEXTURES_IDX), game_id);
|
||||
const std::string& game_id_elf_dol = SConfig::GetInstance().GetGameIDElfDol();
|
||||
|
||||
// If there is an elf/dol id, use that. Otherwise, fallback to the game id.
|
||||
const std::set<std::string> texture_directories = GetTextureDirectoriesWithGameId(
|
||||
File::GetUserPath(D_HIRESTEXTURES_IDX), game_id_elf_dol.empty() ? game_id : game_id_elf_dol);
|
||||
|
||||
constexpr auto extensions = std::to_array<std::string_view>({".png", ".dds"});
|
||||
|
||||
for (const auto& texture_directory : texture_directories)
|
||||
@ -141,16 +145,12 @@ void HiresTexture::Update()
|
||||
}
|
||||
}
|
||||
|
||||
if (g_ActiveConfig.bCacheHiresTextures)
|
||||
{
|
||||
OSD::AddMessage(fmt::format("Loading '{}' custom textures", s_hires_texture_cache.size()),
|
||||
10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
OSD::AddMessage(
|
||||
fmt::format("Found '{}' custom textures", s_hires_texture_id_to_arbmipmap.size()), 10000);
|
||||
}
|
||||
const auto message =
|
||||
fmt::format("{} '{}' custom textures for {} '{}'",
|
||||
g_ActiveConfig.bCacheHiresTextures ? "Preloading" : "Found",
|
||||
s_hires_texture_cache.size(), game_id_elf_dol.empty() ? "game" : "elf/dol",
|
||||
game_id_elf_dol.empty() ? game_id : game_id_elf_dol);
|
||||
OSD::AddMessage(message, 10000);
|
||||
}
|
||||
|
||||
void HiresTexture::Clear()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user