From d494e0230c2ebfd580bb66b2a741d19ef830d658 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 21 Jun 2020 20:41:50 +0200 Subject: Show file format details in game properties --- Source/Core/UICommon/GameFile.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Source/Core/UICommon/GameFile.cpp') 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; -- cgit v1.2.3