Merge pull request #2845 from lakkatv/master

(XMB) Add support for the RetroActive theme
This commit is contained in:
Twinaphex 2016-04-09 13:34:26 +02:00
commit d818578076
6 changed files with 18 additions and 6 deletions

View File

@ -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 +

View File

@ -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 +

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
@ -398,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;
@ -521,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);

View File

@ -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,