(XMB) Cleanups pt. 2
This commit is contained in:
parent
e8d21942b4
commit
5eccada700
|
@ -228,7 +228,10 @@ static void xmb_draw_icon(xmb_handle_t *xmb,
|
||||||
{
|
{
|
||||||
struct gl_coords coords;
|
struct gl_coords coords;
|
||||||
math_matrix_4x4 mymat, mrot, mscal;
|
math_matrix_4x4 mymat, mrot, mscal;
|
||||||
gl_t *gl;
|
gl_t *gl = (gl_t*)video_driver_resolve(NULL);
|
||||||
|
|
||||||
|
if (!gl)
|
||||||
|
return;
|
||||||
|
|
||||||
if (alpha > xmb->alpha)
|
if (alpha > xmb->alpha)
|
||||||
alpha = xmb->alpha;
|
alpha = xmb->alpha;
|
||||||
|
@ -236,10 +239,6 @@ static void xmb_draw_icon(xmb_handle_t *xmb,
|
||||||
if (alpha == 0)
|
if (alpha == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl = (gl_t*)video_driver_resolve(NULL);
|
|
||||||
|
|
||||||
if (!gl)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
x < -xmb->icon_size/2 ||
|
x < -xmb->icon_size/2 ||
|
||||||
|
@ -282,15 +281,14 @@ static void xmb_draw_icon(xmb_handle_t *xmb,
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_draw_text(const char *str, float x,
|
static void xmb_draw_text(xmb_handle_t *xmb, const char *str, float x,
|
||||||
float y, float scale_factor, float alpha, bool align_right)
|
float y, float scale_factor, float alpha, bool align_right)
|
||||||
{
|
{
|
||||||
gl_t *gl = NULL;
|
|
||||||
uint8_t a8 = 0;
|
uint8_t a8 = 0;
|
||||||
struct font_params params = {0};
|
struct font_params params = {0};
|
||||||
xmb_handle_t *xmb = (xmb_handle_t*)driver.menu->userdata;
|
gl_t *gl = (gl_t*)video_driver_resolve(NULL);
|
||||||
|
|
||||||
if (!xmb)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (alpha > xmb->alpha)
|
if (alpha > xmb->alpha)
|
||||||
|
@ -301,11 +299,6 @@ static void xmb_draw_text(const char *str, float x,
|
||||||
if (a8 == 0)
|
if (a8 == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl = (gl_t*)video_driver_resolve(NULL);
|
|
||||||
|
|
||||||
if (!gl)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (x < -xmb->icon_size || x > gl->win_width + xmb->icon_size
|
if (x < -xmb->icon_size || x > gl->win_width + xmb->icon_size
|
||||||
|| y < -xmb->icon_size || y > gl->win_height + xmb->icon_size)
|
|| y < -xmb->icon_size || y > gl->win_height + xmb->icon_size)
|
||||||
return;
|
return;
|
||||||
|
@ -448,7 +441,7 @@ static void xmb_render_messagebox(const char *message)
|
||||||
const char *msg = list->elems[i].data;
|
const char *msg = list->elems[i].data;
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
xmb_draw_text(msg, x, y + i * xmb->font_size, 1, 1, 0);
|
xmb_draw_text(xmb, msg, x, y + i * xmb->font_size, 1, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
string_list_free(list);
|
string_list_free(list);
|
||||||
|
@ -940,7 +933,7 @@ static void xmb_draw_items(xmb_handle_t *xmb,
|
||||||
menu_ticker_line(name, 35, g_extern.frame_count / 20, path_buf,
|
menu_ticker_line(name, 35, g_extern.frame_count / 20, path_buf,
|
||||||
(i == current));
|
(i == current));
|
||||||
|
|
||||||
xmb_draw_text(name,
|
xmb_draw_text(xmb, name,
|
||||||
node->x + xmb->margin_left + xmb->hspacing + xmb->label_margin_left,
|
node->x + xmb->margin_left + xmb->hspacing + xmb->label_margin_left,
|
||||||
xmb->margin_top + node->y + xmb->label_margin_top,
|
xmb->margin_top + node->y + xmb->label_margin_top,
|
||||||
1, node->label_alpha, 0);
|
1, node->label_alpha, 0);
|
||||||
|
@ -961,7 +954,7 @@ static void xmb_draw_items(xmb_handle_t *xmb,
|
||||||
&& !xmb->textures[XMB_TEXTURE_SWITCH_ON].id)
|
&& !xmb->textures[XMB_TEXTURE_SWITCH_ON].id)
|
||||||
|| (!strcmp(type_str, "OFF")
|
|| (!strcmp(type_str, "OFF")
|
||||||
&& !xmb->textures[XMB_TEXTURE_SWITCH_OFF].id)))
|
&& !xmb->textures[XMB_TEXTURE_SWITCH_OFF].id)))
|
||||||
xmb_draw_text(value,
|
xmb_draw_text(xmb, value,
|
||||||
node->x + xmb->margin_left + xmb->hspacing +
|
node->x + xmb->margin_left + xmb->hspacing +
|
||||||
xmb->label_margin_left + xmb->setting_margin_left,
|
xmb->label_margin_left + xmb->setting_margin_left,
|
||||||
xmb->margin_top + node->y + xmb->label_margin_top,
|
xmb->margin_top + node->y + xmb->label_margin_top,
|
||||||
|
@ -1015,14 +1008,14 @@ static void xmb_frame(void)
|
||||||
if (!core_name)
|
if (!core_name)
|
||||||
core_name = "No Core";
|
core_name = "No Core";
|
||||||
|
|
||||||
xmb_draw_text(
|
xmb_draw_text(xmb,
|
||||||
xmb->title, xmb->title_margin_left, xmb->title_margin_top, 1, 1, 0);
|
xmb->title, xmb->title_margin_left, xmb->title_margin_top, 1, 1, 0);
|
||||||
|
|
||||||
disp_timedate_set_label(timedate, sizeof(timedate), 0);
|
disp_timedate_set_label(timedate, sizeof(timedate), 0);
|
||||||
|
|
||||||
if (g_settings.menu.timedate_enable)
|
if (g_settings.menu.timedate_enable)
|
||||||
{
|
{
|
||||||
xmb_draw_text(
|
xmb_draw_text(xmb,
|
||||||
timedate, gl->win_width - xmb->title_margin_left - xmb->icon_size/4,
|
timedate, gl->win_width - xmb->title_margin_left - xmb->icon_size/4,
|
||||||
xmb->title_margin_top, 1, 1, 1);
|
xmb->title_margin_top, 1, 1, 1);
|
||||||
|
|
||||||
|
@ -1039,7 +1032,7 @@ static void xmb_frame(void)
|
||||||
|
|
||||||
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION,
|
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION,
|
||||||
core_name, core_version);
|
core_name, core_version);
|
||||||
xmb_draw_text(title_msg, xmb->title_margin_left,
|
xmb_draw_text(xmb, title_msg, xmb->title_margin_left,
|
||||||
gl->win_height - xmb->title_margin_bottom, 1, 1, 0);
|
gl->win_height - xmb->title_margin_bottom, 1, 1, 0);
|
||||||
|
|
||||||
xmb_draw_icon(xmb, xmb->textures[XMB_TEXTURE_ARROW].id,
|
xmb_draw_icon(xmb, xmb->textures[XMB_TEXTURE_ARROW].id,
|
||||||
|
|
Loading…
Reference in New Issue