(menu_entries_cbs_ok.c) Simplify

This commit is contained in:
twinaphex 2015-06-07 17:16:21 +02:00
parent 18d2f1fd63
commit 4fbab060ff
1 changed files with 140 additions and 137 deletions

View File

@ -1574,6 +1574,20 @@ static int menu_entries_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs
static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
uint32_t label_hash, uint32_t menu_label_hash, unsigned type)
{
if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
type == MENU_SETTINGS_CUSTOM_BIND)
cbs->action_ok = action_ok_lookup_setting;
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_ok = NULL;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_ok = NULL;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_ok = action_ok_cheat;
else
{
switch (type)
{
@ -1708,6 +1722,7 @@ static int menu_entries_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
default:
return -1;
}
}
return 0;
}
@ -1744,19 +1759,7 @@ void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
}
if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
type == MENU_SETTINGS_CUSTOM_BIND)
cbs->action_ok = action_ok_lookup_setting;
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_ok = NULL;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_ok = NULL;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_ok = action_ok_cheat;
else if (menu_entries_cbs_init_bind_ok_compare_label(cbs, label_hash) == 0)
if (menu_entries_cbs_init_bind_ok_compare_label(cbs, label_hash) == 0)
return;
menu_entries_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type);