gfx_widgets_draw_regular_msg - optimization - only set alpha colors

again if alpha hasn't already been applied
This commit is contained in:
twinaphex 2020-10-02 13:33:05 +02:00
parent 2594bd2cf6
commit cd469d3fb2

View File

@ -1277,11 +1277,16 @@ static void gfx_widgets_draw_regular_msg(
unsigned text_color;
uintptr_t icon = p_dispwidget->gfx_widgets_icons_textures[
MENU_WIDGETS_ICON_INFO]; /* TODO: Real icon logic here */
static float last_alpha = 0.0f;
/* Icon */
gfx_display_set_alpha(msg_queue_info, msg->alpha);
gfx_display_set_alpha(gfx_widgets_pure_white, msg->alpha);
gfx_display_set_alpha(msg_queue_background, msg->alpha);
if (last_alpha != msg->alpha)
{
/* Icon */
gfx_display_set_alpha(msg_queue_info, msg->alpha);
gfx_display_set_alpha(gfx_widgets_pure_white, msg->alpha);
gfx_display_set_alpha(msg_queue_background, msg->alpha);
last_alpha = msg->alpha;
}
if (!msg->unfolded || msg->unfolding)
{