Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed split WBFS file size display. (probably)
Fixed issue 6222.
  • Loading branch information
jordan-woyak committed Apr 9, 2013
1 parent 018282c commit 98d35e5
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Source/Core/DiscIO/Src/Volume.h
Expand Up @@ -65,6 +65,9 @@ class IVolume

virtual ECountry GetCountry() const = 0;
virtual u64 GetSize() const = 0;

// Size on disc (compressed size)
virtual u64 GetRawSize() const = 0;
};

// Generic Switch function for all volumes
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/DiscIO/Src/VolumeDirectory.cpp
Expand Up @@ -240,6 +240,10 @@ u64 CVolumeDirectory::GetSize() const
return 0;
}

u64 CVolumeDirectory::GetRawSize() const
{
return GetSize();
}

std::string CVolumeDirectory::ExtractDirectoryName(const std::string& _rDirectory)
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DiscIO/Src/VolumeDirectory.h
Expand Up @@ -60,6 +60,7 @@ class CVolumeDirectory : public IVolume
ECountry GetCountry() const;

u64 GetSize() const;
u64 GetRawSize() const;

void BuildFST();

Expand Down
8 changes: 8 additions & 0 deletions Source/Core/DiscIO/Src/VolumeGC.cpp
Expand Up @@ -138,6 +138,14 @@ u64 CVolumeGC::GetSize() const
return 0;
}

u64 CVolumeGC::GetRawSize() const
{
if (m_pReader)
return m_pReader->GetRawSize();
else
return 0;
}

bool CVolumeGC::IsDiscTwo() const
{
bool discTwo;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DiscIO/Src/VolumeGC.h
Expand Up @@ -39,6 +39,7 @@ class CVolumeGC : public IVolume
std::string GetApploaderDate() const;
ECountry GetCountry() const;
u64 GetSize() const;
u64 GetRawSize() const;
bool IsDiscTwo() const;

typedef std::string(*StringDecoder)(const std::string&);
Expand Down
10 changes: 9 additions & 1 deletion Source/Core/DiscIO/Src/VolumeWad.cpp
Expand Up @@ -149,7 +149,15 @@ std::vector<std::string> CVolumeWAD::GetNames() const
u64 CVolumeWAD::GetSize() const
{
if (m_pReader)
return (size_t)m_pReader->GetDataSize();
return m_pReader->GetDataSize();
else
return 0;
}

u64 CVolumeWAD::GetRawSize() const
{
if (m_pReader)
return m_pReader->GetRawSize();
else
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DiscIO/Src/VolumeWad.h
Expand Up @@ -43,6 +43,7 @@ class CVolumeWAD : public IVolume
std::string GetApploaderDate() const { return "0"; }
ECountry GetCountry() const;
u64 GetSize() const;
u64 GetRawSize() const;

private:
IBlobReader* m_pReader;
Expand Down
12 changes: 12 additions & 0 deletions Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp
Expand Up @@ -230,6 +230,18 @@ u64 CVolumeWiiCrypted::GetSize() const
}
}

u64 CVolumeWiiCrypted::GetRawSize() const
{
if (m_pReader)
{
return m_pReader->GetRawSize();
}
else
{
return 0;
}
}

bool CVolumeWiiCrypted::CheckIntegrity() const
{
// Get partition data size
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DiscIO/Src/VolumeWiiCrypted.h
Expand Up @@ -42,6 +42,7 @@ class CVolumeWiiCrypted : public IVolume
std::string GetApploaderDate() const;
ECountry GetCountry() const;
u64 GetSize() const;
u64 GetRawSize() const;

bool SupportsIntegrityCheck() const { return true; }
bool CheckIntegrity() const;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/ISOFile.cpp
Expand Up @@ -71,7 +71,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
m_volume_names = pVolume->GetNames();

m_Country = pVolume->GetCountry();
m_FileSize = File::GetSize(_rFileName);
m_FileSize = pVolume->GetRawSize();
m_VolumeSize = pVolume->GetSize();

m_UniqueID = pVolume->GetUniqueID();
Expand Down

0 comments on commit 98d35e5

Please sign in to comment.