mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
Merge pull request #4595 from libretro/revert-4592-fix/robloach/battery-clock-scale
Revert "Allow normal Battery/Clock icon sizes [WIP]"
This commit is contained in:
commit
bd8ecd9dfd
@ -549,8 +549,7 @@ static void xmb_draw_icon(
|
||||
float rotation,
|
||||
float scale_factor,
|
||||
float *color,
|
||||
float shadow_offset,
|
||||
float icon_scale)
|
||||
float shadow_offset)
|
||||
{
|
||||
menu_display_ctx_draw_t draw;
|
||||
struct video_coords coords;
|
||||
@ -576,9 +575,6 @@ static void xmb_draw_icon(
|
||||
draw.width *= scale_factor;
|
||||
draw.height *= scale_factor;
|
||||
#endif
|
||||
// Allow the icon to be scaled outside of the scale factor.
|
||||
draw.width *= icon_scale;
|
||||
draw.height *= icon_scale;
|
||||
draw.coords = &coords;
|
||||
draw.matrix_data = mymat;
|
||||
draw.texture = texture;
|
||||
@ -2333,8 +2329,7 @@ static void xmb_draw_items(
|
||||
rotation,
|
||||
scale_factor,
|
||||
&color[0],
|
||||
xmb->shadow_offset,
|
||||
1.0);
|
||||
xmb->shadow_offset);
|
||||
}
|
||||
|
||||
menu_display_set_alpha(color, MIN(node->alpha, xmb->alpha));
|
||||
@ -2354,8 +2349,7 @@ static void xmb_draw_items(
|
||||
0,
|
||||
1,
|
||||
&color[0],
|
||||
xmb->shadow_offset,
|
||||
1.0);
|
||||
xmb->shadow_offset);
|
||||
}
|
||||
|
||||
menu_display_blend_end();
|
||||
@ -2680,6 +2674,9 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
if (percent > 0)
|
||||
{
|
||||
size_t x_pos = xmb->icon.size / 6;
|
||||
size_t x_pos_icon = xmb->margins.title.left;
|
||||
|
||||
if (coord_white[3] != 0)
|
||||
xmb_draw_icon(
|
||||
menu_disp_info,
|
||||
@ -2687,23 +2684,22 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
&mymat,
|
||||
xmb->textures.list[charging
|
||||
? XMB_TEXTURE_BATTERY_CHARGING : XMB_TEXTURE_BATTERY_FULL],
|
||||
width - xmb->margins.title.left - (xmb->icon.size / 2),
|
||||
xmb->icon.size - (xmb->icon.size / 3),
|
||||
width - (xmb->icon.size / 2) - x_pos_icon,
|
||||
xmb->icon.size,
|
||||
width,
|
||||
height,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
&coord_white[0],
|
||||
xmb->shadow_offset,
|
||||
0.5);
|
||||
xmb->shadow_offset);
|
||||
|
||||
snprintf(msg, sizeof(msg), "%d%%", percent);
|
||||
|
||||
percent_width = font_driver_get_message_width(xmb->font, msg, utf8len(msg), 1);
|
||||
|
||||
xmb_draw_text(menu_disp_info, xmb, msg,
|
||||
width - xmb->margins.title.left - (xmb->icon.size / 2),
|
||||
width - xmb->margins.title.left - x_pos,
|
||||
xmb->margins.title.top, 1, 1, TEXT_ALIGN_RIGHT,
|
||||
width, height, xmb->font);
|
||||
}
|
||||
@ -2715,27 +2711,26 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
char timedate[255];
|
||||
int x_pos = 0;
|
||||
|
||||
// Move the timedate widget over if the battery percent is active.
|
||||
if (percent_width)
|
||||
x_pos = percent_width + xmb->icon.size;
|
||||
|
||||
if (coord_white[3] != 0)
|
||||
{
|
||||
int x_pos = 0;
|
||||
|
||||
if (percent_width)
|
||||
x_pos = percent_width + (xmb->icon.size / 2.5);
|
||||
|
||||
xmb_draw_icon(
|
||||
menu_disp_info,
|
||||
xmb->icon.size,
|
||||
&mymat,
|
||||
xmb->textures.list[XMB_TEXTURE_CLOCK],
|
||||
width - xmb->margins.title.left - (xmb->icon.size / 2.5) - x_pos,
|
||||
xmb->icon.size - (xmb->icon.size / 3),
|
||||
width,
|
||||
width - xmb->icon.size - x_pos,
|
||||
xmb->icon.size,width,
|
||||
height,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
&coord_white[0],
|
||||
xmb->shadow_offset,
|
||||
0.5);
|
||||
xmb->shadow_offset);
|
||||
}
|
||||
|
||||
timedate[0] = '\0';
|
||||
@ -2746,8 +2741,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
menu_display_timedate(&datetime);
|
||||
|
||||
if (percent_width)
|
||||
x_pos = percent_width + (xmb->icon.size / 2.5);
|
||||
|
||||
xmb_draw_text(menu_disp_info, xmb, timedate,
|
||||
width - xmb->margins.title.left - (xmb->icon.size / 2) - x_pos,
|
||||
width - xmb->margins.title.left - xmb->icon.size / 4 - x_pos,
|
||||
xmb->margins.title.top, 1, 1, TEXT_ALIGN_RIGHT,
|
||||
width, height, xmb->font);
|
||||
}
|
||||
@ -2772,8 +2770,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
0,
|
||||
1,
|
||||
&coord_white[0],
|
||||
xmb->shadow_offset,
|
||||
1.0);
|
||||
xmb->shadow_offset);
|
||||
|
||||
menu_display_blend_begin();
|
||||
|
||||
@ -2822,8 +2819,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
rotation,
|
||||
scale_factor,
|
||||
&item_color[0],
|
||||
xmb->shadow_offset,
|
||||
1.0);
|
||||
xmb->shadow_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user