Settings: Update to allow the use of cfg and rdb file for a game setting

This commit is contained in:
zilmar 2013-02-13 07:01:46 +11:00
parent 1ff9338e4c
commit 6936cd9800
3 changed files with 11 additions and 3 deletions

View File

@ -31,7 +31,8 @@
CSettings * g_Settings = NULL;
CSettings::CSettings()
CSettings::CSettings() :
m_NextAutoSettingId(0x200000)
{
}
@ -416,7 +417,10 @@ void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID Def
case Data_DWORD:
if (DefaultID == Default_None)
{
_this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),Value));
SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId;
_this->m_NextAutoSettingId += 1;
_this->AddHandler(RdbSetting,new CSettingTypeRomDatabase(Name.c_str(),(int)Value));
_this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),RdbSetting));
} else {
_this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),DefaultID));
}

View File

@ -118,6 +118,7 @@ private:
SETTING_MAP m_SettingInfo;
SETTING_CALLBACK m_Callback;
int m_NextAutoSettingId;
};
extern CSettings * g_Settings;

View File

@ -92,8 +92,11 @@ void RegisterSetting ( short SettingID, SETTING_DATA_TYPE Type, const char *
switch (Type)
{
case Data_DWORD_General:
case Data_DWORD_Game:
g_PluginSettings.RegisterSetting(g_PluginSettings.handle,SettingID + g_PluginSettings.SettingStartRange,
g_PluginSettings.NoDefault,Data_DWORD,Location,FullCategory,Name,DefaultDW);
break;
case Data_DWORD_General:
case Data_DWORD_RDB:
if (DefaultDW != 0)
{