From 00cffcacbb92f86af46ff7b48e53e057ccb0a537 Mon Sep 17 00:00:00 2001 From: emoose Date: Sun, 18 Nov 2018 00:07:19 +0000 Subject: [PATCH] [Kernel] Add GpdFile::GetTitleId() member --- src/xenia/kernel/util/xdbf_utils.h | 7 +++++++ src/xenia/kernel/xam/user_profile.cc | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/util/xdbf_utils.h b/src/xenia/kernel/util/xdbf_utils.h index e607cc146..42a396938 100644 --- a/src/xenia/kernel/util/xdbf_utils.h +++ b/src/xenia/kernel/util/xdbf_utils.h @@ -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* 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 diff --git a/src/xenia/kernel/xam/user_profile.cc b/src/xenia/kernel/xam/user_profile.cc index 4c90e3b73..6a51792ff 100644 --- a/src/xenia/kernel/xam/user_profile.cc +++ b/src/xenia/kernel/xam/user_profile.cc @@ -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);