Fix the display of uncompressed size of things that aren't ISO and CSO
This commit is contained in:
parent
d584162e06
commit
5a972be7ef
2 changed files with 11 additions and 5 deletions
|
@ -46,7 +46,7 @@ public:
|
|||
}
|
||||
int GetBlockSize() const { return 2048;} // forced, it cannot be changed by subclasses
|
||||
virtual u32 GetNumBlocks() const = 0;
|
||||
u64 GetUncompressedSize() const {
|
||||
virtual u64 GetUncompressedSize() const {
|
||||
return (u64)GetNumBlocks() * (u64)GetBlockSize();
|
||||
}
|
||||
virtual bool IsDisc() const = 0;
|
||||
|
@ -89,7 +89,9 @@ public:
|
|||
bool ReadBlocks(u32 minBlock, int count, u8 *outPtr) override;
|
||||
u32 GetNumBlocks() const override {return (u32)(filesize_ / GetBlockSize());}
|
||||
bool IsDisc() const override { return true; }
|
||||
|
||||
u64 GetUncompressedSize() const override {
|
||||
return filesize_;
|
||||
}
|
||||
private:
|
||||
u64 filesize_;
|
||||
};
|
||||
|
|
|
@ -131,9 +131,13 @@ u64 GameInfo::GetGameSizeUncompressedInBytes() {
|
|||
default:
|
||||
{
|
||||
BlockDevice *blockDevice = constructBlockDevice(GetFileLoader().get());
|
||||
if (blockDevice) {
|
||||
u64 size = blockDevice->GetUncompressedSize();
|
||||
delete blockDevice;
|
||||
return size;
|
||||
} else {
|
||||
return GetFileLoader()->FileSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue