From 2ce247f11a2169a0ac8000fcc89749e342af4780 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 25 Apr 2016 17:55:18 +0200 Subject: [PATCH] Revert "Revert "(XMB) Thumbnails shadows"" This reverts commit faa717a8abaf4521da44285320397efeb8679ca6. --- menu/drivers/xmb.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index d3d7c7a9f7..b710ffe916 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -514,10 +514,13 @@ static void xmb_draw_icon( static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color, unsigned width, unsigned height) { + settings_t *settings = config_get_ptr(); + unsigned i; menu_display_ctx_rotate_draw_t rotate_draw; menu_display_ctx_draw_t draw; struct gfx_coords coords; math_matrix_4x4 mymat; + float shadow[16]; float y = xmb->margins.screen.top + xmb->icon.size + xmb->thumbnail_height; float x = xmb->margins.screen.left + xmb->icon.spacing.horizontal + 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.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.height = xmb->thumbnail_height; 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; 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,