Remove EmuState

This commit is contained in:
Shawn Hoffman
2017-06-15 19:29:26 -07:00
committed by JosJuice
parent 180eb35876
commit 6a0c15491b
98 changed files with 6 additions and 310 deletions

View File

@ -142,25 +142,6 @@ void GameFile::CustomNameCommit()
m_custom_name = std::move(m_pending.custom_name);
}
bool GameFile::EmuStateChanged()
{
IniFile ini = SConfig::LoadGameIni(m_game_id, m_revision);
ini.GetIfExists("EmuState", "EmulationStateId", &m_pending.emu_state.rating, 0);
ini.GetIfExists("EmuState", "EmulationIssues", &m_pending.emu_state.issues, std::string());
return m_emu_state != m_pending.emu_state;
}
void GameFile::EmuStateCommit()
{
m_emu_state = std::move(m_pending.emu_state);
}
void GameFile::EmuState::DoState(PointerWrap& p)
{
p.Do(rating);
p.Do(issues);
}
void GameBanner::DoState(PointerWrap& p)
{
p.Do(buffer);
@ -196,7 +177,6 @@ void GameFile::DoState(PointerWrap& p)
p.Do(m_apploader_date);
m_volume_banner.DoState(p);
m_emu_state.DoState(p);
p.Do(m_custom_name);
}

View File

@ -75,31 +75,16 @@ public:
DiscIO::Platform GetPlatform() const { return m_platform; }
DiscIO::BlobType GetBlobType() const { return m_blob_type; }
const std::string& GetApploaderDate() const { return m_apploader_date; }
const std::string& GetIssues() const { return m_emu_state.issues; }
int GetEmuState() const { return m_emu_state.rating; }
u64 GetFileSize() const { return m_file_size; }
u64 GetVolumeSize() const { return m_volume_size; }
const GameBanner& GetBannerImage() const { return m_volume_banner; }
void DoState(PointerWrap& p);
bool BannerChanged();
void BannerCommit();
bool EmuStateChanged();
void EmuStateCommit();
bool CustomNameChanged(const Core::TitleDatabase& title_database);
void CustomNameCommit();
private:
struct EmuState
{
int rating{};
std::string issues{};
bool operator!=(const EmuState& rhs) const
{
return rating != rhs.rating || issues != rhs.issues;
}
void DoState(PointerWrap& p);
};
static const std::string& Lookup(DiscIO::Language language,
const std::map<DiscIO::Language, std::string>& strings);
const std::string&
@ -136,7 +121,6 @@ private:
std::string m_apploader_date{};
GameBanner m_volume_banner{};
EmuState m_emu_state{};
// Overridden name from TitleDatabase
std::string m_custom_name{};
@ -144,7 +128,6 @@ private:
// of GameFiles in a threadsafe way. They should not be handled in DoState.
struct
{
EmuState emu_state;
GameBanner volume_banner;
std::string custom_name;
} m_pending{};

View File

@ -28,7 +28,7 @@
namespace UICommon
{
static constexpr u32 CACHE_REVISION = 8; // Last changed in PR 6560
static constexpr u32 CACHE_REVISION = 9; // Last changed in PR 6569
std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan,
bool recursive_scan)
@ -138,18 +138,15 @@ bool GameFileCache::UpdateAdditionalMetadata(const Core::TitleDatabase& title_da
bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_file,
const Core::TitleDatabase& title_database)
{
const bool emu_state_changed = (*game_file)->EmuStateChanged();
const bool banner_changed = (*game_file)->BannerChanged();
const bool custom_title_changed = (*game_file)->CustomNameChanged(title_database);
if (!emu_state_changed && !banner_changed && !custom_title_changed)
if (!banner_changed && !custom_title_changed)
return false;
// If a cached file needs an update, apply the updates to a copy and delete the original.
// This makes the usage of cached files in other threads safe.
std::shared_ptr<GameFile> copy = std::make_shared<GameFile>(**game_file);
if (emu_state_changed)
copy->EmuStateCommit();
if (banner_changed)
copy->BannerCommit();
if (custom_title_changed)