(Menu) Start adding wraparound parameter to action_toggle

This commit is contained in:
twinaphex 2015-03-09 04:10:57 +01:00
parent 342d4fb1f9
commit 2c607ed5d2
8 changed files with 26 additions and 24 deletions

View File

@ -199,7 +199,8 @@ typedef struct menu_file_list_cbs
int (*action_select)(unsigned type, const char *label, unsigned action);
int (*action_content_list_switch)(void *data, void *userdata, const char
*path, const char *label, unsigned type);
int (*action_toggle)(unsigned type, const char *label, unsigned action);
int (*action_toggle)(unsigned type, const char *label, unsigned action,
bool wraparound);
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
int (*action_up_or_down)(unsigned type, const char *label, unsigned action);
void (*action_get_representation)(file_list_t* list,

View File

@ -22,7 +22,7 @@
static int action_cancel_lookup_setting(const char *path,
const char *label, unsigned type, size_t idx)
{
return menu_setting_set(type, label, MENU_ACTION_CANCEL);
return menu_setting_set(type, label, MENU_ACTION_CANCEL, false);
}
static int action_cancel_pop_default(const char *path,

View File

@ -183,7 +183,7 @@ static int mouse_post_iterate(menu_file_list_cbs_t *cbs, const char *path,
&& cbs && cbs->action_toggle && setting &&
(setting->type == ST_BOOL || setting->type == ST_UINT || setting->type == ST_FLOAT
|| setting->type == ST_STRING))
return cbs->action_toggle(type, label, MENU_ACTION_RIGHT);
return cbs->action_toggle(type, label, MENU_ACTION_RIGHT, true);
if (menu->mouse.ptr == menu->navigation.selection_ptr
&& cbs && cbs->action_ok)
return cbs->action_ok(path, label, type,
@ -682,7 +682,7 @@ static int action_iterate_main(const char *label, unsigned action)
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
if (cbs && cbs->action_toggle)
ret = cbs->action_toggle(type_offset, label_offset, action);
ret = cbs->action_toggle(type_offset, label_offset, action, false);
break;
case MENU_ACTION_SELECT:
if (cbs && cbs->action_select)

View File

@ -975,7 +975,7 @@ static int action_ok_shader_apply_changes(const char *path,
static int action_ok_lookup_setting(const char *path,
const char *label, unsigned type, size_t idx)
{
return menu_setting_set(type, label, MENU_ACTION_OK);
return menu_setting_set(type, label, MENU_ACTION_OK, false);
}
static int action_ok_rdb_entry_submenu(const char *path,

View File

@ -280,7 +280,7 @@ static int action_start_core_setting(unsigned type,
static int action_start_lookup_setting(unsigned type, const char *label,
unsigned action)
{
int ret = menu_setting_set(type, label, MENU_ACTION_START);
int ret = menu_setting_set(type, label, MENU_ACTION_START, false);
g_runloop.frames.video.current.menu.action.active = true;
return ret;

View File

@ -24,7 +24,7 @@
#include "../retroarch.h"
static int shader_action_parameter_toggle(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
struct video_shader_parameter *param = NULL;
@ -58,7 +58,7 @@ static int shader_action_parameter_toggle(unsigned type, const char *label,
}
static int shader_action_parameter_preset_toggle(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
struct video_shader *shader = NULL;
@ -95,7 +95,7 @@ static int shader_action_parameter_preset_toggle(unsigned type, const char *labe
}
static int action_toggle_cheat(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
cheat_manager_t *cheat = g_extern.cheat;
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
@ -117,7 +117,7 @@ static int action_toggle_cheat(unsigned type, const char *label,
}
static int action_toggle_input_desc(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset / RARCH_FIRST_CUSTOM_BIND;
@ -145,7 +145,7 @@ static int action_toggle_input_desc(unsigned type, const char *label,
}
static int action_toggle_save_state(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
switch (action)
{
@ -167,7 +167,7 @@ static int action_toggle_save_state(unsigned type, const char *label,
}
static int action_toggle_scroll(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
unsigned scroll_speed = 0, fast_scroll_speed = 0;
menu_handle_t *menu = menu_driver_resolve();
@ -209,7 +209,7 @@ static int action_toggle_scroll(unsigned type, const char *label,
}
static int action_toggle_mainmenu(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
menu_file_list_cbs_t *cbs = NULL;
unsigned push_list = 0;
@ -261,7 +261,7 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
g_runloop.frames.video.current.menu.action.active = true;
break;
case 2:
action_toggle_scroll(0, "", action);
action_toggle_scroll(0, "", action, false);
g_runloop.frames.video.current.menu.action.active = true;
break;
case 0:
@ -273,7 +273,7 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
}
static int action_toggle_shader_scale_pass(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_SCALE_0;
@ -311,7 +311,7 @@ static int action_toggle_shader_scale_pass(unsigned type, const char *label,
}
static int action_toggle_shader_filter_pass(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
@ -345,7 +345,7 @@ static int action_toggle_shader_filter_pass(unsigned type, const char *label,
}
static int action_toggle_shader_filter_default(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
rarch_setting_t *setting = menu_setting_find("video_smooth");
@ -356,7 +356,7 @@ static int action_toggle_shader_filter_default(unsigned type, const char *label,
}
static int action_toggle_cheat_num_passes(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
unsigned new_size = 0;
cheat_manager_t *cheat = g_extern.cheat;
@ -390,7 +390,7 @@ static int action_toggle_cheat_num_passes(unsigned type, const char *label,
}
static int action_toggle_shader_num_passes(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER
struct video_shader *shader = NULL;
@ -427,7 +427,7 @@ static int action_toggle_shader_num_passes(unsigned type, const char *label,
}
static int action_toggle_video_resolution(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
#if defined(__CELLOS_LV2__)
switch (action)
@ -478,7 +478,7 @@ static int action_toggle_video_resolution(unsigned type, const char *label,
}
static int core_setting_toggle(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START;
@ -501,7 +501,7 @@ static int core_setting_toggle(unsigned type, const char *label,
}
static int disk_options_disk_idx_toggle(unsigned type, const char *label,
unsigned action)
unsigned action, bool wraparound)
{
switch (action)
{

View File

@ -118,7 +118,8 @@ rarch_setting_t *menu_setting_find(const char *label)
driver.menu->list_settings, label);
}
int menu_setting_set(unsigned type, const char *label, unsigned action)
int menu_setting_set(unsigned type, const char *label,
unsigned action, bool wraparound)
{
rarch_setting_t *setting = menu_setting_find(
driver.menu->menu_list->selection_buf->list

View File

@ -31,7 +31,7 @@ int menu_action_setting_set_current_string(
rarch_setting_t *setting, const char *str);
int menu_setting_set(unsigned type, const char *label,
unsigned action);
unsigned action, bool wraparound);
rarch_setting_t *menu_setting_find(const char *label);