From 8c02d63f2e26b6beae485ab91f3722ba0cbcbf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sat, 9 Apr 2016 12:46:40 +0700 Subject: [PATCH 1/2] (XMB) Add support for the RetroActive theme --- menu/cbs/menu_cbs_get_value.c | 3 +++ menu/drivers/xmb.c | 2 ++ menu/menu_setting.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 5fc0ec4922..42e0ac6e83 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -611,6 +611,9 @@ static void menu_action_setting_disp_set_label_xmb_theme( snprintf(s, len, "%s", "FlatUI"); break; case 2: + snprintf(s, len, "%s", "RetroActive"); + break; + case 3: snprintf(s, len, "%s", "Custom"); break; } diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index f64389db7d..4a536530d9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -237,6 +237,8 @@ static const char *xmb_theme_ident(void) case 1: return "flatui"; case 2: + return "retroactive"; + case 3: return "custom"; default: break; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 7839f4b490..5e6500c595 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5873,7 +5873,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, 3, 1, true, true); CONFIG_BOOL( list, list_info, From 64e2f9e2f0a2a5bd1a2425bc270007c4560c26c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sat, 9 Apr 2016 13:23:59 +0700 Subject: [PATCH 2/2] (XMB) Subtler drop shadows --- gfx/drivers_font/gl_raster_font.c | 6 ++++-- gfx/drivers_font/vulkan_raster_font.c | 6 ++++-- gfx/font_driver.h | 2 ++ menu/drivers/xmb.c | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gfx/drivers_font/gl_raster_font.c b/gfx/drivers_font/gl_raster_font.c index 843d4a917d..6bff5193a5 100644 --- a/gfx/drivers_font/gl_raster_font.c +++ b/gfx/drivers_font/gl_raster_font.c @@ -427,7 +427,7 @@ static void gl_raster_font_restore_viewport(gl_t *gl) static void gl_raster_font_render_msg(void *data, const char *msg, const void *userdata) { - GLfloat x, y, scale, drop_mod; + GLfloat x, y, scale, drop_mod, drop_alpha; GLfloat color[4], color_dark[4]; int drop_x, drop_y; bool full_screen; @@ -455,6 +455,7 @@ static void gl_raster_font_render_msg(void *data, const char *msg, drop_x = params->drop_x; drop_y = params->drop_y; drop_mod = params->drop_mod; + drop_alpha = params->drop_alpha; color[0] = FONT_COLOR_GET_RED(params->color) / 255.0f; color[1] = FONT_COLOR_GET_GREEN(params->color) / 255.0f; @@ -481,6 +482,7 @@ static void gl_raster_font_render_msg(void *data, const char *msg, drop_x = -2; drop_y = -2; drop_mod = 0.3f; + drop_alpha = 1.0f; } if (font && font->block) @@ -493,7 +495,7 @@ static void gl_raster_font_render_msg(void *data, const char *msg, color_dark[0] = color[0] * drop_mod; color_dark[1] = color[1] * drop_mod; color_dark[2] = color[2] * drop_mod; - color_dark[3] = color[3]; + color_dark[3] = color[3] * drop_alpha; gl_raster_font_render_message(font, msg, scale, color_dark, x + scale * drop_x / gl->vp.width, y + diff --git a/gfx/drivers_font/vulkan_raster_font.c b/gfx/drivers_font/vulkan_raster_font.c index 110c42de92..46336e1e9d 100644 --- a/gfx/drivers_font/vulkan_raster_font.c +++ b/gfx/drivers_font/vulkan_raster_font.c @@ -253,7 +253,7 @@ static void vulkan_raster_font_flush(vulkan_raster_t *font) static void vulkan_raster_font_render_msg(void *data, const char *msg, const void *userdata) { - float x, y, scale, drop_mod; + float x, y, scale, drop_mod, drop_alpha; float color[4], color_dark[4]; int drop_x, drop_y; bool full_screen; @@ -279,6 +279,7 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg, drop_x = params->drop_x; drop_y = params->drop_y; drop_mod = params->drop_mod; + drop_alpha = params->drop_alpha; color[0] = FONT_COLOR_GET_RED(params->color) / 255.0f; color[1] = FONT_COLOR_GET_GREEN(params->color) / 255.0f; @@ -305,6 +306,7 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg, drop_x = -2; drop_y = -2; drop_mod = 0.3f; + drop_alpha = 1.0f; } vulkan_raster_font_setup_viewport(font, full_screen); @@ -325,7 +327,7 @@ static void vulkan_raster_font_render_msg(void *data, const char *msg, color_dark[0] = color[0] * drop_mod; color_dark[1] = color[1] * drop_mod; color_dark[2] = color[2] * drop_mod; - color_dark[3] = color[3]; + color_dark[3] = color[3] * drop_alpha; vulkan_raster_font_render_message(font, msg, scale, color_dark, x + scale * drop_x / vk->vp.width, y + diff --git a/gfx/font_driver.h b/gfx/font_driver.h index 5f32cbad92..72d2218eee 100644 --- a/gfx/font_driver.h +++ b/gfx/font_driver.h @@ -85,6 +85,8 @@ struct font_params /* Drop shadow offset. * If both are 0, no drop shadow will be rendered. */ int drop_x, drop_y; + /* Drop shadow alpha */ + float drop_alpha; /* ABGR. Use the macros. */ uint32_t color; bool full_screen; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 4a536530d9..9414fc2a88 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -400,7 +400,7 @@ static void xmb_draw_icon_predone(xmb_handle_t *xmb, { for (i = 0; i < 16; i++) shadow[i] = 0; - shadow[3] = shadow[7] = shadow[11] = shadow[15] = color[3]; + shadow[3] = shadow[7] = shadow[11] = shadow[15] = color[3]/4; coords.color = shadow; draw.x = x + 2; @@ -523,6 +523,7 @@ static void xmb_draw_text(xmb_handle_t *xmb, { params.drop_x = 2.0f; params.drop_y = -2.0f; + params.drop_alpha = 0.25f; } menu_display_ctl(MENU_DISPLAY_CTL_FONT_BUF, &disp_buf);