Merge pull request #2898 from lakkatv/master

(XMB) Thumbnails shadows
This commit is contained in:
Twinaphex 2016-04-25 17:42:01 +02:00
commit 5f4687d16c

View File

@ -514,10 +514,13 @@ static void xmb_draw_icon(
static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color, static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color,
unsigned width, unsigned height) unsigned width, unsigned height)
{ {
settings_t *settings = config_get_ptr();
unsigned i;
menu_display_ctx_rotate_draw_t rotate_draw; menu_display_ctx_rotate_draw_t rotate_draw;
menu_display_ctx_draw_t draw; menu_display_ctx_draw_t draw;
struct gfx_coords coords; struct gfx_coords coords;
math_matrix_4x4 mymat; math_matrix_4x4 mymat;
float shadow[16];
float y = xmb->margins.screen.top + xmb->icon.size + xmb->thumbnail_height; float y = xmb->margins.screen.top + xmb->icon.size + xmb->thumbnail_height;
float x = xmb->margins.screen.left + xmb->icon.spacing.horizontal + float x = xmb->margins.screen.left + xmb->icon.spacing.horizontal +
xmb->icon.spacing.horizontal*4 - xmb->icon.size / 4; xmb->icon.spacing.horizontal*4 - xmb->icon.size / 4;
@ -535,10 +538,7 @@ static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color,
coords.vertex = NULL; coords.vertex = NULL;
coords.tex_coord = NULL; coords.tex_coord = NULL;
coords.lut_tex_coord = NULL; coords.lut_tex_coord = NULL;
coords.color = (const float*)color;
draw.x = x;
draw.y = height - y;
draw.width = xmb->thumbnail_width; draw.width = xmb->thumbnail_width;
draw.height = xmb->thumbnail_height; draw.height = xmb->thumbnail_height;
draw.coords = &coords; draw.coords = &coords;
@ -547,6 +547,26 @@ static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color,
draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP;
menu_display_ctl(MENU_DISPLAY_CTL_DRAW, &draw); menu_display_ctl(MENU_DISPLAY_CTL_DRAW, &draw);
if (settings->menu.xmb_shadows_enable)
{
for (i = 0; i < 16; i++)
shadow[i] = 0;
menu_display_set_alpha(shadow, color[3] * 0.35f);
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);
} }
static void xmb_draw_text(xmb_handle_t *xmb, static void xmb_draw_text(xmb_handle_t *xmb,