(menu_entries_cbs_right.c) Buildfixes

This commit is contained in:
twinaphex 2015-06-07 17:57:42 +02:00
parent a311d6d423
commit eb6875737d

View File

@ -347,28 +347,27 @@ static int bind_right_generic(unsigned type, const char *label,
return menu_setting_set(type, label, MENU_ACTION_RIGHT, wraparound);
}
void menu_entries_cbs_init_bind_right(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)
static int menu_entries_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
unsigned type, uint32_t menu_label_hash)
{
int i;
if (!cbs)
return;
if (label)
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_right = shader_action_parameter_right;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_right = shader_action_parameter_preset_right;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_right = action_right_cheat;
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
&& type <= MENU_SETTINGS_INPUT_DESC_END)
cbs->action_right = action_right_input_desc;
else if (type == MENU_SETTINGS_VIDEO_RESOLUTION)
cbs->action_right = action_right_video_resolution;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_right = core_setting_right;
else
{
if (menu_entries_common_is_settings_entry(elem0))
{
cbs->action_right = action_right_scroll;
return;
}
}
cbs->action_right = bind_right_generic;
switch (type)
{
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
@ -408,27 +407,19 @@ void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
case MENU_FILE_CONTENTLIST_ENTRY:
cbs->action_right = action_right_mainmenu;
break;
default:
return -1;
}
}
return 0;
}
static int menu_entries_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t label_hash, uint32_t menu_label_hash)
{
if (strstr(label, "rdb_entry"))
cbs->action_right = action_right_scroll;
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_right = shader_action_parameter_right;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_right = shader_action_parameter_preset_right;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_right = action_right_cheat;
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
&& type <= MENU_SETTINGS_INPUT_DESC_END)
cbs->action_right = action_right_input_desc;
else if (type == MENU_SETTINGS_VIDEO_RESOLUTION)
cbs->action_right = action_right_video_resolution;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_right = core_setting_right;
else
{
switch (label_hash)
@ -452,9 +443,35 @@ void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
case MENU_LABEL_CHEAT_NUM_PASSES:
cbs->action_right = action_right_cheat_num_passes;
break;
default:
return -1;
}
}
return 0;
}
void menu_entries_cbs_init_bind_right(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_right = action_right_scroll;
return;
}
}
cbs->action_right = bind_right_generic;
for (i = 0; i < MAX_USERS; i++)
{
char label_setting[PATH_MAX_LENGTH];
@ -463,4 +480,9 @@ void menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
if (!strcmp(label, label_setting))
cbs->action_right = bind_right_generic;
}
if (menu_entries_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash) == 0)
return;
menu_entries_cbs_init_bind_right_compare_type(cbs, type, menu_label_hash);
}