mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 06:39:33 +00:00
DiscIO: Use std::optional for GetTitleID instead of pointer
This makes the interface slightly cleaner and a bit more consistent with the other getters. Still not fully the same, since the others don't really handle failures with std::optional; but at least the value is returned by value now, as opposed to having the function take a pointer to a u64.
This commit is contained in:
parent
5d6074f157
commit
1a17c02d6f
9 changed files with 31 additions and 26 deletions
|
@ -721,9 +721,10 @@ void SConfig::ResetRunningGameMetadata()
|
|||
void SConfig::SetRunningGameMetadata(const DiscIO::IVolume& volume,
|
||||
const DiscIO::Partition& partition)
|
||||
{
|
||||
u64 title_id = 0;
|
||||
volume.GetTitleID(&title_id, partition);
|
||||
SetRunningGameMetadata(volume.GetGameID(partition), title_id, volume.GetRevision(partition),
|
||||
const std::optional<u64> title_id = volume.GetTitleID(partition);
|
||||
if (!title_id)
|
||||
return;
|
||||
SetRunningGameMetadata(volume.GetGameID(partition), *title_id, volume.GetRevision(partition),
|
||||
Core::TitleDatabase::TitleType::Other);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue