From dad5215d93dc92c5ef570e529c3b62991c1dc879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 22 Apr 2016 17:11:56 +0700 Subject: [PATCH 1/4] (XMB) Rename variables --- menu/drivers/xmb.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 05ab107662..36f8036ef9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1875,8 +1875,8 @@ static void xmb_draw_bg( float alpha, bool force_transparency, uintptr_t texture_id, - float *coord_color, - float *coord_color2) + float *coord_black, + float *coord_white) { menu_display_ctx_draw_t draw; settings_t *settings = config_get_ptr(); @@ -1884,7 +1884,7 @@ static void xmb_draw_bg( draw.texture = texture_id; draw.width = width; draw.height = height; - draw.color = &coord_color[0]; + draw.color = &coord_black[0]; draw.handle_alpha = alpha; draw.force_transparency = force_transparency; draw.vertex = NULL; @@ -1898,7 +1898,7 @@ static void xmb_draw_bg( || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) ) && !draw.force_transparency && draw.texture) - draw.color = &coord_color2[0]; + draw.color = &coord_white[0]; menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL); @@ -1907,7 +1907,7 @@ static void xmb_draw_bg( if (settings->menu.xmb_ribbon_enable) { draw.color = xmb_gradient_ident(); - menu_display_set_alpha(draw.color, coord_color[3]); + menu_display_set_alpha(draw.color, coord_black[3]); menu_display_ctl(MENU_DISPLAY_CTL_DRAW_GRADIENT, &draw); menu_display_ctl(MENU_DISPLAY_CTL_DRAW_RIBBON, &draw); } @@ -1964,7 +1964,7 @@ static void xmb_frame(void *data) math_matrix_4x4 mymat; unsigned i, width, height; char msg[PATH_MAX_LENGTH], title_msg[256]; - float item_color[16], coord_color[16], coord_color2[16]; + float item_color[16], coord_black[16], coord_white[16]; menu_display_ctx_rotate_draw_t rotate_draw; bool display_kb = false; bool render_background = false; @@ -1987,15 +1987,15 @@ static void xmb_frame(void *data) for (i = 0; i < 16; i++) { - coord_color[i] = 0; - coord_color2[i] = 1.0f; + coord_black[i] = 0; + coord_white[i] = 1.0f; item_color[i] = 1.0f; } - menu_display_set_alpha(coord_color, + menu_display_set_alpha(coord_black, ((float)settings->menu.xmb_alpha_factor/100 > xmb->alpha) ? xmb->alpha : (float)settings->menu.xmb_alpha_factor/100); - menu_display_set_alpha(coord_color2, xmb->alpha); + menu_display_set_alpha(coord_white, xmb->alpha); xmb_draw_bg( xmb, @@ -2004,8 +2004,8 @@ static void xmb_frame(void *data) xmb->alpha, false, xmb->textures.bg, - coord_color, - coord_color2); + coord_black, + coord_white); /* Title text */ xmb_draw_text(xmb, @@ -2029,12 +2029,12 @@ static void xmb_frame(void *data) menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL); if (strcmp(xmb_thumbnails_ident(), "OFF") && xmb->thumbnail) - xmb_draw_thumbnail(xmb, &coord_color2[0], width, height); + xmb_draw_thumbnail(xmb, &coord_white[0], width, height); /* Clock image */ - menu_display_set_alpha(coord_color2, + menu_display_set_alpha(coord_white, 1.00f > xmb->alpha ? xmb->alpha : 1.00f); - if (settings->menu.timedate_enable && coord_color2[3] != 0) + if (settings->menu.timedate_enable && coord_white[3] != 0) xmb_draw_icon( xmb->icon.size, &mymat, @@ -2045,7 +2045,7 @@ static void xmb_frame(void *data) 1, 0, 1, - &coord_color2[0]); + &coord_white[0]); if (settings->menu.timedate_enable) { @@ -2065,10 +2065,10 @@ static void xmb_frame(void *data) } /* Arrow image */ - menu_display_set_alpha(coord_color2, + menu_display_set_alpha(coord_white, xmb->textures.arrow.alpha > xmb->alpha ? xmb->alpha : xmb->textures.arrow.alpha); - if (coord_color2[3] != 0) + if (coord_white[3] != 0) xmb_draw_icon( xmb->icon.size, &mymat, @@ -2082,7 +2082,7 @@ static void xmb_frame(void *data) height, xmb->textures.arrow.alpha, 0, - 1, &coord_color2[0]); + 1, &coord_white[0]); menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL); @@ -2195,10 +2195,10 @@ static void xmb_frame(void *data) } /* Cursor image */ - menu_display_set_alpha(coord_color2, + menu_display_set_alpha(coord_white, 1.00f > xmb->alpha ? xmb->alpha : 1.00f); menu_display_draw_cursor( - &coord_color2[0], + &coord_white[0], xmb->cursor.size, xmb->textures.list[XMB_TEXTURE_POINTER], menu_input_mouse_state(MENU_MOUSE_X_AXIS), From d76cca7a4788c7a6506bde47550079c6baa69739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 22 Apr 2016 17:14:34 +0700 Subject: [PATCH 2/4] (XMB) Use MENU_DISPLAY_CTL_LIBRETRO_RUNNING --- menu/drivers/xmb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 36f8036ef9..45259afd62 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1893,10 +1893,7 @@ static void xmb_draw_bg( draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; if ( - (settings->menu.pause_libretro - || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) - || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) - ) + !menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) && !draw.force_transparency && draw.texture) draw.color = &coord_white[0]; From a06ebe33e49ecfe58e6420b6946bd073f6d782fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 22 Apr 2016 17:21:52 +0700 Subject: [PATCH 3/4] (Menu) Remove useless variables --- menu/drivers/materialui.c | 8 ++------ menu/drivers/xmb.c | 6 +----- menu/drivers/zarch.c | 4 +--- menu/menu_display.h | 2 -- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 09a8241b4b..dc6089384c 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -807,8 +807,6 @@ static void mui_frame(void *data) draw.width = width; draw.height = height; draw.texture = menu_display_white_texture; - draw.handle_alpha = 0.75f; - draw.force_transparency = false; draw.color = &white_transp_bg[0]; draw.vertex = NULL; draw.tex_coord = NULL; @@ -820,7 +818,7 @@ static void mui_frame(void *data) || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) ) - && !draw.force_transparency && draw.texture) + && draw.texture) draw.color = &white_bg[0]; mui_draw_bg(&draw); @@ -847,8 +845,6 @@ static void mui_frame(void *data) draw.width = width; draw.height = height; draw.texture = mui->textures.bg; - draw.handle_alpha = 0.75f; - draw.force_transparency = true; draw.color = &white_transp_bg[0]; draw.vertex = NULL; draw.tex_coord = NULL; @@ -860,7 +856,7 @@ static void mui_frame(void *data) || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) ) - && !draw.force_transparency && draw.texture) + && draw.texture) draw.color = &white_bg[0]; mui_draw_bg(&draw); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 45259afd62..d1a9b7bfee 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1873,7 +1873,6 @@ static void xmb_draw_bg( unsigned width, unsigned height, float alpha, - bool force_transparency, uintptr_t texture_id, float *coord_black, float *coord_white) @@ -1885,8 +1884,6 @@ static void xmb_draw_bg( draw.width = width; draw.height = height; draw.color = &coord_black[0]; - draw.handle_alpha = alpha; - draw.force_transparency = force_transparency; draw.vertex = NULL; draw.tex_coord = NULL; draw.vertex_count = 4; @@ -1894,7 +1891,7 @@ static void xmb_draw_bg( if ( !menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) - && !draw.force_transparency && draw.texture) + && draw.texture) draw.color = &coord_white[0]; @@ -1999,7 +1996,6 @@ static void xmb_frame(void *data) width, height, xmb->alpha, - false, xmb->textures.bg, coord_black, coord_white); diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 5791af6708..7d3f9ac89d 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -965,8 +965,6 @@ static void zarch_frame(void *data) draw.width = zui->width; draw.height = zui->height; draw.texture = zui->textures.bg; - draw.handle_alpha = 0.75f; - draw.force_transparency = false; draw.color = &coord_color[0]; draw.vertex = NULL; draw.tex_coord = coord_draw.ptr; @@ -978,7 +976,7 @@ static void zarch_frame(void *data) || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) ) - && !draw.force_transparency && draw.texture) + && draw.texture) draw.color = &coord_color2[0]; menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL); diff --git a/menu/menu_display.h b/menu/menu_display.h index ffd0f8f330..9cb3a79e2e 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -117,8 +117,6 @@ typedef struct menu_display_ctx_draw void *matrix_data; uintptr_t texture; enum menu_display_prim_type prim_type; - float handle_alpha; - bool force_transparency; float *color; const float *vertex; const float *tex_coord; From c7f8df9327f4c94332d7ddecf27529488c3016a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 22 Apr 2016 17:25:02 +0700 Subject: [PATCH 4/4] (Menu) Use MENU_DISPLAY_CTL_LIBRETRO_RUNNING in all menu drivers --- menu/drivers/materialui.c | 12 ++---------- menu/drivers/xmb.c | 6 ++---- menu/drivers/zarch.c | 8 ++------ 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index dc6089384c..1e94b0ad85 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -813,11 +813,7 @@ static void mui_frame(void *data) draw.vertex_count = 4; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; - if ( - (settings->menu.pause_libretro - || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) - || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) - ) + if (!menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) && draw.texture) draw.color = &white_bg[0]; @@ -851,11 +847,7 @@ static void mui_frame(void *data) draw.vertex_count = 4; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; - if ( - (settings->menu.pause_libretro - || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) - || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) - ) + if (!menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) && draw.texture) draw.color = &white_bg[0]; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index d1a9b7bfee..b65f505751 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1889,12 +1889,10 @@ static void xmb_draw_bg( draw.vertex_count = 4; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; - if ( - !menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) - && draw.texture) + if (!menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) + && draw.texture) draw.color = &coord_white[0]; - menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL); menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL); diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 7d3f9ac89d..54c7c2c0f4 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -971,12 +971,8 @@ static void zarch_frame(void *data) draw.vertex_count = 4; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; - if ( - (settings->menu.pause_libretro - || !rarch_ctl(RARCH_CTL_IS_INITED, NULL) - || rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) - ) - && draw.texture) + if (!menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL) + && draw.texture) draw.color = &coord_color2[0]; menu_display_ctl(MENU_DISPLAY_CTL_BLEND_BEGIN, NULL);