(XMB) Ribbon Enable setting

This commit is contained in:
Jean-André Santoni 2016-04-22 12:32:32 +07:00
parent b34da03281
commit a1e91ff606
7 changed files with 37 additions and 14 deletions

View File

@ -512,6 +512,7 @@ static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static unsigned xmb_theme = 0;
static bool xmb_shadows = false;
static bool xmb_ribbon_enable = false;
static bool show_advanced_settings = true;
static const uint32_t menu_entry_normal_color = 0xffffffff;

View File

@ -484,6 +484,7 @@ static void config_set_defaults(void)
settings->menu.xmb_alpha_factor = xmb_alpha_factor;
settings->menu.xmb_theme = xmb_theme;
settings->menu.xmb_shadows = xmb_shadows;
settings->menu.xmb_ribbon_enable = xmb_ribbon_enable;
settings->menu.xmb_font[0] = '\0';
settings->menu.throttle_framerate = true;
settings->menu.linear_filter = true;
@ -1542,6 +1543,7 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_alpha_factor, "xmb_alpha_factor");
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_theme, "xmb_theme");
CONFIG_GET_BOOL_BASE(conf, settings, menu.xmb_shadows, "xmb_shadows");
CONFIG_GET_BOOL_BASE(conf, settings, menu.xmb_ribbon_enable, "xmb_ribbon_enable");
config_get_path(conf, "xmb_font", settings->menu.xmb_font, sizeof(settings->menu.xmb_font));
#endif
config_get_array(conf, "video_context_driver", settings->video.context_driver, sizeof(settings->video.context_driver));
@ -2774,6 +2776,7 @@ bool config_save_file(const char *path)
config_set_int(conf, "xmb_alpha_factor", settings->menu.xmb_alpha_factor);
config_set_int(conf, "xmb_theme", settings->menu.xmb_theme);
config_set_bool(conf, "xmb_shadows", settings->menu.xmb_shadows);
config_set_bool(conf, "xmb_ribbon_enable", settings->menu.xmb_ribbon_enable);
config_set_path(conf, "xmb_font",
!string_is_empty(settings->menu.xmb_font) ? settings->menu.xmb_font : "");
config_set_path(conf, "rgui_browser_directory",

View File

@ -168,6 +168,7 @@ typedef struct settings
unsigned xmb_alpha_factor;
unsigned xmb_theme;
bool xmb_shadows;
bool xmb_ribbon_enable;
char xmb_font[PATH_MAX_LENGTH];
bool throttle_framerate;
bool linear_filter;

View File

@ -48,12 +48,9 @@
#include "../../tasks/tasks_internal.h"
#if 0
#define XMB_RIBBON_ENABLE
#define XMB_RIBBON_ROWS 16
#define XMB_RIBBON_COLS 32
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
#endif
#ifndef XMB_DELAY
#define XMB_DELAY 10
@ -1830,13 +1827,18 @@ static void xmb_draw_bg(
menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL);
menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL);
#ifdef XMB_RIBBON_ENABLE
if (settings->menu.xmb_ribbon_enable)
{
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_RIBBON, &draw);
#else
}
else
{
draw.x = 0;
draw.y = 0;
menu_display_ctl(MENU_DISPLAY_CTL_DRAW_BG, &draw);
#endif
}
menu_display_ctl(MENU_DISPLAY_CTL_BLEND_END, NULL);
}
@ -2227,7 +2229,6 @@ static void xmb_layout(xmb_handle_t *xmb)
}
}
#ifdef XMB_RIBBON_ENABLE
static void xmb_ribbon_set_vertex(float *ribbon_verts, unsigned idx, unsigned row, unsigned col)
{
ribbon_verts[idx++] = ((float)col) / 15.5f - 1.0f;
@ -2265,7 +2266,6 @@ static void xmb_init_ribbon(xmb_handle_t * xmb)
gfx_coord_array_append(ca, &coords, XMB_RIBBON_VERTICES);
}
#endif
static void *xmb_init(void **userdata)
{
@ -2319,9 +2319,7 @@ static void *xmb_init(void **userdata)
xmb_init_horizontal_list(xmb);
xmb_font(xmb);
#ifdef XMB_RIBBON_ENABLE
xmb_init_ribbon(xmb);
#endif
return menu;

View File

@ -302,6 +302,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
return "xmb_theme";
case MENU_LABEL_XMB_SHADOWS:
return "xmb_shadows";
case MENU_LABEL_XMB_RIBBON_ENABLE:
return "xmb_ribbon_enable";
case MENU_LABEL_XMB_SCALE_FACTOR:
return "xmb_scale_factor";
case MENU_LABEL_XMB_ALPHA_FACTOR:
@ -1060,6 +1062,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
return "XMB Theme";
case MENU_LABEL_VALUE_XMB_SHADOWS:
return "XMB Shadows";
case MENU_LABEL_VALUE_XMB_RIBBON_ENABLE:
return "XMB Ribbon Enable";
case MENU_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE:
return "Suspend Screensaver";
case MENU_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION:

View File

@ -390,6 +390,8 @@ extern "C" {
#define MENU_LABEL_VALUE_XMB_THEME 0x3603f65fU
#define MENU_LABEL_XMB_SHADOWS 0xf9859e24U
#define MENU_LABEL_VALUE_XMB_SHADOWS 0x7993b645U
#define MENU_LABEL_XMB_RIBBON_ENABLE 0x8e89c3edU
#define MENU_LABEL_VALUE_XMB_RIBBON_ENABLE 0xd53e09c8U
#define MENU_LABEL_VOLUME_UP 0xa66e9681U
#define MENU_LABEL_VOLUME_DOWN 0xfc64f3d4U
#define MENU_LABEL_LOG_VERBOSITY 0x6648c96dU

View File

@ -5888,6 +5888,20 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
CONFIG_BOOL(
list, list_info,
&settings->menu.xmb_ribbon_enable,
menu_hash_to_str(MENU_LABEL_XMB_RIBBON_ENABLE),
menu_hash_to_str(MENU_LABEL_VALUE_XMB_RIBBON_ENABLE),
xmb_ribbon_enable,
menu_hash_to_str(MENU_VALUE_OFF),
menu_hash_to_str(MENU_VALUE_ON),
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
}
CONFIG_BOOL(