Change menu_common_core_setting_toggle to be bindable to cbs->action_toggle

This commit is contained in:
twinaphex 2014-10-12 19:18:37 +02:00
parent e71486a9bf
commit 896bff00cc
4 changed files with 10 additions and 6 deletions

View File

@ -254,9 +254,7 @@ static int menu_setting_toggle_pressed(unsigned type,
if (cbs && cbs->action_toggle)
return cbs->action_toggle(type, label, action);
if ((type >= MENU_SETTINGS_CORE_OPTION_START))
return menu_common_core_setting_toggle(type, action);
else if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN &&
if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN &&
type <= MENU_SETTINGS_PERF_COUNTERS_END)
{
counters = (struct retro_perf_counter**)perf_counters_rarch;

View File

@ -501,9 +501,12 @@ unsigned menu_common_type_is(const char *label, unsigned type)
return 0;
}
int menu_common_core_setting_toggle(unsigned setting, unsigned action)
int menu_common_core_setting_toggle(unsigned type, const char *label,
unsigned action)
{
unsigned index = setting - MENU_SETTINGS_CORE_OPTION_START;
unsigned index = type - MENU_SETTINGS_CORE_OPTION_START;
(void)label;
switch (action)
{

View File

@ -155,7 +155,8 @@ 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 setting, unsigned action);
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

@ -734,6 +734,8 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
!strcmp(label, "video_shader_preset_parameters")
)
cbs->action_toggle = menu_shader_manager_setting_toggle;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_toggle = menu_common_core_setting_toggle;
}
void menu_entries_cbs_init(void *data,