diff --git a/data/resources/fullscreenui/star-0.png b/data/resources/fullscreenui/star-0.png deleted file mode 100644 index e5b56db70..000000000 Binary files a/data/resources/fullscreenui/star-0.png and /dev/null differ diff --git a/data/resources/fullscreenui/star-1.png b/data/resources/fullscreenui/star-1.png deleted file mode 100644 index ae91a29ac..000000000 Binary files a/data/resources/fullscreenui/star-1.png and /dev/null differ diff --git a/data/resources/fullscreenui/star-2.png b/data/resources/fullscreenui/star-2.png deleted file mode 100644 index f7bee9b1d..000000000 Binary files a/data/resources/fullscreenui/star-2.png and /dev/null differ diff --git a/data/resources/fullscreenui/star-3.png b/data/resources/fullscreenui/star-3.png deleted file mode 100644 index 330aefbac..000000000 Binary files a/data/resources/fullscreenui/star-3.png and /dev/null differ diff --git a/data/resources/fullscreenui/star-4.png b/data/resources/fullscreenui/star-4.png deleted file mode 100644 index 4e9f58dfa..000000000 Binary files a/data/resources/fullscreenui/star-4.png and /dev/null differ diff --git a/data/resources/fullscreenui/star-5.png b/data/resources/fullscreenui/star-5.png deleted file mode 100644 index aa5707ea7..000000000 Binary files a/data/resources/fullscreenui/star-5.png and /dev/null differ diff --git a/data/resources/images/star-0.svg b/data/resources/images/star-0.svg new file mode 100644 index 000000000..65c0a785d --- /dev/null +++ b/data/resources/images/star-0.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/data/resources/images/star-1.svg b/data/resources/images/star-1.svg new file mode 100644 index 000000000..db2d9386b --- /dev/null +++ b/data/resources/images/star-1.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/data/resources/images/star-2.svg b/data/resources/images/star-2.svg new file mode 100644 index 000000000..c538ca455 --- /dev/null +++ b/data/resources/images/star-2.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/data/resources/images/star-3.svg b/data/resources/images/star-3.svg new file mode 100644 index 000000000..2e85c65f1 --- /dev/null +++ b/data/resources/images/star-3.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/data/resources/images/star-4.svg b/data/resources/images/star-4.svg new file mode 100644 index 000000000..ca0940d8f --- /dev/null +++ b/data/resources/images/star-4.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/data/resources/images/star-5.svg b/data/resources/images/star-5.svg new file mode 100644 index 000000000..cd447a96b --- /dev/null +++ b/data/resources/images/star-5.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index a36136f9f..7b9de5c27 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -250,8 +250,6 @@ static bool LoadResources(); static void DestroyResources(); static std::shared_ptr s_app_icon_texture; -static std::array, static_cast(GameDatabase::CompatibilityRating::Count)> - s_game_compatibility_textures; static std::shared_ptr s_fallback_disc_texture; static std::shared_ptr s_fallback_exe_texture; static std::shared_ptr s_fallback_psf_texture; @@ -918,10 +916,6 @@ bool FullscreenUI::LoadResources() s_fallback_exe_texture = LoadTexture("fullscreenui/applications-system.png"); s_fallback_psf_texture = LoadTexture("fullscreenui/multimedia-player.png"); s_fallback_playlist_texture = LoadTexture("fullscreenui/address-book-new.png"); - - for (u32 i = 0; i < static_cast(GameDatabase::CompatibilityRating::Count); i++) - s_game_compatibility_textures[i] = LoadTexture(TinyString::from_format("fullscreenui/star-{}.png", i).c_str()); - return true; } @@ -932,8 +926,6 @@ void FullscreenUI::DestroyResources() s_fallback_psf_texture.reset(); s_fallback_exe_texture.reset(); s_fallback_disc_texture.reset(); - for (auto& tex : s_game_compatibility_textures) - tex.reset(); } ////////////////////////////////////////////////////////////////////////// @@ -6641,8 +6633,8 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size) if (selected_entry->dbentry && selected_entry->dbentry->compatibility != GameDatabase::CompatibilityRating::Unknown) { - ImGui::Image(s_game_compatibility_textures[static_cast(selected_entry->dbentry->compatibility)].get(), - LayoutScale(64.0f, 16.0f)); + ImGui::Image(GetCachedTexture(selected_entry->GetCompatibilityIconFileName(), 88, 16), + LayoutScale(88.0f, 16.0f)); ImGui::SameLine(); } ImGui::Text(" (%s)", GameDatabase::GetCompatibilityRatingDisplayName( diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index b3e82da19..7cea59d38 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -995,6 +995,13 @@ TinyString GameList::Entry::GetLanguageIconFileName() const return TinyString::from_format("images/flags/{}.svg", GetLanguageIcon()); } +TinyString GameList::Entry::GetCompatibilityIconFileName() const +{ + return TinyString::from_format( + "images/star-{}.svg", + static_cast(dbentry ? dbentry->compatibility : GameDatabase::CompatibilityRating::Unknown)); +} + TinyString GameList::Entry::GetReleaseDateString() const { TinyString ret; diff --git a/src/core/game_list.h b/src/core/game_list.h index e8cb106fa..e596439cf 100644 --- a/src/core/game_list.h +++ b/src/core/game_list.h @@ -59,6 +59,7 @@ struct Entry std::string_view GetLanguageIcon() const; TinyString GetLanguageIconFileName() const; + TinyString GetCompatibilityIconFileName() const; TinyString GetReleaseDateString() const; diff --git a/src/duckstation-qt/qtutils.cpp b/src/duckstation-qt/qtutils.cpp index f024ee26f..9bf59f140 100644 --- a/src/duckstation-qt/qtutils.cpp +++ b/src/duckstation-qt/qtutils.cpp @@ -303,7 +303,8 @@ QIcon QtUtils::GetIconForEntryType(GameList::EntryType type) QIcon QtUtils::GetIconForCompatibility(GameDatabase::CompatibilityRating rating) { - return QIcon(QStringLiteral(":/icons/star-%1.png").arg(static_cast(rating))); + return QIcon(QString::fromStdString( + QtHost::GetResourcePath(TinyString::from_format("images/star-{}.svg", static_cast(rating)), true))); } qreal QtUtils::GetDevicePixelRatioForWidget(const QWidget* widget) diff --git a/src/duckstation-qt/resources/duckstation-qt.qrc b/src/duckstation-qt/resources/duckstation-qt.qrc index 4ce905eda..c48021fe3 100644 --- a/src/duckstation-qt/resources/duckstation-qt.qrc +++ b/src/duckstation-qt/resources/duckstation-qt.qrc @@ -220,12 +220,6 @@ icons/QT.png icons/software-update-available@2x.png icons/software-update-available.png - icons/star-0.png - icons/star-1.png - icons/star-2.png - icons/star-3.png - icons/star-4.png - icons/star-5.png icons/system-file-manager@2x.png icons/system-file-manager.png icons/system-search@2x.png diff --git a/src/duckstation-qt/resources/icons/star-0.png b/src/duckstation-qt/resources/icons/star-0.png deleted file mode 100644 index e5b56db70..000000000 Binary files a/src/duckstation-qt/resources/icons/star-0.png and /dev/null differ diff --git a/src/duckstation-qt/resources/icons/star-1.png b/src/duckstation-qt/resources/icons/star-1.png deleted file mode 100644 index ae91a29ac..000000000 Binary files a/src/duckstation-qt/resources/icons/star-1.png and /dev/null differ diff --git a/src/duckstation-qt/resources/icons/star-2.png b/src/duckstation-qt/resources/icons/star-2.png deleted file mode 100644 index f7bee9b1d..000000000 Binary files a/src/duckstation-qt/resources/icons/star-2.png and /dev/null differ diff --git a/src/duckstation-qt/resources/icons/star-3.png b/src/duckstation-qt/resources/icons/star-3.png deleted file mode 100644 index 330aefbac..000000000 Binary files a/src/duckstation-qt/resources/icons/star-3.png and /dev/null differ diff --git a/src/duckstation-qt/resources/icons/star-4.png b/src/duckstation-qt/resources/icons/star-4.png deleted file mode 100644 index 4e9f58dfa..000000000 Binary files a/src/duckstation-qt/resources/icons/star-4.png and /dev/null differ diff --git a/src/duckstation-qt/resources/icons/star-5.png b/src/duckstation-qt/resources/icons/star-5.png deleted file mode 100644 index aa5707ea7..000000000 Binary files a/src/duckstation-qt/resources/icons/star-5.png and /dev/null differ