Get rid of a ton of HAVE_SHADER_MANAGER ifdefs
This commit is contained in:
parent
51ca9825dd
commit
c4f7111aa3
|
@ -46,7 +46,6 @@
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
static int generic_shader_action_parameter_left(
|
static int generic_shader_action_parameter_left(
|
||||||
struct video_shader_parameter *param,
|
struct video_shader_parameter *param,
|
||||||
unsigned type, const char *label, bool wraparound)
|
unsigned type, const char *label, bool wraparound)
|
||||||
|
@ -84,7 +83,6 @@ static int shader_action_parameter_preset_left(unsigned type,
|
||||||
return generic_shader_action_parameter_left(param,
|
return generic_shader_action_parameter_left(param,
|
||||||
type, label, wraparound);
|
type, label, wraparound);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int action_left_cheat(unsigned type, const char *label,
|
static int action_left_cheat(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
|
@ -205,7 +203,6 @@ static int action_left_mainmenu(unsigned type, const char *label,
|
||||||
static int action_left_shader_scale_pass(unsigned type, const char *label,
|
static int action_left_shader_scale_pass(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
unsigned current_scale, delta;
|
unsigned current_scale, delta;
|
||||||
unsigned pass = type -
|
unsigned pass = type -
|
||||||
MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
||||||
|
@ -221,14 +218,12 @@ static int action_left_shader_scale_pass(unsigned type, const char *label,
|
||||||
shader_pass->fbo.valid = current_scale;
|
shader_pass->fbo.valid = current_scale;
|
||||||
shader_pass->fbo.scale_x = current_scale;
|
shader_pass->fbo.scale_x = current_scale;
|
||||||
shader_pass->fbo.scale_y = current_scale;
|
shader_pass->fbo.scale_y = current_scale;
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_left_shader_filter_pass(unsigned type, const char *label,
|
static int action_left_shader_filter_pass(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
unsigned delta = 2;
|
unsigned delta = 2;
|
||||||
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
||||||
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(pass);
|
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(pass);
|
||||||
|
@ -237,23 +232,18 @@ static int action_left_shader_filter_pass(unsigned type, const char *label,
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_left_shader_filter_default(unsigned type, const char *label,
|
static int action_left_shader_filter_default(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
rarch_setting_t *setting = menu_setting_find_enum(
|
rarch_setting_t *setting = menu_setting_find_enum(
|
||||||
MENU_ENUM_LABEL_VIDEO_SMOOTH);
|
MENU_ENUM_LABEL_VIDEO_SMOOTH);
|
||||||
if (!setting)
|
if (!setting)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
return menu_action_handle_setting(setting,
|
return menu_action_handle_setting(setting,
|
||||||
setting_get_type(setting), MENU_ACTION_LEFT, wraparound);
|
setting_get_type(setting), MENU_ACTION_LEFT, wraparound);
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_left_cheat_num_passes(unsigned type, const char *label,
|
static int action_left_cheat_num_passes(unsigned type, const char *label,
|
||||||
|
@ -274,7 +264,6 @@ static int action_left_cheat_num_passes(unsigned type, const char *label,
|
||||||
static int action_left_shader_num_passes(unsigned type, const char *label,
|
static int action_left_shader_num_passes(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
struct video_shader *shader = menu_shader_get();
|
struct video_shader *shader = menu_shader_get();
|
||||||
|
|
||||||
|
@ -288,7 +277,6 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||||
video_shader_resolve_parameters(NULL, shader);
|
video_shader_resolve_parameters(NULL, shader);
|
||||||
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +509,6 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
|
||||||
{
|
{
|
||||||
BIND_ACTION_LEFT(cbs, action_left_cheat);
|
BIND_ACTION_LEFT(cbs, action_left_cheat);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
||||||
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||||
{
|
{
|
||||||
|
@ -532,7 +519,6 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
|
||||||
{
|
{
|
||||||
BIND_ACTION_LEFT(cbs, shader_action_parameter_preset_left);
|
BIND_ACTION_LEFT(cbs, shader_action_parameter_preset_left);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
||||||
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
static int generic_shader_action_parameter_right(struct video_shader_parameter *param,
|
static int generic_shader_action_parameter_right(struct video_shader_parameter *param,
|
||||||
unsigned type, const char *label, bool wraparound)
|
unsigned type, const char *label, bool wraparound)
|
||||||
{
|
{
|
||||||
|
@ -81,7 +80,6 @@ int shader_action_parameter_preset_right(unsigned type, const char *label,
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
return generic_shader_action_parameter_right(param, type, label, wraparound);
|
return generic_shader_action_parameter_right(param, type, label, wraparound);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
|
@ -208,7 +206,6 @@ static int action_right_mainmenu(unsigned type, const char *label,
|
||||||
static int action_right_shader_scale_pass(unsigned type, const char *label,
|
static int action_right_shader_scale_pass(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
unsigned current_scale, delta;
|
unsigned current_scale, delta;
|
||||||
unsigned pass =
|
unsigned pass =
|
||||||
type - MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
type - MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
||||||
|
@ -223,39 +220,33 @@ static int action_right_shader_scale_pass(unsigned type, const char *label,
|
||||||
|
|
||||||
shader_pass->fbo.valid = current_scale;
|
shader_pass->fbo.valid = current_scale;
|
||||||
shader_pass->fbo.scale_x = shader_pass->fbo.scale_y = current_scale;
|
shader_pass->fbo.scale_x = shader_pass->fbo.scale_y = current_scale;
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_right_shader_filter_pass(unsigned type, const char *label,
|
static int action_right_shader_filter_pass(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
||||||
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
unsigned delta = 1;
|
||||||
unsigned delta = 1;
|
struct video_shader_pass
|
||||||
struct video_shader_pass *shader_pass = menu_shader_manager_get_pass(pass);
|
*shader_pass = menu_shader_manager_get_pass(pass);
|
||||||
|
|
||||||
if (!shader_pass)
|
if (!shader_pass)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
|
|
||||||
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_right_shader_filter_default(unsigned type, const char *label,
|
static int action_right_shader_filter_default(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
rarch_setting_t *setting = menu_setting_find_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH);
|
rarch_setting_t *setting = menu_setting_find_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH);
|
||||||
if (!setting)
|
if (!setting)
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
return menu_action_handle_setting(setting,
|
return menu_action_handle_setting(setting,
|
||||||
setting_get_type(setting), MENU_ACTION_RIGHT,
|
setting_get_type(setting), MENU_ACTION_RIGHT,
|
||||||
wraparound);
|
wraparound);
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_right_cheat_num_passes(unsigned type, const char *label,
|
static int action_right_cheat_num_passes(unsigned type, const char *label,
|
||||||
|
@ -275,7 +266,6 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
|
||||||
static int action_right_shader_num_passes(unsigned type, const char *label,
|
static int action_right_shader_num_passes(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
struct video_shader *shader = menu_shader_get();
|
struct video_shader *shader = menu_shader_get();
|
||||||
|
|
||||||
|
@ -289,7 +279,6 @@ static int action_right_shader_num_passes(unsigned type, const char *label,
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||||
video_shader_resolve_parameters(NULL, shader);
|
video_shader_resolve_parameters(NULL, shader);
|
||||||
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +380,6 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
|
||||||
{
|
{
|
||||||
BIND_ACTION_RIGHT(cbs, action_right_cheat);
|
BIND_ACTION_RIGHT(cbs, action_right_cheat);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
|
||||||
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
||||||
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||||
{
|
{
|
||||||
|
@ -402,7 +390,6 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
|
||||||
{
|
{
|
||||||
BIND_ACTION_RIGHT(cbs, shader_action_parameter_preset_right);
|
BIND_ACTION_RIGHT(cbs, shader_action_parameter_preset_right);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
||||||
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue