mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
GameList: Rename max value enum for consistency
This commit is contained in:
parent
dd885cfe2f
commit
830842891e
@ -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(
|
||||
|
@ -145,7 +145,7 @@ static bool s_game_list_loaded = false;
|
||||
|
||||
const char* GameList::GetEntryTypeName(EntryType type)
|
||||
{
|
||||
static std::array<const char*, static_cast<int>(EntryType::Count)> names = {{
|
||||
static std::array<const char*, static_cast<int>(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<const char*, static_cast<int>(EntryType::Count)> names = {{
|
||||
static std::array<const char*, static_cast<int>(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<u64*>(&ge.last_modified_time)) || !reader.ReadS8(&ge.disc_set_index) ||
|
||||
!reader.Read(ge.achievements_hash.data(), ge.achievements_hash.size()) ||
|
||||
region >= static_cast<u8>(DiscRegion::Count) || type > static_cast<u8>(EntryType::Count))
|
||||
region >= static_cast<u8>(DiscRegion::Count) || type > static_cast<u8>(EntryType::MaxCount))
|
||||
{
|
||||
WARNING_LOG("Game list cache entry is corrupted");
|
||||
return false;
|
||||
|
@ -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); }
|
||||
|
@ -875,7 +875,7 @@ bool GameListModel::lessThan(const GameList::Entry* left, const GameList::Entry*
|
||||
|
||||
void GameListModel::loadThemeSpecificImages()
|
||||
{
|
||||
for (u32 i = 0; i < static_cast<u32>(GameList::EntryType::Count); i++)
|
||||
for (u32 i = 0; i < static_cast<u32>(GameList::EntryType::MaxCount); i++)
|
||||
m_type_pixmaps[i] = QtUtils::GetIconForEntryType(static_cast<GameList::EntryType>(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<u32>(GameList::EntryType::Count); type++)
|
||||
for (u32 type = 0; type < static_cast<u32>(GameList::EntryType::MaxCount); type++)
|
||||
{
|
||||
m_ui.filterType->addItem(
|
||||
QtUtils::GetIconForEntryType(static_cast<GameList::EntryType>(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<GameList::EntryType>(index - 1));
|
||||
});
|
||||
connect(m_ui.filterRegion, &QComboBox::currentIndexChanged, this, [this](int index) {
|
||||
|
@ -129,7 +129,7 @@ private:
|
||||
bool m_show_game_icons = false;
|
||||
|
||||
std::array<QString, Column_Count> m_column_display_names;
|
||||
std::array<QPixmap, static_cast<int>(GameList::EntryType::Count)> m_type_pixmaps;
|
||||
std::array<QPixmap, static_cast<int>(GameList::EntryType::MaxCount)> m_type_pixmaps;
|
||||
std::array<QPixmap, static_cast<int>(GameDatabase::CompatibilityRating::Count)> m_compatibility_pixmaps;
|
||||
|
||||
QImage m_placeholder_image;
|
||||
|
@ -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<u32>(GameList::EntryType::Count); i++)
|
||||
for (u32 i = 0; i < static_cast<u32>(GameList::EntryType::MaxCount); i++)
|
||||
{
|
||||
m_ui.entryType->addItem(
|
||||
QtUtils::GetIconForEntryType(static_cast<GameList::EntryType>(i)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user