Show file format details in game properties

This commit is contained in:
JosJuice
2020-06-21 20:41:50 +02:00
parent 9982251899
commit d494e0230c
26 changed files with 342 additions and 17 deletions

View File

@ -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;