summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFile.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2020-06-25 11:00:49 +0100
committerGitHub <noreply@github.com>2020-06-25 11:00:49 +0100
commit26ed3b318c604281d9397cdb923cd43380cbbe76 (patch)
treeca45960fe36a98fdb6454c3f67968ee10218a84b /Source/Core/UICommon/GameFile.cpp
parenta1a107dc08e8b36f908ac901273f082bb3e00612 (diff)
parentd494e0230c2ebfd580bb66b2a741d19ef830d658 (diff)
Merge pull request #8891 from JosJuice/file-details
Show file format details in game properties
Diffstat (limited to 'Source/Core/UICommon/GameFile.cpp')
-rw-r--r--Source/Core/UICommon/GameFile.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp
index ca5c53ae31..31a3fa4d26 100644
--- a/Source/Core/UICommon/GameFile.cpp
+++ b/Source/Core/UICommon/GameFile.cpp
@@ -115,6 +115,8 @@ GameFile::GameFile(std::string path) : m_file_path(std::move(path))
m_region = volume->GetRegion();
m_country = volume->GetCountry();
m_blob_type = volume->GetBlobType();
+ m_block_size = volume->GetBlobReader().GetBlockSize();
+ m_compression_method = volume->GetBlobReader().GetCompressionMethod();
m_file_size = volume->GetRawSize();
m_volume_size = volume->GetSize();
m_volume_size_is_accurate = volume->IsSizeAccurate();
@@ -320,6 +322,8 @@ void GameFile::DoState(PointerWrap& p)
p.Do(m_country);
p.Do(m_platform);
p.Do(m_blob_type);
+ p.Do(m_block_size);
+ p.Do(m_compression_method);
p.Do(m_revision);
p.Do(m_disc_number);
p.Do(m_apploader_date);
@@ -566,6 +570,29 @@ std::string GameFile::GetWiiFSPath() const
return Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT);
}
+bool GameFile::ShouldShowFileFormatDetails() const
+{
+ switch (m_blob_type)
+ {
+ case DiscIO::BlobType::PLAIN:
+ break;
+ case DiscIO::BlobType::DRIVE:
+ return false;
+ default:
+ return true;
+ }
+
+ switch (m_platform)
+ {
+ case DiscIO::Platform::WiiWAD:
+ return false;
+ case DiscIO::Platform::ELFOrDOL:
+ return false;
+ default:
+ return true;
+ }
+}
+
const GameBanner& GameFile::GetBannerImage() const
{
return m_custom_banner.empty() ? m_volume_banner : m_custom_banner;