[Kernel] Add GpdFile::GetTitleId() member

This commit is contained in:
emoose 2018-11-18 00:07:19 +00:00
parent 69eca79402
commit 00cffcacbb
No known key found for this signature in database
GPG Key ID: 3735C67912F5FF97
2 changed files with 9 additions and 2 deletions

View File

@ -350,6 +350,8 @@ class SpaFile : public XdbfFile {
class GpdFile : public XdbfFile {
public:
GpdFile(uint32_t title_id) : title_id_(title_id) {}
bool GetAchievement(uint16_t id, XdbfAchievement* dest);
uint32_t GetAchievements(std::vector<XdbfAchievement>* achievements) const;
@ -361,6 +363,11 @@ class GpdFile : public XdbfFile {
// Updates (or adds) a title
bool UpdateTitle(XdbfTitlePlayed title);
uint32_t GetTitleId() { return title_id_; }
private:
uint32_t title_id_ = -1;
};
} // namespace util

View File

@ -131,7 +131,7 @@ void UserProfile::LoadGpdFiles() {
continue;
}
util::GpdFile title_gpd;
util::GpdFile title_gpd(title.title_id);
bool result = title_gpd.Read(mmap_->data(), mmap_->size());
mmap_->Close();
@ -221,7 +221,7 @@ util::GpdFile* UserProfile::SetTitleSpaData(const util::SpaFile& spa_data) {
title_info.last_played = Clock::QueryHostSystemTime();
// Copy cheevos from SPA -> GPD
util::GpdFile title_gpd;
util::GpdFile title_gpd(spa_title);
for (auto ach : spa_achievements) {
title_gpd.UpdateAchievement(ach);