mirror of https://github.com/PCSX2/pcsx2.git
SettingsWrapper: Fix enums being stored as ints
This commit is contained in:
parent
92689a60ae
commit
65d22406a3
|
@ -166,15 +166,6 @@ int SettingsSaveWrapper::EntryBitfield(const char* section, const char* var, int
|
||||||
void SettingsSaveWrapper::_EnumEntry(const char* section, const char* var, int& value, const char* const* enumArray, int defvalue)
|
void SettingsSaveWrapper::_EnumEntry(const char* section, const char* var, int& value, const char* const* enumArray, int defvalue)
|
||||||
{
|
{
|
||||||
const int cnt = _calcEnumLength(enumArray);
|
const int cnt = _calcEnumLength(enumArray);
|
||||||
if (value >= cnt)
|
const int index = (value < 0 || value >= cnt) ? defvalue : value;
|
||||||
{
|
m_si.SetStringValue(section, var, enumArray[index]);
|
||||||
Console.Warning("(SaveSettings) An illegal enumerated index was detected when saving '%s'", var);
|
|
||||||
Console.Indent().Warning(
|
|
||||||
"Illegal Value: %d\n"
|
|
||||||
"Using Default: %d (%s)\n",
|
|
||||||
value, defvalue, enumArray[defvalue]);
|
|
||||||
value = defvalue;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_si.SetIntValue(section, var, value);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue