@@ -448,7 +448,8 @@ static void DrawGameListSettingsWindow();
448448static void SwitchToGameList ();
449449static void PopulateGameListEntryList ();
450450static GPUTexture* GetTextureForGameListEntryType (GameList::EntryType type);
451- static GPUTexture* GetGameListCover (const GameList::Entry* entry, bool fallback_to_icon);
451+ static GPUTexture* GetGameListCover (const GameList::Entry* entry, bool fallback_to_achievements_icon,
452+ bool fallback_to_icon);
452453static GPUTexture* GetGameListCoverTrophy (const GameList::Entry* entry, const ImVec2& image_size);
453454static GPUTexture* GetCoverForCurrentGame ();
454455
@@ -7527,7 +7528,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
75277528 if (!visible)
75287529 continue ;
75297530
7530- GPUTexture* cover_texture = GetGameListCover (entry, true );
7531+ GPUTexture* cover_texture = GetGameListCover (entry, false , true );
75317532
75327533 if (entry->serial .empty ())
75337534 {
@@ -7589,7 +7590,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
75897590 {
75907591 static constexpr float info_top_margin = 20 .0f ;
75917592 static constexpr float cover_size = 320 .0f ;
7592- GPUTexture* cover_texture = selected_entry ? GetGameListCover (selected_entry, false ) :
7593+ GPUTexture* cover_texture = selected_entry ? GetGameListCover (selected_entry, false , false ) :
75937594 GetTextureForGameListEntryType (GameList::EntryType::Count);
75947595 if (cover_texture)
75957596 {
@@ -7803,7 +7804,7 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
78037804 bb.Min += style.FramePadding ;
78047805 bb.Max -= style.FramePadding ;
78057806
7806- GPUTexture* const cover_texture = GetGameListCover (entry, false );
7807+ GPUTexture* const cover_texture = GetGameListCover (entry, false , false );
78077808 const ImRect image_rect (
78087809 CenterImage (ImRect (bb.Min , bb.Min + image_size), ImVec2 (static_cast <float >(cover_texture->GetWidth ()),
78097810 static_cast <float >(cover_texture->GetHeight ()))));
@@ -8202,20 +8203,27 @@ void FullscreenUI::SwitchToGameList()
82028203 QueueResetFocus (FocusResetType::ViewChanged);
82038204}
82048205
8205- GPUTexture* FullscreenUI::GetGameListCover (const GameList::Entry* entry, bool fallback_to_icon)
8206+ GPUTexture* FullscreenUI::GetGameListCover (const GameList::Entry* entry, bool fallback_to_achievements_icon,
8207+ bool fallback_to_icon)
82068208{
82078209 // lookup and grab cover image
82088210 auto cover_it = s_state.cover_image_map .find (entry->path );
82098211 if (cover_it == s_state.cover_image_map .end ())
82108212 {
82118213 std::string cover_path = GameList::GetCoverImagePathForEntry (entry);
82128214 cover_it = s_state.cover_image_map .emplace (entry->path , std::move (cover_path)).first ;
8213- }
82148215
8215- if (fallback_to_icon && cover_it->second .empty ())
8216- {
8217- std::string icon_path = GameList::GetGameIconPath (entry->serial , entry->path );
8218- cover_it = s_state.icon_image_map .emplace (entry->path , std::move (icon_path)).first ;
8216+ // try achievements image before memcard icon
8217+ if (fallback_to_achievements_icon && cover_it->second .empty () && Achievements::IsActive ())
8218+ {
8219+ const auto lock = Achievements::GetLock ();
8220+ if (Achievements::GetGamePath () == entry->path )
8221+ cover_it->second = Achievements::GetGameIconPath ();
8222+ }
8223+
8224+ // because memcard icons are crap res
8225+ if (fallback_to_icon && cover_it->second .empty ())
8226+ cover_it->second = GameList::GetGameIconPath (entry->serial , entry->path );
82198227 }
82208228
82218229 GPUTexture* tex = (!cover_it->second .empty ()) ? GetCachedTextureAsync (cover_it->second .c_str ()) : nullptr ;
@@ -8265,7 +8273,7 @@ GPUTexture* FullscreenUI::GetCoverForCurrentGame()
82658273 if (!entry)
82668274 return s_state.fallback_disc_texture .get ();
82678275
8268- return GetGameListCover (entry, true );
8276+ return GetGameListCover (entry, true , true );
82698277}
82708278
82718279// ////////////////////////////////////////////////////////////////////////
0 commit comments