Dehardcode shader pipeline enums

This commit is contained in:
twinaphex 2016-07-14 18:40:57 +02:00
parent 664f90b023
commit 745bc1eb0d
5 changed files with 15 additions and 7 deletions

View File

@ -213,15 +213,15 @@ static void menu_action_setting_disp_set_label_pipeline(
switch (settings->menu.xmb.shader_pipeline)
{
case 0:
case XMB_SHADER_PIPELINE_WALLPAPER:
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
break;
case 1:
case XMB_SHADER_PIPELINE_SIMPLE_RIBBON:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED), len);
break;
case 2:
case XMB_SHADER_PIPELINE_RIBBON:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON), len);

View File

@ -1925,7 +1925,7 @@ static void xmb_draw_bg(
menu_display_set_viewport();
#ifdef HAVE_SHADERPIPELINE
if (settings->menu.xmb.shader_pipeline > 0
if (settings->menu.xmb.shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
&&
(settings->menu.xmb.menu_color_theme != XMB_THEME_WALLPAPER))
{
@ -1939,7 +1939,7 @@ static void xmb_draw_bg(
menu_display_draw_gradient(&draw);
draw.pipeline.id = VIDEO_SHADER_MENU_SEC;
if (settings->menu.xmb.shader_pipeline == 2)
if (settings->menu.xmb.shader_pipeline == XMB_SHADER_PIPELINE_RIBBON)
draw.pipeline.id = VIDEO_SHADER_MENU;
menu_display_draw_pipeline(&draw);

View File

@ -481,7 +481,7 @@ bool menu_display_shader_pipeline_active(void)
settings_t *settings = config_get_ptr();
if (!string_is_equal(menu_driver_ident(), "xmb"))
return false;
if (settings->menu.xmb.shader_pipeline == 0)
if (settings->menu.xmb.shader_pipeline == XMB_SHADER_PIPELINE_WALLPAPER)
return false;
return true;
}

View File

@ -56,6 +56,14 @@ enum xmb_color_theme
XMB_THEME_LAST
};
enum xmb_shader_pipeline
{
XMB_SHADER_PIPELINE_WALLPAPER = 0,
XMB_SHADER_PIPELINE_SIMPLE_RIBBON,
XMB_SHADER_PIPELINE_RIBBON,
XMB_SHADER_PIPELINE_LAST
};
enum menu_display_prim_type
{
MENU_DISPLAY_PRIM_NONE = 0,

View File

@ -6931,7 +6931,7 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 2, 1, true, true);
menu_settings_list_current_add_range(list, list_info, 0, XMB_SHADER_PIPELINE_LAST-1, 1, true, true);
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_XMB_RIBBON_ENABLE);
#endif