Skip to content

Commit 4ee8738

Browse files
committed
FullscreenUI: Stop icons leaking into cover cache
1 parent 93a13a6 commit 4ee8738

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/core/fullscreen_ui.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8932,13 +8932,20 @@ GPUTexture* FullscreenUI::GetGameListCover(const GameList::Entry* entry, bool fa
89328932
if (Achievements::GetGamePath() == entry->path)
89338933
cover_it->second = Achievements::GetGameIconPath();
89348934
}
8935+
}
89358936

8936-
// because memcard icons are crap res
8937-
if (fallback_to_icon && cover_it->second.empty())
8938-
cover_it->second = GameList::GetGameIconPath(entry->serial, entry->path);
8937+
// because memcard icons are crap res
8938+
if (fallback_to_icon && cover_it->second.empty())
8939+
{
8940+
cover_it = s_state.icon_image_map.find(entry->serial);
8941+
if (cover_it == s_state.icon_image_map.end())
8942+
{
8943+
std::string icon_path = GameList::GetGameIconPath(entry->serial, entry->path);
8944+
cover_it = s_state.icon_image_map.emplace(entry->serial, std::move(icon_path)).first;
8945+
}
89398946
}
89408947

8941-
GPUTexture* const tex = (!cover_it->second.empty()) ? GetCachedTextureAsync(cover_it->second.c_str()) : nullptr;
8948+
GPUTexture* const tex = (!cover_it->second.empty()) ? GetCachedTextureAsync(cover_it->second) : nullptr;
89428949
return tex ? tex : (return_default_image ? GetTextureForGameListEntryType(entry->type) : nullptr);
89438950
}
89448951

0 commit comments

Comments
 (0)