(menu shader manager) Cleanups

This commit is contained in:
twinaphex 2017-01-09 03:18:37 +01:00
parent 1fd9be102f
commit 338980ef29
2 changed files with 13 additions and 14 deletions

View File

@ -48,15 +48,15 @@
#ifdef HAVE_SHADER_MANAGER
static int generic_shader_action_parameter_left(
struct video_shader *shader, struct video_shader_parameter *param,
struct video_shader_parameter *param,
unsigned type, const char *label, bool wraparound)
{
if (shader)
{
param->current -= param->step;
param->current = MIN(MAX(param->minimum, param->current),
param->maximum);
}
if (!param)
return 0;
param->current -= param->step;
param->current = MIN(MAX(param->minimum, param->current),
param->maximum);
return 0;
}
@ -70,7 +70,7 @@ static int shader_action_parameter_left(unsigned type, const char *label,
param = &shader_info.data->parameters[type
- MENU_SETTINGS_SHADER_PARAMETER_0];
return generic_shader_action_parameter_left(shader_info.data, param,
return generic_shader_action_parameter_left(param,
type, label, wraparound);
}
@ -87,7 +87,7 @@ static int shader_action_parameter_preset_left(unsigned type,
param = shader ?
&shader->parameters[type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0] :
NULL;
return generic_shader_action_parameter_left(shader, param,
return generic_shader_action_parameter_left(param,
type, label, wraparound);
}
#endif

View File

@ -48,11 +48,10 @@
#endif
#ifdef HAVE_SHADER_MANAGER
static int generic_shader_action_parameter_right(
struct video_shader *shader, struct video_shader_parameter *param,
static int generic_shader_action_parameter_right(struct video_shader_parameter *param,
unsigned type, const char *label, bool wraparound)
{
if (!shader)
if (!param)
return menu_cbs_exit();
param->current += param->step;
@ -71,7 +70,7 @@ int shader_action_parameter_right(unsigned type, const char *label, bool wraparo
video_shader_driver_get_current_shader(&shader_info);
param = &shader_info.data->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
return generic_shader_action_parameter_right(shader_info.data, param, type, label, wraparound);
return generic_shader_action_parameter_right(param, type, label, wraparound);
}
int shader_action_parameter_preset_right(unsigned type, const char *label,
@ -86,7 +85,7 @@ int shader_action_parameter_preset_right(unsigned type, const char *label,
param = shader ?
&shader->parameters[type - MENU_SETTINGS_SHADER_PRESET_PARAMETER_0] :
NULL;
return generic_shader_action_parameter_right(shader, param, type, label, wraparound);
return generic_shader_action_parameter_right(param, type, label, wraparound);
}
#endif