System: Add missing game list lock

This commit is contained in:
Stenzek
2025-12-01 13:55:24 +10:00
parent 8e3a65c152
commit ceb199b18d
3 changed files with 12 additions and 4 deletions

View File

@@ -380,7 +380,7 @@ bool MemoryCard::SaveIfChanged(bool display_osd_message)
if (display_osd_message)
{
std::string icon_path = System::GetGameIconPath();
std::string icon_path = System::GetGameIconPath(false);
if (icon_path.empty())
icon_path = ICON_PF_MEMORY_CARD;

View File

@@ -806,12 +806,20 @@ System::BootMode System::GetBootMode()
return s_state.boot_mode;
}
std::string System::GetGameIconPath()
std::string System::GetGameIconPath(bool allow_achievements_badge)
{
u32 achievements_game_id = 0;
if (allow_achievements_badge)
{
const auto lock = Achievements::GetLock();
achievements_game_id = Achievements::GetGameID();
}
const auto lock = GameList::GetLock();
return GameList::GetGameIconPath((s_state.running_game_custom_title || !s_state.running_game_entry) ?
std::string_view(s_state.running_game_title) :
std::string_view(),
s_state.running_game_serial, s_state.running_game_path, Achievements::GetGameID());
s_state.running_game_serial, s_state.running_game_path, achievements_game_id);
}
bool System::IsUsingKnownPS1BIOS()

View File

@@ -238,7 +238,7 @@ bool IsUsingKnownPS1BIOS();
BootMode GetBootMode();
/// Returns a path to the game icon, if any.
std::string GetGameIconPath();
std::string GetGameIconPath(bool allow_achievements_badge);
/// Returns the time elapsed in the current play session.
u64 GetSessionPlayedTime();