Remove Blob nullptr checks from Volume code

There's no point in creating a volume without a blob,
since essentially all the functionality of a volume
requires a blob to be used.

Also, VolumeCreator doesn't support creating volumes
without blobs (it can't even figure out the volume type
unless it gets a blob), so it's currently impossible
for a volume to be created without a blob.
This commit is contained in:
JosJuice
2016-10-30 23:39:12 +01:00
parent f63d40270d
commit acec02ffc6
3 changed files with 17 additions and 18 deletions

View File

@ -9,6 +9,7 @@
#include <utility>
#include <vector>
#include "Common/Assert.h"
#include "Common/ColorUtil.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
@ -25,6 +26,7 @@ namespace DiscIO
{
CVolumeGC::CVolumeGC(std::unique_ptr<IBlobReader> reader) : m_pReader(std::move(reader))
{
_assert_(m_pReader);
}
CVolumeGC::~CVolumeGC()
@ -36,9 +38,6 @@ bool CVolumeGC::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const
if (decrypt)
PanicAlertT("Tried to decrypt data from a non-Wii volume");
if (m_pReader == nullptr)
return false;
FileMon::FindFilename(_Offset);
return m_pReader->Read(_Offset, _Length, _pBuffer);
@ -162,17 +161,17 @@ std::string CVolumeGC::GetApploaderDate() const
BlobType CVolumeGC::GetBlobType() const
{
return m_pReader ? m_pReader->GetBlobType() : BlobType::PLAIN;
return m_pReader->GetBlobType();
}
u64 CVolumeGC::GetSize() const
{
return m_pReader ? m_pReader->GetDataSize() : 0;
return m_pReader->GetDataSize();
}
u64 CVolumeGC::GetRawSize() const
{
return m_pReader ? m_pReader->GetRawSize() : 0;
return m_pReader->GetRawSize();
}
u8 CVolumeGC::GetDiscNumber() const