diff --git a/Source/Core/DiscIO/WiiWad.cpp b/Source/Core/DiscIO/WiiWad.cpp index 5e0894926d..0c93d601a9 100644 --- a/Source/Core/DiscIO/WiiWad.cpp +++ b/Source/Core/DiscIO/WiiWad.cpp @@ -16,6 +16,34 @@ namespace DiscIO { +namespace +{ +std::vector CreateWADEntry(IBlobReader& reader, u32 size, u64 offset) +{ + if (size == 0) + return {}; + + std::vector buffer(size); + + if (!reader.Read(offset, size, buffer.data())) + { + ERROR_LOG(DISCIO, "WiiWAD: Could not read from file"); + PanicAlertT("WiiWAD: Could not read from file"); + } + + return buffer; +} + +bool IsWiiWAD(const CBlobBigEndianReader& reader) +{ + u32 header_size = 0; + u32 header_type = 0; + reader.ReadSwapped(0x0, &header_size); + reader.ReadSwapped(0x4, &header_type); + return header_size == 0x20 && (header_type == 0x49730000 || header_type == 0x69620000); +} +} // Anonymous namespace + WiiWAD::WiiWAD(const std::string& name) { std::unique_ptr reader(CreateBlobReader(name)); @@ -32,22 +60,6 @@ WiiWAD::~WiiWAD() { } -std::vector WiiWAD::CreateWADEntry(IBlobReader& reader, u32 size, u64 offset) -{ - if (size == 0) - return {}; - - std::vector buffer(size); - - if (!reader.Read(offset, size, buffer.data())) - { - ERROR_LOG(DISCIO, "WiiWAD: Could not read from file"); - PanicAlertT("WiiWAD: Could not read from file"); - } - - return buffer; -} - bool WiiWAD::ParseWAD(IBlobReader& reader) { CBlobBigEndianReader big_endian_reader(reader); @@ -88,13 +100,4 @@ bool WiiWAD::ParseWAD(IBlobReader& reader) return true; } -bool WiiWAD::IsWiiWAD(const CBlobBigEndianReader& reader) -{ - u32 header_size = 0; - u32 header_type = 0; - reader.ReadSwapped(0x0, &header_size); - reader.ReadSwapped(0x4, &header_type); - return header_size == 0x20 && (header_type == 0x49730000 || header_type == 0x69620000); -} - -} // namespace end +} // namespace DiscIO diff --git a/Source/Core/DiscIO/WiiWad.h b/Source/Core/DiscIO/WiiWad.h index 454454a71f..21f8b746bd 100644 --- a/Source/Core/DiscIO/WiiWad.h +++ b/Source/Core/DiscIO/WiiWad.h @@ -17,7 +17,7 @@ class CBlobBigEndianReader; class WiiWAD { public: - WiiWAD(const std::string& name); + explicit WiiWAD(const std::string& name); ~WiiWAD(); bool IsValid() const { return m_valid; } @@ -28,8 +28,6 @@ public: const std::vector& GetFooter() const { return m_footer; } private: bool ParseWAD(IBlobReader& reader); - static std::vector CreateWADEntry(IBlobReader& reader, u32 size, u64 offset); - static bool IsWiiWAD(const CBlobBigEndianReader& reader); bool m_valid;