diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 0e4fe1ef3..5541837ee 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -7710,7 +7710,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size) static constexpr float info_top_margin = 20.0f; static constexpr float cover_size = 320.0f; GPUTexture* cover_texture = selected_entry ? GetGameListCover(selected_entry, false, false) : - GetTextureForGameListEntryType(GameList::EntryType::Count); + GetTextureForGameListEntryType(GameList::EntryType::MaxCount); if (cover_texture) { const ImRect image_rect(CenterImage( diff --git a/src/core/game_list.cpp b/src/core/game_list.cpp index e9b7a1973..903e4420b 100644 --- a/src/core/game_list.cpp +++ b/src/core/game_list.cpp @@ -145,7 +145,7 @@ static bool s_game_list_loaded = false; const char* GameList::GetEntryTypeName(EntryType type) { - static std::array(EntryType::Count)> names = {{ + static std::array(EntryType::MaxCount)> names = {{ "Disc", "DiscSet", "PSExe", @@ -157,7 +157,7 @@ const char* GameList::GetEntryTypeName(EntryType type) const char* GameList::GetEntryTypeDisplayName(EntryType type) { - static std::array(EntryType::Count)> names = {{ + static std::array(EntryType::MaxCount)> names = {{ TRANSLATE_DISAMBIG_NOOP("GameList", "Disc", "EntryType"), TRANSLATE_DISAMBIG_NOOP("GameList", "Disc Set", "EntryType"), TRANSLATE_DISAMBIG_NOOP("GameList", "PS-EXE", "EntryType"), @@ -372,7 +372,7 @@ bool GameList::GetDiscListEntry(const std::string& path, Entry* entry) void GameList::MakeInvalidEntry(Entry* entry) { - entry->type = EntryType::Count; + entry->type = EntryType::MaxCount; entry->region = DiscRegion::Other; entry->disc_set_index = -1; entry->disc_set_member = false; @@ -447,7 +447,7 @@ bool GameList::LoadEntriesFromCache(BinaryFileReader& reader) !reader.ReadS64(&ge.file_size) || !reader.ReadU64(&ge.uncompressed_size) || !reader.ReadU64(reinterpret_cast(&ge.last_modified_time)) || !reader.ReadS8(&ge.disc_set_index) || !reader.Read(ge.achievements_hash.data(), ge.achievements_hash.size()) || - region >= static_cast(DiscRegion::Count) || type > static_cast(EntryType::Count)) + region >= static_cast(DiscRegion::Count) || type > static_cast(EntryType::MaxCount)) { WARNING_LOG("Game list cache entry is corrupted"); return false; diff --git a/src/core/game_list.h b/src/core/game_list.h index f76ed2d84..22d570626 100644 --- a/src/core/game_list.h +++ b/src/core/game_list.h @@ -28,12 +28,12 @@ enum class EntryType : u8 PSExe, Playlist, PSF, - Count + MaxCount }; struct Entry { - EntryType type = EntryType::Count; + EntryType type = EntryType::MaxCount; DiscRegion region = DiscRegion::Other; s8 disc_set_index = -1; @@ -69,7 +69,7 @@ struct Entry TinyString GetReleaseDateString() const; - ALWAYS_INLINE bool IsValid() const { return (type < EntryType::Count); } + ALWAYS_INLINE bool IsValid() const { return (type < EntryType::MaxCount); } ALWAYS_INLINE bool IsDisc() const { return (type == EntryType::Disc); } ALWAYS_INLINE bool IsDiscSet() const { return (type == EntryType::DiscSet); } ALWAYS_INLINE bool HasCustomLanguage() const { return (custom_language != GameDatabase::Language::MaxCount); } diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index 52f23cab2..a5be080c5 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -875,7 +875,7 @@ bool GameListModel::lessThan(const GameList::Entry* left, const GameList::Entry* void GameListModel::loadThemeSpecificImages() { - for (u32 i = 0; i < static_cast(GameList::EntryType::Count); i++) + for (u32 i = 0; i < static_cast(GameList::EntryType::MaxCount); i++) m_type_pixmaps[i] = QtUtils::GetIconForEntryType(static_cast(i)).pixmap(QSize(24, 24)); } @@ -968,7 +968,7 @@ public: return false; } - if (m_filter_type != GameList::EntryType::Count && entry->type != m_filter_type) + if (m_filter_type != GameList::EntryType::MaxCount && entry->type != m_filter_type) return false; if (m_filter_region != DiscRegion::Count && entry->region != m_filter_region) @@ -987,7 +987,7 @@ public: private: GameListModel* m_model; - GameList::EntryType m_filter_type = GameList::EntryType::Count; + GameList::EntryType m_filter_type = GameList::EntryType::MaxCount; DiscRegion m_filter_region = DiscRegion::Count; QString m_filter_name; bool m_merge_disc_sets = true; @@ -1126,7 +1126,7 @@ void GameListWidget::initialize() m_sort_model->setMergeDiscSets(merge_disc_sets); m_ui.setupUi(this); - for (u32 type = 0; type < static_cast(GameList::EntryType::Count); type++) + for (u32 type = 0; type < static_cast(GameList::EntryType::MaxCount); type++) { m_ui.filterType->addItem( QtUtils::GetIconForEntryType(static_cast(type)), @@ -1144,7 +1144,7 @@ void GameListWidget::initialize() connect(m_ui.viewGridTitles, &QPushButton::toggled, this, &GameListWidget::setShowCoverTitles); connect(m_ui.viewMergeDiscSets, &QPushButton::toggled, this, &GameListWidget::setMergeDiscSets); connect(m_ui.filterType, &QComboBox::currentIndexChanged, this, [this](int index) { - m_sort_model->setFilterType((index == 0) ? GameList::EntryType::Count : + m_sort_model->setFilterType((index == 0) ? GameList::EntryType::MaxCount : static_cast(index - 1)); }); connect(m_ui.filterRegion, &QComboBox::currentIndexChanged, this, [this](int index) { diff --git a/src/duckstation-qt/gamelistwidget.h b/src/duckstation-qt/gamelistwidget.h index 045ddfb3d..ee444141b 100644 --- a/src/duckstation-qt/gamelistwidget.h +++ b/src/duckstation-qt/gamelistwidget.h @@ -129,7 +129,7 @@ private: bool m_show_game_icons = false; std::array m_column_display_names; - std::array(GameList::EntryType::Count)> m_type_pixmaps; + std::array(GameList::EntryType::MaxCount)> m_type_pixmaps; std::array(GameDatabase::CompatibilityRating::Count)> m_compatibility_pixmaps; QImage m_placeholder_image; diff --git a/src/duckstation-qt/gamesummarywidget.cpp b/src/duckstation-qt/gamesummarywidget.cpp index 9ee016ba1..8f864f026 100644 --- a/src/duckstation-qt/gamesummarywidget.cpp +++ b/src/duckstation-qt/gamesummarywidget.cpp @@ -32,7 +32,7 @@ GameSummaryWidget::GameSummaryWidget(const std::string& path, const std::string& m_ui.setupUi(this); m_ui.revision->setVisible(false); - for (u32 i = 0; i < static_cast(GameList::EntryType::Count); i++) + for (u32 i = 0; i < static_cast(GameList::EntryType::MaxCount); i++) { m_ui.entryType->addItem( QtUtils::GetIconForEntryType(static_cast(i)),