[Projext64] Add check around duplicate name

This commit is contained in:
zilmar 2019-01-10 19:14:18 +10:30
parent 590119f414
commit e163ecd2f8
1 changed files with 24 additions and 7 deletions

View File

@ -161,7 +161,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", (uint32_t)0));
AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start", (uint32_t)0));
AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX RDB", Plugin_UseHleGfx));
AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio));
AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio RDB", Plugin_UseHleAudio));
AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory", false));
AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz", (uint32_t)0));
AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind", (uint32_t)FuncFind_PhysicalLookup));
@ -384,7 +384,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", ""));
AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX Plugin", Default_UseHleGfx));
AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false));
AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio Plugin", false));
AddHandler(Plugin_EnableAudio, new CSettingTypeApplication("Audio", "Enable Audio", true));
//Logging
@ -428,6 +428,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
uint32_t CSettings::FindSetting(CSettings * _this, const char * Name)
{
uint32_t setting_id = 0;
for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++)
{
CSettingType * Setting = iter->second;
@ -438,7 +439,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name)
{
continue;
}
return iter->first;
if (setting_id != 0)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
setting_id = iter->first;
}
else if (Setting->GetSettingType() == SettingType_CfgFile)
{
@ -447,7 +452,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name)
{
continue;
}
return iter->first;
if (setting_id != 0)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
setting_id = iter->first;
}
else if (Setting->GetSettingType() == SettingType_SelectedDirectory)
{
@ -456,7 +465,11 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name)
{
continue;
}
return iter->first;
if (setting_id != 0)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
setting_id = iter->first;
}
else if (Setting->GetSettingType() == SettingType_BoolVariable)
{
@ -465,10 +478,14 @@ uint32_t CSettings::FindSetting(CSettings * _this, const char * Name)
{
continue;
}
return iter->first;
if (setting_id != 0)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
setting_id = iter->first;
}
}
return 0;
return setting_id;
}
void CSettings::FlushSettings(CSettings * /*_this*/)