Config: Add missing equality comparisons for a few fields

Fixes memory card changes not getting applied.
This commit is contained in:
Connor McLaughlin 2021-10-05 11:58:34 +10:00 committed by refractionpcsx2
parent 00fbc8289d
commit 3c522a0e60
2 changed files with 34 additions and 13 deletions

View File

@ -490,6 +490,16 @@ struct Pcsx2Config
void LoadSave(SettingsWrapper& wrap);
void SanityCheck();
bool operator==(const FramerateOptions& right) const
{
return OpEqu(SkipOnLimit) && OpEqu(SkipOnTurbo) && OpEqu(NominalScalar) && OpEqu(TurboScalar) && OpEqu(SlomoScalar);
}
bool operator!=(const FramerateOptions& right) const
{
return !this->operator==(right);
}
};
// ------------------------------------------------------------------------
@ -586,19 +596,7 @@ struct Pcsx2Config
bool MultitapEnabled( uint port ) const;
bool operator ==( const Pcsx2Config& right ) const
{
return
OpEqu( bitset ) &&
OpEqu( Cpu ) &&
OpEqu( GS ) &&
OpEqu( Speedhacks ) &&
OpEqu( Gamefixes ) &&
OpEqu( Profiler ) &&
OpEqu( Trace ) &&
OpEqu( BaseFilenames );
}
bool operator ==(const Pcsx2Config& right) const;
bool operator !=( const Pcsx2Config& right ) const
{
return !this->operator ==( right );

View File

@ -610,6 +610,29 @@ wxString Pcsx2Config::FullpathToMcd(uint slot) const
return Path::Combine(EmuFolders::MemoryCards, StringUtil::UTF8StringToWxString(Mcd[slot].Filename));
}
bool Pcsx2Config::operator==(const Pcsx2Config& right) const
{
bool equal =
OpEqu(bitset) &&
OpEqu(Cpu) &&
OpEqu(GS) &&
OpEqu(Speedhacks) &&
OpEqu(Gamefixes) &&
OpEqu(Profiler) &&
OpEqu(Debugger) &&
OpEqu(Framerate) &&
OpEqu(Trace) &&
OpEqu(BaseFilenames) &&
OpEqu(GzipIsoIndexTemplate);
for (u32 i = 0; i < sizeof(Mcd) / sizeof(Mcd[0]); i++)
{
equal &= OpEqu(Mcd[i].Enabled);
equal &= OpEqu(Mcd[i].Filename);
}
return equal;
}
void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg)
{
Cpu = cfg.Cpu;