diff options
| author | JosJuice <josjuice@gmail.com> | 2017-06-04 08:57:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-04 08:57:36 +0200 |
| commit | 703858e21719066af603fde6fae1a8cb9f86cdcd (patch) | |
| tree | b2456fbe0c06f10e8058b8ff641ff508c7d489af /Source/Core/DiscIO/VolumeWiiCrypted.cpp | |
| parent | a2bd95a08e8944fad7dc233d51c8d7e7dad28e93 (diff) | |
| parent | 1a17c02d6f5db0413d53d84987fc666199982ed2 (diff) | |
Merge pull request #5522 from leoetlino/simpler-gettitleid
DiscIO: Use std::optional for GetTitleID instead of pointer
Diffstat (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWiiCrypted.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 411879e6c3..9281529254 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -181,13 +181,12 @@ Partition CVolumeWiiCrypted::GetGamePartition() const return m_game_partition; } -bool CVolumeWiiCrypted::GetTitleID(u64* buffer, const Partition& partition) const +std::optional<u64> CVolumeWiiCrypted::GetTitleID(const Partition& partition) const { const IOS::ES::TicketReader& ticket = GetTicket(partition); if (!ticket.IsValid()) - return false; - *buffer = ticket.GetTitleId(); - return true; + return {}; + return ticket.GetTitleId(); } const IOS::ES::TicketReader& CVolumeWiiCrypted::GetTicket(const Partition& partition) const @@ -289,11 +288,11 @@ std::vector<u32> CVolumeWiiCrypted::GetBanner(int* width, int* height) const *width = 0; *height = 0; - u64 title_id; - if (!GetTitleID(&title_id, GetGamePartition())) + const std::optional<u64> title_id = GetTitleID(GetGamePartition()); + if (!title_id) return std::vector<u32>(); - return GetWiiBanner(width, height, title_id); + return GetWiiBanner(width, height, *title_id); } u64 CVolumeWiiCrypted::GetFSTSize(const Partition& partition) const |
