From 1db1a8aacf7c5d0d8a7e36f2c6f2e452b0971ed0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 31 Aug 2015 19:27:18 -0400 Subject: VolumeCreator: Use a unique_ptr in CreateVolumeFromFilename --- Source/Core/DiscIO/VolumeWad.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index a86c944844..f37e165b56 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -4,7 +4,9 @@ #include #include +#include #include +#include #include #include "Common/CommonTypes.h" @@ -18,8 +20,8 @@ namespace DiscIO { -CVolumeWAD::CVolumeWAD(IBlobReader* _pReader) - : m_pReader(_pReader), m_offset(0), m_tmd_offset(0), m_opening_bnr_offset(0), +CVolumeWAD::CVolumeWAD(std::unique_ptr reader) + : m_pReader(std::move(reader)), m_offset(0), m_tmd_offset(0), m_opening_bnr_offset(0), m_hdr_size(0), m_cert_size(0), m_tick_size(0), m_tmd_size(0), m_data_size(0) { // Source: http://wiibrew.org/wiki/WAD_files -- cgit v1.2.3 From 4b9b82e00016cbb8aa3c8a45bd32aea460f28c07 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Sep 2015 13:25:54 -0400 Subject: DiscIO: Do swapping in GetTitleID implementations Gets rid of external swaps at every usage. --- Source/Core/DiscIO/VolumeWad.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index f37e165b56..a268b3add9 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -93,11 +93,12 @@ std::string CVolumeWAD::GetMakerID() const return DecodeString(temp); } -bool CVolumeWAD::GetTitleID(u8* _pBuffer) const +bool CVolumeWAD::GetTitleID(u64* buffer) const { - if (!Read(m_offset + 0x01DC, 8, _pBuffer)) + if (!Read(m_offset + 0x01DC, sizeof(u64), reinterpret_cast(buffer))) return false; + *buffer = Common::swap64(*buffer); return true; } -- cgit v1.2.3 From 6935d281128ea78169ecde44e869f83a7b67ddb8 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 26 Sep 2015 15:24:29 +0200 Subject: Display all compressed formats in blue in GUI In the past, only GCZ was shown as compressed, not CISO and WBFS. --- Source/Core/DiscIO/VolumeWad.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index a268b3add9..0cbbe998bb 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -124,6 +124,11 @@ std::map CVolumeWAD::GetNames(bool prefer_long) return ReadWiiNames(name_data); } +bool CVolumeWAD::IsCompressed() const +{ + return m_pReader ? m_pReader->IsCompressed() : false; +} + u64 CVolumeWAD::GetSize() const { if (m_pReader) -- cgit v1.2.3 From cc036ca86cdaf709e01221975da734cb64d54a94 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Sep 2015 17:13:07 -0400 Subject: Common: Remove other Common prefixed headers from Common.h --- Source/Core/DiscIO/VolumeWad.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index a268b3add9..6df6ceb423 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -11,7 +11,9 @@ #include "Common/CommonTypes.h" #include "Common/MathUtil.h" +#include "Common/MsgHandler.h" #include "Common/StringUtil.h" +#include "Common/Logging/Log.h" #include "DiscIO/Blob.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeWad.h" -- cgit v1.2.3