Implement RetroAchivements

This commit is contained in:
Connor McLaughlin
2021-02-27 00:44:53 +10:00
parent ef524d7dea
commit 0ec2c87a0e
34 changed files with 2419 additions and 65 deletions

View File

@ -1979,9 +1979,14 @@ u32 GetMediaPlaylistIndex()
return std::numeric_limits<u32>::max();
const std::string& media_path = g_cdrom.GetMediaFileName();
return GetMediaPlaylistIndexForPath(media_path);
}
u32 GetMediaPlaylistIndexForPath(const std::string& path)
{
for (u32 i = 0; i < static_cast<u32>(s_media_playlist.size()); i++)
{
if (s_media_playlist[i] == media_path)
if (s_media_playlist[i] == path)
return i;
}

View File

@ -211,6 +211,9 @@ u32 GetMediaPlaylistCount();
/// Returns the current image from the media/disc playlist.
u32 GetMediaPlaylistIndex();
/// Returns the index of the specified path in the playlist, or UINT32_MAX if it does not exist.
u32 GetMediaPlaylistIndexForPath(const std::string& path);
/// Returns the path to the specified playlist index.
const std::string& GetMediaPlaylistPath(u32 index);