diff --git a/Source/Core/DiscIO/Enums.cpp b/Source/Core/DiscIO/Enums.cpp index eae90b34ab..94af6c75a9 100644 --- a/Source/Core/DiscIO/Enums.cpp +++ b/Source/Core/DiscIO/Enums.cpp @@ -11,6 +11,16 @@ namespace DiscIO { +bool IsDisc(Platform volume_type) +{ + return volume_type == Platform::GAMECUBE_DISC || volume_type == Platform::WII_DISC; +} + +bool IsWii(Platform volume_type) +{ + return volume_type == Platform::WII_DISC || volume_type == Platform::WII_WAD; +} + bool IsNTSC(Region region) { return region == Region::NTSC_J || region == Region::NTSC_U || region == Region::NTSC_K; diff --git a/Source/Core/DiscIO/Enums.h b/Source/Core/DiscIO/Enums.h index fb604fd3be..cce235c38e 100644 --- a/Source/Core/DiscIO/Enums.h +++ b/Source/Core/DiscIO/Enums.h @@ -68,6 +68,8 @@ enum class Language LANGUAGE_UNKNOWN }; +bool IsDisc(Platform volume_type); +bool IsWii(Platform volume_type); bool IsNTSC(Region region); Country TypicalCountryForRegion(Region region); Region RegionSwitchGC(u8 country_code); diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 7a35cdb10a..910295b7b2 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -259,7 +259,7 @@ bool GameListItem::BannerChanged() if (!m_volume_banner.empty()) return false; - if (m_platform != DiscIO::Platform::WII_DISC && m_platform != DiscIO::Platform::WII_WAD) + if (!DiscIO::IsWii(m_platform)) return false; auto& banner = m_pending.volume_banner; @@ -286,7 +286,7 @@ std::string GameListItem::GetDescription(DiscIO::Language language) const std::string GameListItem::GetDescription() const { - bool wii = m_platform != DiscIO::Platform::GAMECUBE_DISC; + const bool wii = DiscIO::IsWii(m_platform); return GetDescription(SConfig::GetInstance().GetCurrentLanguage(wii)); } @@ -300,7 +300,7 @@ std::string GameListItem::GetName() const if (!m_custom_name.empty()) return m_custom_name; - bool wii = m_platform != DiscIO::Platform::GAMECUBE_DISC; + const bool wii = DiscIO::IsWii(m_platform); std::string name = GetName(SConfig::GetInstance().GetCurrentLanguage(wii)); if (!name.empty()) return name; @@ -356,7 +356,7 @@ std::vector GameListItem::GetLanguages() const const std::string GameListItem::GetWiiFSPath() const { - if (m_platform != DiscIO::Platform::WII_DISC && m_platform != DiscIO::Platform::WII_WAD) + if (!DiscIO::IsWii(m_platform)) return ""; const std::string path = Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT); diff --git a/Source/Core/DolphinWX/ISOProperties/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties/ISOProperties.cpp index b05baa7250..5c81f904a5 100644 --- a/Source/Core/DolphinWX/ISOProperties/ISOProperties.cpp +++ b/Source/Core/DolphinWX/ISOProperties/ISOProperties.cpp @@ -430,7 +430,7 @@ void CISOProperties::CreateGUIControls() gecko_layout->Add(m_geckocode_panel, 1, wxEXPAND); gecko_cheat_page->SetSizer(gecko_layout); - if (m_open_iso->GetVolumeType() != DiscIO::Platform::WII_WAD) + if (DiscIO::IsDisc(m_open_iso->GetVolumeType())) { m_Notebook->AddPage(new FilesystemPanel(m_Notebook, ID_FILESYSTEM, m_open_iso), _("Filesystem")); diff --git a/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp b/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp index 7ac5b27287..36fba6c543 100644 --- a/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp +++ b/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp @@ -198,7 +198,7 @@ void InfoPanel::LoadBannerDetails() { LoadBannerImage(); - const bool is_wii = m_opened_iso->GetVolumeType() != DiscIO::Platform::GAMECUBE_DISC; + const bool is_wii = DiscIO::IsWii(m_opened_iso->GetVolumeType()); ChangeBannerDetails(SConfig::GetInstance().GetCurrentLanguage(is_wii)); } @@ -311,7 +311,7 @@ wxStaticBoxSizer* InfoPanel::CreateBannerDetailsSizer() wxChoice* InfoPanel::CreateCommentLanguageChoice() { const auto languages = m_game_list_item.GetLanguages(); - const bool is_wii = m_opened_iso->GetVolumeType() != DiscIO::Platform::GAMECUBE_DISC; + const bool is_wii = DiscIO::IsWii(m_opened_iso->GetVolumeType()); const auto preferred_language = SConfig::GetInstance().GetCurrentLanguage(is_wii); const int preferred_language_index = FindPreferredLanguageIndex(preferred_language, languages); const auto choices = GetLanguageChoiceStrings(languages);