diff --git a/Source/Project64/Settings/Recompiler Settings.cpp b/Source/Project64/Settings/Recompiler Settings.cpp index 095d9d8d6..ab7775b4c 100644 --- a/Source/Project64/Settings/Recompiler Settings.cpp +++ b/Source/Project64/Settings/Recompiler Settings.cpp @@ -10,35 +10,35 @@ ****************************************************************************/ #include "stdafx.h" -int CRecompilerSettings::m_RefCount = 0; +int CRecompilerSettings::m_RefCount = 0; bool CRecompilerSettings::m_bShowRecompMemSize; -bool CRecompilerSettings::m_bProfiling; +bool CRecompilerSettings::m_bProfiling; CRecompilerSettings::CRecompilerSettings() { - m_RefCount += 1; - if (m_RefCount == 1) - { - g_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); - g_Settings->RegisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); - - RefreshSettings(); - } + m_RefCount += 1; + if (m_RefCount == 1) + { + g_Settings->RegisterChangeCB(Debugger_ShowRecompMemSize, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + g_Settings->RegisterChangeCB(Debugger_ProfileCode, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + + RefreshSettings(); + } } CRecompilerSettings::~CRecompilerSettings() { - m_RefCount -= 1; - if (m_RefCount == 0) - { - g_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); - g_Settings->UnregisterChangeCB(Debugger_ProfileCode,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); - } + m_RefCount -= 1; + if (m_RefCount == 0) + { + g_Settings->UnregisterChangeCB(Debugger_ShowRecompMemSize, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + g_Settings->UnregisterChangeCB(Debugger_ProfileCode, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + } } void CRecompilerSettings::RefreshSettings() { - m_bShowRecompMemSize = g_Settings->LoadBool(Debugger_ShowRecompMemSize); - m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode); -} + m_bShowRecompMemSize = g_Settings->LoadBool(Debugger_ShowRecompMemSize); + m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode); +} \ No newline at end of file diff --git a/Source/Project64/Settings/Recompiler Settings.h b/Source/Project64/Settings/Recompiler Settings.h index b90d921f3..5df3598e0 100644 --- a/Source/Project64/Settings/Recompiler Settings.h +++ b/Source/Project64/Settings/Recompiler Settings.h @@ -12,28 +12,27 @@ #include -class CRecompilerSettings +class CRecompilerSettings { public: - CRecompilerSettings(); - virtual ~CRecompilerSettings(); + CRecompilerSettings(); + virtual ~CRecompilerSettings(); - static bool bShowRecompMemSize ( void ) { return m_bShowRecompMemSize; } + static bool bShowRecompMemSize(void) { return m_bShowRecompMemSize; } - static bool bProfiling ( void ) { return m_bProfiling; } + static bool bProfiling(void) { return m_bProfiling; } private: - static void StaticRefreshSettings (CRecompilerSettings * _this) - { - _this->RefreshSettings(); - } + static void StaticRefreshSettings(CRecompilerSettings * _this) + { + _this->RefreshSettings(); + } - void RefreshSettings ( void ); + void RefreshSettings(void); + //Settings that can be changed on the fly + static bool m_bShowRecompMemSize; + static bool m_bProfiling; - //Settings that can be changed on the fly - static bool m_bShowRecompMemSize; - static bool m_bProfiling; - - static int m_RefCount; + static int m_RefCount; };