diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2016-07-13 19:51:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-13 19:51:01 +0200 |
| commit | 014037ebb7897bd7051bdd9b76128fbc20db1674 (patch) | |
| tree | 2a47fb496d72d5c72413b6433afc4006fdc4aa02 /Source/Core/DolphinWX/ISOFile.cpp | |
| parent | 89a03174ccfcc0dc80c9f59b84338f508919a555 (diff) | |
| parent | 0a15aaaa123482ecf7b2490a13e33a884416d51c (diff) | |
Merge pull request #3983 from JosJuice/discio-enums
Move DiscIO enums to a new file
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/ISOFile.cpp | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 2ec148ef16..7173a6aeda 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -28,6 +28,8 @@ #include "Core/Boot/Boot.h" #include "Core/ConfigManager.h" +#include "DiscIO/Blob.h" +#include "DiscIO/Enums.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeCreator.h" @@ -39,8 +41,8 @@ static const u32 CACHE_REVISION = 0x127; // Last changed in PR 3309 #define DVD_BANNER_WIDTH 96 #define DVD_BANNER_HEIGHT 32 -static std::string GetLanguageString(DiscIO::IVolume::ELanguage language, - std::map<DiscIO::IVolume::ELanguage, std::string> strings) +static std::string GetLanguageString(DiscIO::Language language, + std::map<DiscIO::Language, std::string> strings) { auto end = strings.end(); auto it = strings.find(language); @@ -48,9 +50,9 @@ static std::string GetLanguageString(DiscIO::IVolume::ELanguage language, return it->second; // English tends to be a good fallback when the requested language isn't available - if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) + if (language != DiscIO::Language::LANGUAGE_ENGLISH) { - it = strings.find(DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH); + it = strings.find(DiscIO::Language::LANGUAGE_ENGLISH); if (it != end) return it->second; } @@ -65,7 +67,7 @@ static std::string GetLanguageString(DiscIO::IVolume::ELanguage language, GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_map<std::string, std::string>& custom_titles) : m_FileName(_rFileName), m_title_id(0), m_emu_state(0), m_FileSize(0), - m_Country(DiscIO::IVolume::COUNTRY_UNKNOWN), m_Revision(0), m_Valid(false), m_ImageWidth(0), + m_Country(DiscIO::Country::COUNTRY_UNKNOWN), m_Revision(0), m_Valid(false), m_ImageWidth(0), m_ImageHeight(0), m_disc_number(0), m_has_custom_name(false) { if (LoadFromCache()) @@ -96,9 +98,9 @@ GameListItem::GameListItem(const std::string& _rFileName, m_names = volume->GetLongNames(); if (m_names.empty()) m_names = volume->GetShortNames(); - m_company = GetLanguageString(DiscIO::IVolume::LANGUAGE_ENGLISH, volume->GetLongMakers()); + m_company = GetLanguageString(DiscIO::Language::LANGUAGE_ENGLISH, volume->GetLongMakers()); if (m_company.empty()) - m_company = GetLanguageString(DiscIO::IVolume::LANGUAGE_ENGLISH, volume->GetShortMakers()); + m_company = GetLanguageString(DiscIO::Language::LANGUAGE_ENGLISH, volume->GetShortMakers()); m_Country = volume->GetCountry(); m_blob_type = volume->GetBlobType(); @@ -126,7 +128,7 @@ GameListItem::GameListItem(const std::string& _rFileName, std::string game_id = m_UniqueID; // Ignore publisher ID for WAD files - if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4) + if (m_Platform == DiscIO::Platform::WII_WAD && game_id.size() > 4) game_id.erase(4); auto it = custom_titles.find(game_id); @@ -142,7 +144,7 @@ GameListItem::GameListItem(const std::string& _rFileName, { m_Valid = true; m_FileSize = File::GetSize(_rFileName); - m_Platform = DiscIO::IVolume::ELF_DOL; + m_Platform = DiscIO::Platform::ELF_DOL; m_blob_type = DiscIO::BlobType::DIRECTORY; } @@ -296,18 +298,18 @@ wxBitmap GameListItem::ScaleBanner(wxImage* image) #endif } -std::string GameListItem::GetDescription(DiscIO::IVolume::ELanguage language) const +std::string GameListItem::GetDescription(DiscIO::Language language) const { return GetLanguageString(language, m_descriptions); } std::string GameListItem::GetDescription() const { - bool wii = m_Platform != DiscIO::IVolume::GAMECUBE_DISC; + bool wii = m_Platform != DiscIO::Platform::GAMECUBE_DISC; return GetDescription(SConfig::GetInstance().GetCurrentLanguage(wii)); } -std::string GameListItem::GetName(DiscIO::IVolume::ELanguage language) const +std::string GameListItem::GetName(DiscIO::Language language) const { return GetLanguageString(language, m_names); } @@ -317,7 +319,7 @@ std::string GameListItem::GetName() const if (m_has_custom_name) return m_custom_name; - bool wii = m_Platform != DiscIO::IVolume::GAMECUBE_DISC; + bool wii = m_Platform != DiscIO::Platform::GAMECUBE_DISC; std::string name = GetName(SConfig::GetInstance().GetCurrentLanguage(wii)); if (!name.empty()) return name; @@ -328,10 +330,10 @@ std::string GameListItem::GetName() const return name + ext; } -std::vector<DiscIO::IVolume::ELanguage> GameListItem::GetLanguages() const +std::vector<DiscIO::Language> GameListItem::GetLanguages() const { - std::vector<DiscIO::IVolume::ELanguage> languages; - for (std::pair<DiscIO::IVolume::ELanguage, std::string> name : m_names) + std::vector<DiscIO::Language> languages; + for (std::pair<DiscIO::Language, std::string> name : m_names) languages.push_back(name.first); return languages; } @@ -344,7 +346,7 @@ const std::string GameListItem::GetWiiFSPath() const if (iso == nullptr) return ret; - if (iso->GetVolumeType() != DiscIO::IVolume::GAMECUBE_DISC) + if (iso->GetVolumeType() != DiscIO::Platform::GAMECUBE_DISC) { u64 title_id = 0; iso->GetTitleID(&title_id); @@ -364,3 +366,9 @@ const std::string GameListItem::GetWiiFSPath() const return ret; } + +bool GameListItem::IsCompressed() const +{ + return m_blob_type == DiscIO::BlobType::GCZ || m_blob_type == DiscIO::BlobType::CISO || + m_blob_type == DiscIO::BlobType::WBFS; +} |
