2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2012-12-19 09:30:18 +00:00
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
2010-06-07 02:23:58 +00:00
|
|
|
#include "stdafx.h"
|
2015-12-04 06:49:31 +00:00
|
|
|
#include "N64SystemSettings.h"
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-14 21:49:08 +00:00
|
|
|
int32_t CN64SystemSettings::m_RefCount = 0;
|
2010-06-04 06:25:07 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
bool CN64SystemSettings::m_bShowCPUPer;
|
|
|
|
bool CN64SystemSettings::m_bProfiling;
|
|
|
|
bool CN64SystemSettings::m_bBasicMode;
|
|
|
|
bool CN64SystemSettings::m_bLimitFPS;
|
2008-11-14 20:51:06 +00:00
|
|
|
bool CN64SystemSettings::m_bShowDListAListCount;
|
|
|
|
bool CN64SystemSettings::m_bDisplayFrameRate;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
CN64SystemSettings::CN64SystemSettings()
|
|
|
|
{
|
2015-11-14 21:10:55 +00:00
|
|
|
m_RefCount += 1;
|
|
|
|
if (m_RefCount == 1)
|
|
|
|
{
|
|
|
|
g_Settings->RegisterChangeCB(UserInterface_BasicMode, NULL, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(UserInterface_ShowCPUPer, NULL, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(UserInterface_DisplayFrameRate, NULL, RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
g_Settings->RegisterChangeCB(Debugger_ProfileCode, NULL, RefreshSettings);
|
|
|
|
g_Settings->RegisterChangeCB(Debugger_ShowDListAListCount, NULL, RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
g_Settings->RegisterChangeCB(GameRunning_LimitFPS, NULL, RefreshSettings);
|
2008-11-14 20:51:06 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
RefreshSettings(NULL);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CN64SystemSettings::~CN64SystemSettings()
|
|
|
|
{
|
2015-11-14 21:10:55 +00:00
|
|
|
m_RefCount -= 1;
|
|
|
|
if (m_RefCount == 0)
|
|
|
|
{
|
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_BasicMode, NULL, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_DisplayFrameRate, NULL, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(UserInterface_ShowCPUPer, NULL, RefreshSettings);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
g_Settings->UnregisterChangeCB(Debugger_ProfileCode, NULL, RefreshSettings);
|
|
|
|
g_Settings->UnregisterChangeCB(Debugger_ShowDListAListCount, NULL, RefreshSettings);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
g_Settings->UnregisterChangeCB(GameRunning_LimitFPS, NULL, RefreshSettings);
|
|
|
|
}
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
void CN64SystemSettings::RefreshSettings(void *)
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2015-11-14 21:10:55 +00:00
|
|
|
m_bBasicMode = g_Settings->LoadBool(UserInterface_BasicMode);
|
|
|
|
m_bDisplayFrameRate = g_Settings->LoadBool(UserInterface_DisplayFrameRate);
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-11-14 21:10:55 +00:00
|
|
|
m_bShowCPUPer = g_Settings->LoadBool(UserInterface_ShowCPUPer);
|
|
|
|
m_bProfiling = g_Settings->LoadBool(Debugger_ProfileCode);
|
|
|
|
m_bShowDListAListCount = g_Settings->LoadBool(Debugger_ShowDListAListCount);
|
|
|
|
m_bLimitFPS = g_Settings->LoadBool(GameRunning_LimitFPS);
|
|
|
|
}
|