Core option setting type checks (#14852)
This commit is contained in:
parent
f347c2d192
commit
f8e94861b2
|
@ -398,6 +398,19 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
|
||||||
if (cbs->setting && cbs->setting->type)
|
if (cbs->setting && cbs->setting->type)
|
||||||
entry->setting_type = cbs->setting->type;
|
entry->setting_type = cbs->setting->type;
|
||||||
|
|
||||||
|
/* Exceptions without cbs->setting->type */
|
||||||
|
if (!entry->setting_type)
|
||||||
|
{
|
||||||
|
switch (entry->type)
|
||||||
|
{
|
||||||
|
case MENU_SETTING_ACTION_CORE_LOCK:
|
||||||
|
entry->setting_type = ST_BOOL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cbs->checked)
|
if (cbs->checked)
|
||||||
entry->flags |= MENU_ENTRY_FLAG_CHECKED;
|
entry->flags |= MENU_ENTRY_FLAG_CHECKED;
|
||||||
|
|
||||||
|
@ -476,9 +489,11 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
|
||||||
core_option_manager_t *coreopts = NULL;
|
core_option_manager_t *coreopts = NULL;
|
||||||
size_t option_index = entry->type - MENU_SETTINGS_CORE_OPTION_START;
|
size_t option_index = entry->type - MENU_SETTINGS_CORE_OPTION_START;
|
||||||
retroarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts);
|
retroarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts);
|
||||||
|
|
||||||
|
if (coreopts)
|
||||||
option = (struct core_option*)&coreopts->opts[option_index];
|
option = (struct core_option*)&coreopts->opts[option_index];
|
||||||
|
|
||||||
if (option->vals->size == 2)
|
if (option && option->vals && option->vals->size == 2)
|
||||||
entry->setting_type = ST_BOOL;
|
entry->setting_type = ST_BOOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue