DiscIO: Add a way to get blob type

This commit is contained in:
JosJuice
2015-09-27 14:01:12 +02:00
parent 34c020352f
commit be7e0554d2
19 changed files with 65 additions and 37 deletions

View File

@ -36,7 +36,7 @@
#include "DolphinWX/ISOFile.h"
#include "DolphinWX/WxUtils.h"
static const u32 CACHE_REVISION = 0x125; // Last changed in PR 2598
static const u32 CACHE_REVISION = 0x126; // Last changed in PR 3097
#define DVD_BANNER_WIDTH 96
#define DVD_BANNER_HEIGHT 32
@ -70,7 +70,6 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m
, m_Country(DiscIO::IVolume::COUNTRY_UNKNOWN)
, m_Revision(0)
, m_Valid(false)
, m_BlobCompressed(false)
, m_ImageWidth(0)
, m_ImageHeight(0)
, m_disc_number(0)
@ -107,11 +106,11 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m
m_company = pVolume->GetCompany();
m_Country = pVolume->GetCountry();
m_blob_type = pVolume->GetBlobType();
m_FileSize = pVolume->GetRawSize();
m_VolumeSize = pVolume->GetSize();
m_UniqueID = pVolume->GetUniqueID();
m_BlobCompressed = pVolume->IsCompressed();
m_disc_number = pVolume->GetDiscNumber();
m_Revision = pVolume->GetRevision();
@ -157,6 +156,7 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m
m_Valid = true;
m_FileSize = File::GetSize(_rFileName);
m_Platform = DiscIO::IVolume::ELF_DOL;
m_blob_type = DiscIO::BlobType::DIRECTORY;
}
std::string path, name;
@ -209,7 +209,7 @@ void GameListItem::DoState(PointerWrap &p)
p.Do(m_FileSize);
p.Do(m_VolumeSize);
p.Do(m_Country);
p.Do(m_BlobCompressed);
p.Do(m_blob_type);
p.Do(m_pImage);
p.Do(m_ImageWidth);
p.Do(m_ImageHeight);

View File

@ -10,6 +10,7 @@
#include <vector>
#include "Common/Common.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Volume.h"
#if defined(HAVE_WX) && HAVE_WX
@ -37,9 +38,14 @@ public:
const std::string GetWiiFSPath() const;
DiscIO::IVolume::ECountry GetCountry() const {return m_Country;}
DiscIO::IVolume::EPlatform GetPlatform() const { return m_Platform; }
DiscIO::BlobType GetBlobType() const { return m_blob_type; }
const std::string& GetIssues() const { return m_issues; }
int GetEmuState() const { return m_emu_state; }
bool IsCompressed() const {return m_BlobCompressed;}
bool IsCompressed() const
{
return m_blob_type == DiscIO::BlobType::GCZ || m_blob_type == DiscIO::BlobType::CISO ||
m_blob_type == DiscIO::BlobType::WBFS;
}
u64 GetFileSize() const {return m_FileSize;}
u64 GetVolumeSize() const {return m_VolumeSize;}
// 0 is the first disc, 1 is the second disc
@ -68,13 +74,13 @@ private:
DiscIO::IVolume::ECountry m_Country;
DiscIO::IVolume::EPlatform m_Platform;
DiscIO::BlobType m_blob_type;
u16 m_Revision;
#if defined(HAVE_WX) && HAVE_WX
wxBitmap m_Bitmap;
#endif
bool m_Valid;
bool m_BlobCompressed;
std::vector<u8> m_pImage;
int m_ImageWidth, m_ImageHeight;
u8 m_disc_number;