mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 19:21:03 +00:00
(XMB) Shadows
This commit is contained in:
parent
e96c2b4ef3
commit
53a1369dba
@ -511,6 +511,7 @@ static bool default_block_config_read = true;
|
||||
static unsigned xmb_scale_factor = 100;
|
||||
static unsigned xmb_alpha_factor = 75;
|
||||
static unsigned xmb_theme = 0;
|
||||
static bool xmb_shadows = false;
|
||||
|
||||
static bool show_advanced_settings = true;
|
||||
static const uint32_t menu_entry_normal_color = 0xffffffff;
|
||||
|
@ -482,6 +482,7 @@ static void config_set_defaults(void)
|
||||
settings->menu.xmb_scale_factor = xmb_scale_factor;
|
||||
settings->menu.xmb_alpha_factor = xmb_alpha_factor;
|
||||
settings->menu.xmb_theme = xmb_theme;
|
||||
settings->menu.xmb_shadows = xmb_shadows;
|
||||
settings->menu.xmb_font[0] = '\0';
|
||||
settings->menu.throttle_framerate = true;
|
||||
settings->menu.linear_filter = true;
|
||||
@ -1539,6 +1540,7 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_scale_factor, "xmb_scale_factor");
|
||||
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_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));
|
||||
@ -2770,6 +2772,7 @@ bool config_save_file(const char *path)
|
||||
config_set_int(conf, "xmb_scale_factor", settings->menu.xmb_scale_factor);
|
||||
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_path(conf, "xmb_font",
|
||||
!string_is_empty(settings->menu.xmb_font) ? settings->menu.xmb_font : "");
|
||||
config_set_path(conf, "rgui_browser_directory",
|
||||
|
@ -167,6 +167,7 @@ typedef struct settings
|
||||
unsigned xmb_scale_factor;
|
||||
unsigned xmb_alpha_factor;
|
||||
unsigned xmb_theme;
|
||||
bool xmb_shadows;
|
||||
char xmb_font[PATH_MAX_LENGTH];
|
||||
bool throttle_framerate;
|
||||
bool linear_filter;
|
||||
|
@ -349,9 +349,11 @@ static void xmb_draw_icon_predone(xmb_handle_t *xmb,
|
||||
float alpha, float rotation, float scale_factor,
|
||||
float *color)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_display_ctx_draw_t draw;
|
||||
|
||||
struct gfx_coords coords;
|
||||
float shadow[16];
|
||||
unsigned i;
|
||||
|
||||
if (
|
||||
x < -xmb->icon.size/2 ||
|
||||
@ -364,10 +366,7 @@ static void xmb_draw_icon_predone(xmb_handle_t *xmb,
|
||||
coords.vertex = NULL;
|
||||
coords.tex_coord = NULL;
|
||||
coords.lut_tex_coord = NULL;
|
||||
coords.color = (const float*)color;
|
||||
|
||||
draw.x = x;
|
||||
draw.y = height - y;
|
||||
draw.width = xmb->icon.size;
|
||||
draw.height = xmb->icon.size;
|
||||
draw.coords = &coords;
|
||||
@ -375,6 +374,23 @@ static void xmb_draw_icon_predone(xmb_handle_t *xmb,
|
||||
draw.texture = texture;
|
||||
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
|
||||
if (settings->menu.xmb_shadows)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
shadow[i] = 0;
|
||||
shadow[3] = shadow[7] = shadow[11] = shadow[15] = color[3];
|
||||
|
||||
coords.color = shadow;
|
||||
draw.x = x + 2;
|
||||
draw.y = height - y - 2;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW, &draw);
|
||||
}
|
||||
|
||||
coords.color = (const float*)color;
|
||||
draw.x = x;
|
||||
draw.y = height - y;
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_DRAW, &draw);
|
||||
}
|
||||
|
||||
@ -454,6 +470,7 @@ static void xmb_draw_text(xmb_handle_t *xmb,
|
||||
enum text_alignment text_align,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct font_params params;
|
||||
uint8_t a8 = 0;
|
||||
void *disp_buf = NULL;
|
||||
@ -480,6 +497,12 @@ static void xmb_draw_text(xmb_handle_t *xmb,
|
||||
params.full_screen = true;
|
||||
params.text_align = text_align;
|
||||
|
||||
if (settings->menu.xmb_shadows)
|
||||
{
|
||||
params.drop_x = 2.0f;
|
||||
params.drop_y = -2.0f;
|
||||
}
|
||||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_FONT_BUF, &disp_buf);
|
||||
|
||||
video_driver_set_osd_msg(str, ¶ms, disp_buf);
|
||||
|
@ -300,6 +300,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash)
|
||||
return "xmb_font";
|
||||
case MENU_LABEL_XMB_THEME:
|
||||
return "xmb_theme";
|
||||
case MENU_LABEL_XMB_SHADOWS:
|
||||
return "xmb_shadows";
|
||||
case MENU_LABEL_XMB_SCALE_FACTOR:
|
||||
return "xmb_scale_factor";
|
||||
case MENU_LABEL_XMB_ALPHA_FACTOR:
|
||||
@ -1056,6 +1058,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
|
||||
return "XMB Font";
|
||||
case MENU_LABEL_VALUE_XMB_THEME:
|
||||
return "XMB Theme";
|
||||
case MENU_LABEL_VALUE_XMB_SHADOWS:
|
||||
return "XMB Shadows";
|
||||
case MENU_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE:
|
||||
return "Suspend Screensaver";
|
||||
case MENU_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION:
|
||||
|
@ -388,6 +388,8 @@ extern "C" {
|
||||
#define MENU_LABEL_VALUE_XMB_FONT 0x0020337E7
|
||||
#define MENU_LABEL_XMB_THEME 0x824c5a7eU
|
||||
#define MENU_LABEL_VALUE_XMB_THEME 0x3603f65fU
|
||||
#define MENU_LABEL_XMB_SHADOWS 0xf9859e24U
|
||||
#define MENU_LABEL_VALUE_XMB_SHADOWS 0x7993b645U
|
||||
#define MENU_LABEL_VOLUME_UP 0xa66e9681U
|
||||
#define MENU_LABEL_VOLUME_DOWN 0xfc64f3d4U
|
||||
#define MENU_LABEL_LOG_VERBOSITY 0x6648c96dU
|
||||
|
@ -5934,6 +5934,20 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 2, 1, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->menu.xmb_shadows,
|
||||
menu_hash_to_str(MENU_LABEL_XMB_SHADOWS),
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_XMB_SHADOWS),
|
||||
xmb_shadows,
|
||||
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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user