mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-03 10:13:11 +00:00
Move spacing to 'icon'
This commit is contained in:
parent
7daf9fae03
commit
025cb112d3
@ -99,11 +99,6 @@ typedef struct xmb_handle
|
||||
float left;
|
||||
float top;
|
||||
|
||||
struct
|
||||
{
|
||||
float horizontal;
|
||||
float vertical;
|
||||
} spacing;
|
||||
} screen;
|
||||
|
||||
struct
|
||||
@ -150,6 +145,12 @@ typedef struct xmb_handle
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
float horizontal;
|
||||
float vertical;
|
||||
} spacing;
|
||||
|
||||
char dir[4];
|
||||
int size;
|
||||
} icon;
|
||||
@ -217,7 +218,7 @@ static const GLfloat rmb_tex_coord[] = {
|
||||
|
||||
static float xmb_item_y(xmb_handle_t *xmb, int i, size_t current)
|
||||
{
|
||||
float iy = xmb->margins.screen.spacing.vertical;
|
||||
float iy = xmb->icon.spacing.vertical;
|
||||
|
||||
if (i < current)
|
||||
if (xmb->depth > 1)
|
||||
@ -228,7 +229,7 @@ static float xmb_item_y(xmb_handle_t *xmb, int i, size_t current)
|
||||
iy *= (i - (int)current + xmb->under_offset.item);
|
||||
|
||||
if (i == current)
|
||||
iy = xmb->margins.screen.spacing.vertical * xmb->item.active.factor;
|
||||
iy = xmb->icon.spacing.vertical * xmb->item.active.factor;
|
||||
|
||||
return iy;
|
||||
}
|
||||
@ -673,7 +674,7 @@ static void xmb_list_switch_old(menu_handle_t *menu, xmb_handle_t *xmb, file_lis
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
xmb_push_animations(menu, node, ia, -xmb->margins.screen.spacing.horizontal * dir);
|
||||
xmb_push_animations(menu, node, ia, -xmb->icon.spacing.horizontal * dir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -691,7 +692,7 @@ static void xmb_list_switch_new(menu_handle_t *menu, xmb_handle_t *xmb, file_lis
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
node->x = xmb->margins.screen.spacing.horizontal * dir;
|
||||
node->x = xmb->icon.spacing.horizontal * dir;
|
||||
node->alpha = 0;
|
||||
node->label_alpha = 0;
|
||||
|
||||
@ -758,7 +759,7 @@ static void xmb_list_open(menu_handle_t *menu, xmb_handle_t *xmb)
|
||||
}
|
||||
|
||||
menu_animation_push(menu->animation, XMB_DELAY,
|
||||
xmb->margins.screen.spacing.horizontal * -(float)menu->categories.selection_ptr,
|
||||
xmb->icon.spacing.horizontal * -(float)menu->categories.selection_ptr,
|
||||
&xmb->categories.x_pos, EASING_IN_OUT_QUAD, NULL);
|
||||
|
||||
dir = -1;
|
||||
@ -881,7 +882,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
icon_x = node->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal - xmb->icon.size / 2.0;
|
||||
icon_x = node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal - xmb->icon.size / 2.0;
|
||||
icon_y = xmb->margins.screen.top + node->y + xmb->icon.size / 2.0;
|
||||
|
||||
if (
|
||||
@ -967,7 +968,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
(i == current));
|
||||
|
||||
xmb_draw_text(gl, xmb, name,
|
||||
node->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal + xmb->margins.label.left,
|
||||
node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal + xmb->margins.label.left,
|
||||
xmb->margins.screen.top + node->y + xmb->margins.label.top,
|
||||
1, node->label_alpha, 0);
|
||||
|
||||
@ -988,7 +989,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
|| (!strcmp(type_str, "OFF")
|
||||
&& !xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id)))
|
||||
xmb_draw_text(gl, xmb, value,
|
||||
node->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal +
|
||||
node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal +
|
||||
xmb->margins.label.left + xmb->margins.setting.left,
|
||||
xmb->margins.screen.top + node->y + xmb->margins.label.top,
|
||||
1,
|
||||
@ -997,7 +998,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
|
||||
if (!strcmp(type_str, "ON") && xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id)
|
||||
xmb_draw_icon(gl, xmb, xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id,
|
||||
node->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal
|
||||
node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal
|
||||
+ xmb->icon.size / 2.0 + xmb->margins.setting.left,
|
||||
xmb->margins.screen.top + node->y + xmb->icon.size / 2.0,
|
||||
node->alpha,
|
||||
@ -1006,7 +1007,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||
|
||||
if (!strcmp(type_str, "OFF") && xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id)
|
||||
xmb_draw_icon(gl, xmb, xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id,
|
||||
node->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal
|
||||
node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal
|
||||
+ xmb->icon.size / 2.0 + xmb->margins.setting.left,
|
||||
xmb->margins.screen.top + node->y + xmb->icon.size / 2.0,
|
||||
node->alpha,
|
||||
@ -1072,8 +1073,8 @@ static void xmb_frame(menu_handle_t *menu)
|
||||
}
|
||||
|
||||
xmb_draw_icon(gl, xmb, xmb->textures.list[XMB_TEXTURE_ARROW].id,
|
||||
xmb->x + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal - xmb->icon.size / 2.0 + xmb->icon.size,
|
||||
xmb->margins.screen.top + xmb->icon.size / 2.0 + xmb->margins.screen.spacing.vertical * xmb->item.active.factor,
|
||||
xmb->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal - xmb->icon.size / 2.0 + xmb->icon.size,
|
||||
xmb->margins.screen.top + xmb->icon.size / 2.0 + xmb->icon.spacing.vertical * xmb->item.active.factor,
|
||||
xmb->textures.arrow.alpha, 0, 1);
|
||||
|
||||
depth = file_list_get_size(menu->menu_list->menu_stack);
|
||||
@ -1097,7 +1098,7 @@ static void xmb_frame(menu_handle_t *menu)
|
||||
|
||||
if (node)
|
||||
xmb_draw_icon(gl, xmb, node->icon,
|
||||
xmb->x + xmb->categories.x_pos + xmb->margins.screen.left + xmb->margins.screen.spacing.horizontal * (i + 1) - xmb->icon.size / 2.0,
|
||||
xmb->x + xmb->categories.x_pos + xmb->margins.screen.left + xmb->icon.spacing.horizontal * (i + 1) - xmb->icon.size / 2.0,
|
||||
xmb->margins.screen.top + xmb->icon.size / 2.0,
|
||||
node->alpha,
|
||||
0,
|
||||
@ -1177,58 +1178,58 @@ static void *xmb_init(void)
|
||||
if (!xmb->selection_buf_old)
|
||||
goto error;
|
||||
|
||||
xmb->categories.active.idx = 0;
|
||||
xmb->categories.active.idx = 0;
|
||||
xmb->categories.active.idx_old = 0;
|
||||
xmb->x = 0;
|
||||
xmb->categories.x_pos = 0;
|
||||
xmb->textures.arrow.alpha = 0;
|
||||
xmb->depth = 1;
|
||||
xmb->old_depth = 1;
|
||||
xmb->alpha = 0;
|
||||
xmb->prevent_populate = false;
|
||||
xmb->x = 0;
|
||||
xmb->categories.x_pos = 0;
|
||||
xmb->textures.arrow.alpha = 0;
|
||||
xmb->depth = 1;
|
||||
xmb->old_depth = 1;
|
||||
xmb->alpha = 0;
|
||||
xmb->prevent_populate = false;
|
||||
|
||||
xmb->categories.active.zoom = 1.0;
|
||||
xmb->categories.passive.zoom = 0.5;
|
||||
xmb->item.active.zoom = 1.0;
|
||||
xmb->item.passive.zoom = 0.5;
|
||||
xmb->item.active.zoom = 1.0;
|
||||
xmb->item.passive.zoom = 0.5;
|
||||
|
||||
xmb->categories.active.alpha = 1.0;
|
||||
xmb->categories.passive.alpha= 0.5;
|
||||
xmb->item.active.alpha = 1.0;
|
||||
xmb->item.passive.alpha = 0.5;
|
||||
xmb->item.active.alpha = 1.0;
|
||||
xmb->item.passive.alpha = 0.5;
|
||||
|
||||
xmb->above_offset.subitem = 1.5;
|
||||
xmb->above_offset.item = -1.0;
|
||||
xmb->item.active.factor = 3.0;
|
||||
xmb->under_offset.item = 5.0;
|
||||
xmb->above_offset.subitem = 1.5;
|
||||
xmb->above_offset.item = -1.0;
|
||||
xmb->item.active.factor = 3.0;
|
||||
xmb->under_offset.item = 5.0;
|
||||
|
||||
if (gl->win_width >= 3840)
|
||||
scale_factor = 2.0;
|
||||
scale_factor = 2.0;
|
||||
else if (gl->win_width >= 2560)
|
||||
scale_factor = 1.5;
|
||||
scale_factor = 1.5;
|
||||
else if (gl->win_width >= 1920)
|
||||
scale_factor = 1.0;
|
||||
scale_factor = 1.0;
|
||||
else if (gl->win_width >= 1280)
|
||||
scale_factor = 0.75;
|
||||
scale_factor = 0.75;
|
||||
else if (gl->win_width >= 640)
|
||||
scale_factor = 0.5;
|
||||
scale_factor = 0.5;
|
||||
else if (gl->win_width >= 320)
|
||||
scale_factor = 0.25;
|
||||
scale_factor = 0.25;
|
||||
|
||||
strlcpy(xmb->icon.dir, "256", sizeof(xmb->icon.dir));
|
||||
|
||||
xmb->icon.size = 128.0 * scale_factor;
|
||||
xmb->font.size = 32.0 * scale_factor;
|
||||
xmb->margins.screen.spacing.horizontal = 200.0 * scale_factor;
|
||||
xmb->margins.screen.spacing.vertical = 64.0 * scale_factor;
|
||||
xmb->margins.screen.left = 336.0 * scale_factor;
|
||||
xmb->margins.screen.top = (256+32) * scale_factor;
|
||||
xmb->margins.title.left = 60 * scale_factor;
|
||||
xmb->margins.title.top = 60 * scale_factor + xmb->font.size/3;
|
||||
xmb->margins.title.bottom = 60 * scale_factor - xmb->font.size/3;
|
||||
xmb->margins.label.left = 85.0 * scale_factor;
|
||||
xmb->margins.label.top = xmb->font.size/3.0;
|
||||
xmb->margins.setting.left = 600.0 * scale_factor;
|
||||
xmb->icon.size = 128.0 * scale_factor;
|
||||
xmb->font.size = 32.0 * scale_factor;
|
||||
xmb->icon.spacing.horizontal = 200.0 * scale_factor;
|
||||
xmb->icon.spacing.vertical = 64.0 * scale_factor;
|
||||
xmb->margins.screen.left = 336.0 * scale_factor;
|
||||
xmb->margins.screen.top = (256+32) * scale_factor;
|
||||
xmb->margins.title.left = 60 * scale_factor;
|
||||
xmb->margins.title.top = 60 * scale_factor + xmb->font.size/3;
|
||||
xmb->margins.title.bottom = 60 * scale_factor - xmb->font.size/3;
|
||||
xmb->margins.label.left = 85.0 * scale_factor;
|
||||
xmb->margins.label.top = xmb->font.size/3.0;
|
||||
xmb->margins.setting.left = 600.0 * scale_factor;
|
||||
|
||||
menu->categories.size = 1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user