2010-06-07 02:23:58 +00:00
|
|
|
#include "stdafx.h"
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
int CGuiSettings::m_RefCount = 0;
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CGuiSettings::m_bCPURunning;
|
|
|
|
bool CGuiSettings::m_bAutoSleep;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
CGuiSettings::CGuiSettings()
|
2010-06-04 06:25:07 +00:00
|
|
|
{
|
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
|
|
|
_Settings->RegisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
|
|
|
_Settings->RegisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
|
|
|
|
RefreshSettings(NULL);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CGuiSettings::~CGuiSettings()
|
|
|
|
{
|
2010-06-04 06:25:07 +00:00
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
|
|
|
_Settings->UnregisterChangeCB(GameRunning_CPU_Running,NULL,RefreshSettings);
|
|
|
|
_Settings->UnregisterChangeCB(Setting_AutoSleep,NULL,RefreshSettings);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
void CGuiSettings::RefreshSettings(void *)
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2008-11-14 20:51:06 +00:00
|
|
|
m_bCPURunning = _Settings->LoadBool(GameRunning_CPU_Running);
|
|
|
|
m_bAutoSleep = _Settings->LoadBool(Setting_AutoSleep);
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|