2015-05-18 13:56:32 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2015 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <file/file_path.h>
|
2015-06-05 10:28:11 +00:00
|
|
|
|
2015-06-08 12:35:58 +00:00
|
|
|
#include "../menu.h"
|
|
|
|
#include "../menu_setting.h"
|
|
|
|
#include "../menu_shader.h"
|
|
|
|
#include "../menu_navigation.h"
|
2015-05-18 13:56:32 +00:00
|
|
|
|
2015-06-08 12:35:58 +00:00
|
|
|
#include "../../retroarch.h"
|
2015-05-18 13:56:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
static void shader_action_parameter_right_common(
|
|
|
|
struct video_shader_parameter *param,
|
|
|
|
struct video_shader *shader)
|
|
|
|
{
|
|
|
|
if (!shader)
|
|
|
|
return;
|
|
|
|
|
|
|
|
param->current += param->step;
|
|
|
|
param->current = min(max(param->minimum, param->current), param->maximum);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int shader_action_parameter_right(unsigned type, const char *label, bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
struct video_shader *shader = video_shader_driver_get_current_shader();
|
2015-05-21 02:11:20 +00:00
|
|
|
struct video_shader_parameter *param =
|
2015-05-18 13:56:32 +00:00
|
|
|
&shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
|
|
|
|
|
|
|
|
shader_action_parameter_right_common(param, shader);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int shader_action_parameter_preset_right(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
struct video_shader_parameter *param = NULL;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
struct video_shader *shader = menu ? menu->shader : NULL;
|
|
|
|
if (!menu || !shader)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
param = &shader->parameters[type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0];
|
|
|
|
|
|
|
|
shader_action_parameter_right_common(param, shader);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-06 18:40:17 +00:00
|
|
|
int action_right_cheat(unsigned type, const char *label,
|
2015-05-18 13:56:32 +00:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
cheat_manager_t *cheat = global->cheat;
|
|
|
|
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
|
|
|
|
|
|
|
if (!cheat)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
cheat->cheats[idx].state = !cheat->cheats[idx].state;
|
|
|
|
cheat_manager_update(cheat, idx);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-06 18:40:17 +00:00
|
|
|
int action_right_input_desc(unsigned type, const char *label,
|
2015-05-18 13:56:32 +00:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
|
2015-05-21 02:11:20 +00:00
|
|
|
unsigned inp_desc_user = inp_desc_index_offset / (RARCH_FIRST_CUSTOM_BIND + 4);
|
|
|
|
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
|
2015-05-18 13:56:32 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-21 02:11:20 +00:00
|
|
|
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
|
|
|
|
{
|
|
|
|
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < RARCH_FIRST_CUSTOM_BIND - 1)
|
|
|
|
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < 4 - 1)
|
|
|
|
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
|
|
|
|
}
|
2015-05-18 13:56:32 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_save_state(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
|
|
|
settings->state_slot++;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_scroll(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned scroll_speed = 0, fast_scroll_speed = 0;
|
|
|
|
menu_list_t *menu_list = menu_list_get_ptr();
|
|
|
|
menu_navigation_t *nav = menu_navigation_get_ptr();
|
|
|
|
if (!nav || !menu_list)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1;
|
|
|
|
fast_scroll_speed = 4 + 4 * scroll_speed;
|
|
|
|
|
|
|
|
if (nav->selection_ptr + fast_scroll_speed < (menu_list_get_size(menu_list)))
|
|
|
|
menu_navigation_set(nav, nav->selection_ptr + fast_scroll_speed, true);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((menu_list_get_size(menu_list) > 0))
|
|
|
|
menu_navigation_set_last(nav);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_mainmenu(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
menu_file_list_cbs_t *cbs = NULL;
|
|
|
|
unsigned push_list = 0;
|
|
|
|
menu_list_t *menu_list = menu_list_get_ptr();
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
unsigned action = MENU_ACTION_RIGHT;
|
2015-06-07 13:52:29 +00:00
|
|
|
size_t list_size = menu_driver_list_get_size(MENU_LIST_PLAIN);
|
2015-05-18 13:56:32 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-06-07 13:52:29 +00:00
|
|
|
if (list_size == 1)
|
2015-05-18 13:56:32 +00:00
|
|
|
{
|
2015-06-07 13:54:36 +00:00
|
|
|
menu->navigation.selection_ptr = 0;
|
2015-06-10 12:19:38 +00:00
|
|
|
if (menu->categories.selection_ptr != (menu_driver_list_get_size(MENU_LIST_HORIZONTAL)))
|
2015-06-07 13:54:36 +00:00
|
|
|
push_list = 1;
|
2015-05-18 13:56:32 +00:00
|
|
|
}
|
2015-05-21 02:11:20 +00:00
|
|
|
else
|
2015-05-18 13:56:32 +00:00
|
|
|
push_list = 2;
|
|
|
|
|
|
|
|
cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf,
|
|
|
|
menu->navigation.selection_ptr);
|
|
|
|
|
|
|
|
switch (push_list)
|
|
|
|
{
|
|
|
|
case 1:
|
2015-06-07 09:20:36 +00:00
|
|
|
menu_driver_list_cache(MENU_LIST_HORIZONTAL, action);
|
2015-05-18 13:56:32 +00:00
|
|
|
|
|
|
|
if (cbs && cbs->action_content_list_switch)
|
|
|
|
return cbs->action_content_list_switch(
|
|
|
|
menu_list->selection_buf, menu_list->menu_stack,
|
|
|
|
"", "", 0);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
action_right_scroll(0, "", false);
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_shader_scale_pass(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
|
|
|
struct video_shader *shader = NULL;
|
|
|
|
struct video_shader_pass *shader_pass = NULL;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-05-21 02:11:20 +00:00
|
|
|
|
2015-05-18 13:56:32 +00:00
|
|
|
shader = menu->shader;
|
|
|
|
if (!shader)
|
|
|
|
return -1;
|
|
|
|
shader_pass = &shader->pass[pass];
|
|
|
|
if (!shader_pass)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
{
|
|
|
|
unsigned current_scale = shader_pass->fbo.scale_x;
|
|
|
|
unsigned delta = 1;
|
|
|
|
current_scale = (current_scale + delta) % 6;
|
|
|
|
|
|
|
|
shader_pass->fbo.valid = current_scale;
|
|
|
|
shader_pass->fbo.scale_x = shader_pass->fbo.scale_y = current_scale;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_shader_filter_pass(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
|
|
|
struct video_shader *shader = NULL;
|
|
|
|
struct video_shader_pass *shader_pass = NULL;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-05-21 02:11:20 +00:00
|
|
|
|
2015-05-18 13:56:32 +00:00
|
|
|
shader = menu->shader;
|
|
|
|
if (!shader)
|
|
|
|
return -1;
|
|
|
|
shader_pass = &shader->pass[pass];
|
|
|
|
if (!shader_pass)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
unsigned delta = 1;
|
|
|
|
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_shader_filter_default(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
rarch_setting_t *setting = menu_setting_find("video_smooth");
|
2015-06-03 08:33:41 +00:00
|
|
|
if (!setting)
|
|
|
|
return -1;
|
|
|
|
return menu_action_handle_setting(setting, setting->type, MENU_ACTION_RIGHT,
|
|
|
|
wraparound);
|
|
|
|
#else
|
2015-05-18 13:56:32 +00:00
|
|
|
return 0;
|
2015-06-03 08:33:41 +00:00
|
|
|
#endif
|
2015-05-18 13:56:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_cheat_num_passes(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned new_size = 0;
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
cheat_manager_t *cheat = global->cheat;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (!cheat)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
new_size = cheat->size + 1;
|
|
|
|
menu_set_refresh();
|
|
|
|
|
|
|
|
if (menu_needs_refresh())
|
|
|
|
cheat_manager_realloc(cheat, new_size);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_shader_num_passes(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
struct video_shader *shader = NULL;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-05-21 02:11:20 +00:00
|
|
|
|
2015-05-18 13:56:32 +00:00
|
|
|
shader = menu->shader;
|
|
|
|
if (!shader)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if ((shader->passes < GFX_MAX_SHADERS))
|
|
|
|
shader->passes++;
|
|
|
|
menu_set_refresh();
|
|
|
|
|
|
|
|
if (menu_needs_refresh())
|
|
|
|
video_shader_resolve_parameters(NULL, menu->shader);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_right_video_resolution(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
2015-05-21 02:11:20 +00:00
|
|
|
{
|
2015-05-18 13:56:32 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-05-21 02:11:20 +00:00
|
|
|
|
2015-05-18 13:56:32 +00:00
|
|
|
(void)global;
|
|
|
|
|
|
|
|
#if defined(__CELLOS_LV2__)
|
|
|
|
if (global->console.screen.resolutions.current.idx + 1 <
|
|
|
|
global->console.screen.resolutions.count)
|
|
|
|
{
|
|
|
|
global->console.screen.resolutions.current.idx++;
|
|
|
|
global->console.screen.resolutions.current.id =
|
|
|
|
global->console.screen.resolutions.list
|
|
|
|
[global->console.screen.resolutions.current.idx];
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
video_driver_get_video_output_next();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-06 18:35:39 +00:00
|
|
|
int core_setting_right(unsigned type, const char *label,
|
2015-05-18 13:56:32 +00:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START;
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
|
|
|
|
(void)label;
|
|
|
|
|
|
|
|
core_option_next(global->system.core_options, idx);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int disk_options_disk_idx_right(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
event_command(EVENT_CMD_DISK_NEXT);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int bind_right_generic(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
2015-06-04 08:02:27 +00:00
|
|
|
return menu_setting_set(type, label, MENU_ACTION_RIGHT, wraparound);
|
2015-05-18 13:56:32 +00:00
|
|
|
}
|
|
|
|
|
2015-06-07 15:57:42 +00:00
|
|
|
static int menu_entries_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
|
|
|
|
unsigned type, uint32_t menu_label_hash)
|
2015-05-18 13:56:32 +00:00
|
|
|
{
|
2015-06-07 15:57:42 +00:00
|
|
|
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
2015-05-18 13:56:32 +00:00
|
|
|
&& 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;
|
2015-06-05 10:28:11 +00:00
|
|
|
else
|
2015-06-07 15:57:42 +00:00
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
|
|
|
|
cbs->action_right = disk_options_disk_idx_right;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_PLAIN:
|
|
|
|
case MENU_FILE_DIRECTORY:
|
|
|
|
case MENU_FILE_CARCHIVE:
|
|
|
|
case MENU_FILE_CORE:
|
|
|
|
case MENU_FILE_RDB:
|
|
|
|
case MENU_FILE_RDB_ENTRY:
|
|
|
|
case MENU_FILE_CURSOR:
|
|
|
|
case MENU_FILE_SHADER:
|
|
|
|
case MENU_FILE_SHADER_PRESET:
|
|
|
|
case MENU_FILE_IMAGE:
|
|
|
|
case MENU_FILE_OVERLAY:
|
|
|
|
case MENU_FILE_VIDEOFILTER:
|
|
|
|
case MENU_FILE_AUDIOFILTER:
|
|
|
|
case MENU_FILE_CONFIG:
|
|
|
|
case MENU_FILE_USE_DIRECTORY:
|
|
|
|
case MENU_FILE_PLAYLIST_ENTRY:
|
|
|
|
case MENU_FILE_DOWNLOAD_CORE:
|
|
|
|
case MENU_FILE_CHEAT:
|
|
|
|
case MENU_FILE_REMAP:
|
2015-06-07 22:56:08 +00:00
|
|
|
case MENU_FILE_PLAYLIST_COLLECTION:
|
2015-06-07 15:57:42 +00:00
|
|
|
case MENU_SETTING_GROUP:
|
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_VALUE_HORIZONTAL_MENU:
|
|
|
|
case MENU_VALUE_MAIN_MENU:
|
|
|
|
cbs->action_right = action_right_mainmenu;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
cbs->action_right = action_right_scroll;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MENU_SETTING_ACTION:
|
|
|
|
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,
|
2015-06-07 16:44:42 +00:00
|
|
|
const char *label, uint32_t label_hash, uint32_t menu_label_hash, const char *elem0)
|
2015-06-07 15:57:42 +00:00
|
|
|
{
|
2015-06-07 16:10:01 +00:00
|
|
|
unsigned i;
|
2015-06-08 00:03:50 +00:00
|
|
|
rarch_setting_t *setting = menu_setting_find(label);
|
2015-06-07 16:10:01 +00:00
|
|
|
|
2015-06-08 00:03:50 +00:00
|
|
|
if (setting)
|
2015-06-07 16:44:42 +00:00
|
|
|
{
|
2015-06-08 00:03:50 +00:00
|
|
|
if (!strcmp(setting->parent_group, "Settings") && setting->type == ST_GROUP)
|
2015-06-07 16:44:42 +00:00
|
|
|
{
|
|
|
|
cbs->action_right = action_right_scroll;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-07 16:10:01 +00:00
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
|
|
|
char label_setting[PATH_MAX_LENGTH];
|
|
|
|
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
|
|
|
|
|
|
|
if (!strcmp(label, label_setting))
|
|
|
|
{
|
|
|
|
cbs->action_right = bind_right_generic;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-07 15:57:42 +00:00
|
|
|
if (strstr(label, "rdb_entry"))
|
|
|
|
cbs->action_right = action_right_scroll;
|
|
|
|
else
|
2015-06-05 10:28:11 +00:00
|
|
|
{
|
2015-06-05 11:17:44 +00:00
|
|
|
switch (label_hash)
|
2015-06-05 10:28:11 +00:00
|
|
|
{
|
|
|
|
case MENU_LABEL_SAVESTATE:
|
|
|
|
case MENU_LABEL_LOADSTATE:
|
|
|
|
cbs->action_right = action_right_save_state;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_SCALE_PASS:
|
|
|
|
cbs->action_right = action_right_shader_scale_pass;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_FILTER_PASS:
|
|
|
|
cbs->action_right = action_right_shader_filter_pass;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_DEFAULT_FILTER:
|
|
|
|
cbs->action_right = action_right_shader_filter_default;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_NUM_PASSES:
|
|
|
|
cbs->action_right = action_right_shader_num_passes;
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_NUM_PASSES:
|
|
|
|
cbs->action_right = action_right_cheat_num_passes;
|
|
|
|
break;
|
2015-06-07 15:57:42 +00:00
|
|
|
default:
|
|
|
|
return -1;
|
2015-06-05 10:28:11 +00:00
|
|
|
}
|
|
|
|
}
|
2015-05-18 13:56:32 +00:00
|
|
|
|
2015-06-07 15:57:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-07 16:36:10 +00:00
|
|
|
int menu_entries_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
|
2015-06-07 15:57:42 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
if (!cbs)
|
2015-06-07 16:36:10 +00:00
|
|
|
return -1;
|
2015-06-07 15:57:42 +00:00
|
|
|
|
|
|
|
cbs->action_right = bind_right_generic;
|
|
|
|
|
2015-06-07 16:44:42 +00:00
|
|
|
if (menu_entries_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0)
|
2015-06-07 16:36:10 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (menu_entries_cbs_init_bind_right_compare_type(cbs, type, menu_label_hash) == 0)
|
|
|
|
return 0;
|
2015-06-07 15:57:42 +00:00
|
|
|
|
2015-06-07 16:36:10 +00:00
|
|
|
return -1;
|
2015-05-18 13:56:32 +00:00
|
|
|
}
|