GameList: Add "File Size" field
This commit is contained in:
@ -33,6 +33,7 @@ public:
|
||||
|
||||
bool ReadSubChannelQ(SubChannelQ* subq, const Index& index, LBA lba_in_index) override;
|
||||
bool HasNonStandardSubchannel() const override;
|
||||
s64 GetSizeOnDisk() const override;
|
||||
|
||||
std::string GetMetadata(const std::string_view& type) const override;
|
||||
std::string GetSubImageMetadata(u32 index, const std::string_view& type) const override;
|
||||
@ -53,6 +54,7 @@ private:
|
||||
std::unique_ptr<CDImage> m_parent_image;
|
||||
std::vector<u8> m_replacement_data;
|
||||
std::unordered_map<u32, u32> m_replacement_map;
|
||||
s64 m_patch_size = 0;
|
||||
u32 m_replacement_offset = 0;
|
||||
};
|
||||
|
||||
@ -71,6 +73,8 @@ bool CDImagePPF::Open(const char* filename, std::unique_ptr<CDImage> parent_imag
|
||||
return false;
|
||||
}
|
||||
|
||||
m_patch_size = FileSystem::FSize64(fp.get());
|
||||
|
||||
u32 magic;
|
||||
if (std::fread(&magic, sizeof(magic), 1, fp.get()) != 1)
|
||||
{
|
||||
@ -445,6 +449,11 @@ bool CDImagePPF::ReadSectorFromIndex(void* buffer, const Index& index, LBA lba_i
|
||||
return true;
|
||||
}
|
||||
|
||||
s64 CDImagePPF::GetSizeOnDisk() const
|
||||
{
|
||||
return m_patch_size + m_parent_image->GetSizeOnDisk();
|
||||
}
|
||||
|
||||
std::unique_ptr<CDImage>
|
||||
CDImage::OverlayPPFPatch(const char* filename, std::unique_ptr<CDImage> parent_image,
|
||||
ProgressCallback* progress /* = ProgressCallback::NullProgressCallback */)
|
||||
|
||||
Reference in New Issue
Block a user