Move core_setting_toggle to menu_entries_cbs.c as static function

This commit is contained in:
twinaphex 2014-10-12 19:21:19 +02:00
parent 896bff00cc
commit 528cb1dd60
3 changed files with 30 additions and 33 deletions

View File

@ -501,35 +501,6 @@ unsigned menu_common_type_is(const char *label, unsigned type)
return 0;
}
int menu_common_core_setting_toggle(unsigned type, const char *label,
unsigned action)
{
unsigned index = type - MENU_SETTINGS_CORE_OPTION_START;
(void)label;
switch (action)
{
case MENU_ACTION_LEFT:
core_option_prev(g_extern.system.core_options, index);
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
core_option_next(g_extern.system.core_options, index);
break;
case MENU_ACTION_START:
core_option_set_default(g_extern.system.core_options, index);
break;
default:
break;
}
return 0;
}
int menu_common_setting_set_perf(unsigned setting, unsigned action,
struct retro_perf_counter **counters, unsigned offset)
{

View File

@ -155,9 +155,6 @@ void menu_update_system_info(menu_handle_t *menu, bool *load_no_content);
unsigned menu_common_type_is(const char *label, unsigned type);
int menu_common_core_setting_toggle(unsigned type, const char *label,
unsigned action);
int menu_common_setting_set_perf(unsigned setting, unsigned action,
struct retro_perf_counter **counters, unsigned offset);

View File

@ -587,6 +587,35 @@ static int action_ok_help(const char *path,
return 0;
}
static int core_setting_toggle(unsigned type, const char *label,
unsigned action)
{
unsigned index = type - MENU_SETTINGS_CORE_OPTION_START;
(void)label;
switch (action)
{
case MENU_ACTION_LEFT:
core_option_prev(g_extern.system.core_options, index);
break;
case MENU_ACTION_RIGHT:
case MENU_ACTION_OK:
core_option_next(g_extern.system.core_options, index);
break;
case MENU_ACTION_START:
core_option_set_default(g_extern.system.core_options, index);
break;
default:
break;
}
return 0;
}
/* Bind the OK callback function */
static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
@ -735,7 +764,7 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
)
cbs->action_toggle = menu_shader_manager_setting_toggle;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_toggle = menu_common_core_setting_toggle;
cbs->action_toggle = core_setting_toggle;
}
void menu_entries_cbs_init(void *data,