(menu_entries_cbs_left.c) Cleanups
This commit is contained in:
parent
ea9792c66e
commit
1cf07a4636
|
@ -343,27 +343,63 @@ static int bind_left_generic(unsigned type, const char *label,
|
|||
return menu_setting_set(type, label, action, wraparound);
|
||||
}
|
||||
|
||||
void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
if (label)
|
||||
{
|
||||
if (menu_entries_common_is_settings_entry(elem0))
|
||||
static int menu_entries_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
|
||||
const char *label, uint32_t label_hash)
|
||||
{
|
||||
if (strstr(label, "rdb_entry"))
|
||||
cbs->action_left = action_left_scroll;
|
||||
return;
|
||||
else
|
||||
{
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_SAVESTATE:
|
||||
case MENU_LABEL_LOADSTATE:
|
||||
cbs->action_left = action_left_save_state;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_SCALE_PASS:
|
||||
cbs->action_left = action_left_shader_scale_pass;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_FILTER_PASS:
|
||||
cbs->action_left = action_left_shader_filter_pass;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_DEFAULT_FILTER:
|
||||
cbs->action_left = action_left_shader_filter_default;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_NUM_PASSES:
|
||||
cbs->action_left = action_left_shader_num_passes;
|
||||
break;
|
||||
case MENU_LABEL_CHEAT_NUM_PASSES:
|
||||
cbs->action_left = action_left_cheat_num_passes;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
cbs->action_left = bind_left_generic;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int menu_entries_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
|
||||
unsigned type, uint32_t menu_label_hash)
|
||||
{
|
||||
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
||||
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||
cbs->action_left = shader_action_parameter_left;
|
||||
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
||||
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
||||
cbs->action_left = shader_action_parameter_preset_left;
|
||||
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
||||
&& type <= MENU_SETTINGS_CHEAT_END)
|
||||
cbs->action_left = action_left_cheat;
|
||||
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
||||
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
||||
cbs->action_left = action_left_input_desc;
|
||||
else if (type == MENU_SETTINGS_VIDEO_RESOLUTION)
|
||||
cbs->action_left = action_left_video_resolution;
|
||||
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
|
||||
cbs->action_left = core_setting_left;
|
||||
else
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
|
||||
|
@ -404,52 +440,34 @@ void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
|||
case MENU_FILE_CONTENTLIST_ENTRY:
|
||||
cbs->action_left = action_left_mainmenu;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (strstr(label, "rdb_entry"))
|
||||
return 0;
|
||||
}
|
||||
|
||||
void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx,
|
||||
const char *elem0, const char *elem1, const char *menu_label,
|
||||
uint32_t label_hash, uint32_t menu_label_hash)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
if (label)
|
||||
{
|
||||
if (menu_entries_common_is_settings_entry(elem0))
|
||||
{
|
||||
cbs->action_left = action_left_scroll;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
||||
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||
cbs->action_left = shader_action_parameter_left;
|
||||
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
||||
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
||||
cbs->action_left = shader_action_parameter_preset_left;
|
||||
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
||||
&& type <= MENU_SETTINGS_CHEAT_END)
|
||||
cbs->action_left = action_left_cheat;
|
||||
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
||||
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
||||
cbs->action_left = action_left_input_desc;
|
||||
else if (type == MENU_SETTINGS_VIDEO_RESOLUTION)
|
||||
cbs->action_left = action_left_video_resolution;
|
||||
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
|
||||
cbs->action_left = core_setting_left;
|
||||
else
|
||||
{
|
||||
switch (label_hash)
|
||||
{
|
||||
case MENU_LABEL_SAVESTATE:
|
||||
case MENU_LABEL_LOADSTATE:
|
||||
cbs->action_left = action_left_save_state;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_SCALE_PASS:
|
||||
cbs->action_left = action_left_shader_scale_pass;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_FILTER_PASS:
|
||||
cbs->action_left = action_left_shader_filter_pass;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_DEFAULT_FILTER:
|
||||
cbs->action_left = action_left_shader_filter_default;
|
||||
break;
|
||||
case MENU_LABEL_VIDEO_SHADER_NUM_PASSES:
|
||||
cbs->action_left = action_left_shader_num_passes;
|
||||
break;
|
||||
case MENU_LABEL_CHEAT_NUM_PASSES:
|
||||
cbs->action_left = action_left_cheat_num_passes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
cbs->action_left = bind_left_generic;
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
|
@ -459,4 +477,10 @@ void menu_entries_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
|||
if (!strcmp(label, label_setting))
|
||||
cbs->action_left = bind_left_generic;
|
||||
}
|
||||
|
||||
|
||||
if (menu_entries_cbs_init_bind_left_compare_label(cbs, label, label_hash) == 0)
|
||||
return;
|
||||
|
||||
menu_entries_cbs_init_bind_left_compare_type(cbs, type, menu_label_hash);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue