(menu_cbs_select.c) Bind shader parameters

This commit is contained in:
twinaphex 2015-09-02 01:39:52 +02:00
parent c4af46b686
commit a1cf635289
3 changed files with 34 additions and 3 deletions

View File

@ -45,7 +45,7 @@ static void shader_action_parameter_right_common(
}
#endif
static int shader_action_parameter_right(unsigned type, const char *label, bool wraparound)
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();
@ -57,7 +57,7 @@ static int shader_action_parameter_right(unsigned type, const char *label, bool
return 0;
}
static int shader_action_parameter_preset_right(unsigned type, const char *label,
int shader_action_parameter_preset_right(unsigned type, const char *label,
bool wraparound)
{
#ifdef HAVE_SHADER_MANAGER

View File

@ -95,6 +95,26 @@ static int action_select_core_setting(const char *path, const char *label, unsig
return core_setting_right(type, label, true);
}
static int shader_action_parameter_select(const char *path, const char *label, unsigned type,
size_t idx)
{
#ifdef HAVE_SHADER_MANAGER
return shader_action_parameter_right(type, label, true);
#else
return 0;
#endif
}
static int shader_action_parameter_preset_select(const char *path, const char *label, unsigned type,
size_t idx)
{
#ifdef HAVE_SHADER_MANAGER
return shader_action_parameter_preset_right(type, label, true);
#else
return 0;
#endif
}
static int action_select_cheat(const char *path, const char *label, unsigned type,
size_t idx)
{
@ -110,7 +130,13 @@ static int action_select_input_desc(const char *path, const char *label, unsigne
static int menu_cbs_init_bind_select_compare_type(
menu_file_list_cbs_t *cbs, unsigned type)
{
if (type >= MENU_SETTINGS_CHEAT_BEGIN
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_select = shader_action_parameter_select;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_select = shader_action_parameter_preset_select;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_select = action_select_cheat;
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN

View File

@ -33,6 +33,11 @@ extern char core_updater_path[PATH_MAX_LENGTH];
/* Function callbacks */
int shader_action_parameter_right(unsigned type, const char *label, bool wraparound);
int shader_action_parameter_preset_right(unsigned type, const char *label,
bool wraparound);
int action_ok_push_generic_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx);