mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(Lakka) Move more variables over
This commit is contained in:
parent
dd55a65216
commit
75002d26a7
@ -103,14 +103,14 @@ static void lakka_switch_items(lakka_handle_t *lakka)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
iy = (j < active_category->active_item) ? vspacing *
|
iy = (j < active_category->active_item) ? vspacing *
|
||||||
(j - active_category->active_item + above_item_offset) :
|
(j - active_category->active_item + lakka->above_item_offset) :
|
||||||
vspacing * (j - active_category->active_item + under_item_offset);
|
vspacing * (j - active_category->active_item + lakka->under_item_offset);
|
||||||
|
|
||||||
if (j == active_category->active_item)
|
if (j == active_category->active_item)
|
||||||
{
|
{
|
||||||
ia = lakka->i_active_alpha;
|
ia = lakka->i_active_alpha;
|
||||||
iz = lakka->i_active_zoom;
|
iz = lakka->i_active_zoom;
|
||||||
iy = vspacing * active_item_factor;
|
iy = vspacing * lakka->active_item_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_tween(LAKKA_DELAY, ia, &active_item->alpha, &inOutQuad, NULL);
|
add_tween(LAKKA_DELAY, ia, &active_item->alpha, &inOutQuad, NULL);
|
||||||
@ -140,7 +140,7 @@ static void lakka_switch_subitems(lakka_handle_t *lakka)
|
|||||||
add_tween(LAKKA_DELAY, lakka->i_passive_alpha,
|
add_tween(LAKKA_DELAY, lakka->i_passive_alpha,
|
||||||
&subitem->alpha, &inOutQuad, NULL);
|
&subitem->alpha, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, vspacing * (k - item->active_subitem +
|
add_tween(LAKKA_DELAY, vspacing * (k - item->active_subitem +
|
||||||
above_subitem_offset), &subitem->y, &inOutQuad, NULL);
|
lakka->above_subitem_offset), &subitem->y, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, lakka->i_passive_zoom,
|
add_tween(LAKKA_DELAY, lakka->i_passive_zoom,
|
||||||
&subitem->zoom, &inOutQuad, NULL);
|
&subitem->zoom, &inOutQuad, NULL);
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ static void lakka_switch_subitems(lakka_handle_t *lakka)
|
|||||||
/* Active item */
|
/* Active item */
|
||||||
add_tween(LAKKA_DELAY, lakka->i_active_alpha,
|
add_tween(LAKKA_DELAY, lakka->i_active_alpha,
|
||||||
&subitem->alpha, &inOutQuad, NULL);
|
&subitem->alpha, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, vspacing * active_item_factor,
|
add_tween(LAKKA_DELAY, vspacing * lakka->active_item_factor,
|
||||||
&subitem->y, &inOutQuad, NULL);
|
&subitem->y, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, lakka->i_active_zoom,
|
add_tween(LAKKA_DELAY, lakka->i_active_zoom,
|
||||||
&subitem->zoom, &inOutQuad, NULL);
|
&subitem->zoom, &inOutQuad, NULL);
|
||||||
@ -160,7 +160,7 @@ static void lakka_switch_subitems(lakka_handle_t *lakka)
|
|||||||
add_tween(LAKKA_DELAY, lakka->i_passive_alpha,
|
add_tween(LAKKA_DELAY, lakka->i_passive_alpha,
|
||||||
&subitem->alpha, &inOutQuad, NULL);
|
&subitem->alpha, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, vspacing * (k - item->active_subitem +
|
add_tween(LAKKA_DELAY, vspacing * (k - item->active_subitem +
|
||||||
under_item_offset), &subitem->y, &inOutQuad, NULL);
|
lakka->under_item_offset), &subitem->y, &inOutQuad, NULL);
|
||||||
add_tween(LAKKA_DELAY, lakka->i_passive_zoom,
|
add_tween(LAKKA_DELAY, lakka->i_passive_zoom,
|
||||||
&subitem->zoom, &inOutQuad, NULL);
|
&subitem->zoom, &inOutQuad, NULL);
|
||||||
}
|
}
|
||||||
@ -189,8 +189,8 @@ static void lakka_reset_submenu(lakka_handle_t *lakka, int i, int j)
|
|||||||
subitem->zoom = (k == category->items[j].active_subitem) ?
|
subitem->zoom = (k == category->items[j].active_subitem) ?
|
||||||
lakka->i_active_zoom : lakka->i_passive_zoom;
|
lakka->i_active_zoom : lakka->i_passive_zoom;
|
||||||
subitem->y = k == 0 ?
|
subitem->y = k == 0 ?
|
||||||
vspacing * active_item_factor :
|
vspacing * lakka->active_item_factor :
|
||||||
vspacing * (k + under_item_offset);
|
vspacing * (k + lakka->under_item_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,10 +57,6 @@ float vspacing;
|
|||||||
float lakka_font_size;
|
float lakka_font_size;
|
||||||
int icon_size;
|
int icon_size;
|
||||||
char icon_dir[4];
|
char icon_dir[4];
|
||||||
float above_subitem_offset;
|
|
||||||
float above_item_offset;
|
|
||||||
float active_item_factor;
|
|
||||||
float under_item_offset;
|
|
||||||
|
|
||||||
GLuint fbo, fbocolor, fbodepth = 0;
|
GLuint fbo, fbocolor, fbodepth = 0;
|
||||||
|
|
||||||
@ -267,7 +263,7 @@ static void lakka_draw_arrow(lakka_handle_t *lakka)
|
|||||||
lakka_draw_icon(lakka->textures[TEXTURE_ARROW].id,
|
lakka_draw_icon(lakka->textures[TEXTURE_ARROW].id,
|
||||||
lakka->margin_left + hspacing*(menu_active_category+1) +
|
lakka->margin_left + hspacing*(menu_active_category+1) +
|
||||||
all_categories_x + icon_size/2.0,
|
all_categories_x + icon_size/2.0,
|
||||||
lakka->margin_top + vspacing*active_item_factor +
|
lakka->margin_top + vspacing * lakka->active_item_factor +
|
||||||
icon_size/2.0, arrow_alpha, 0, lakka->i_active_zoom);
|
icon_size/2.0, arrow_alpha, 0, lakka->i_active_zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,7 +734,8 @@ static bool lakka_init_settings(menu_handle_t *menu)
|
|||||||
item->alpha = jj ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
item->alpha = jj ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
||||||
item->zoom = jj ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
item->zoom = jj ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
||||||
item->y = jj ?
|
item->y = jj ?
|
||||||
vspacing*(under_item_offset+jj) : vspacing * active_item_factor;
|
vspacing * (lakka->under_item_offset + jj)
|
||||||
|
: vspacing * lakka->active_item_factor;
|
||||||
item->active_subitem = 0;
|
item->active_subitem = 0;
|
||||||
item->num_subitems = 0;
|
item->num_subitems = 0;
|
||||||
item->subitems = NULL;
|
item->subitems = NULL;
|
||||||
@ -764,8 +761,8 @@ static bool lakka_init_settings(menu_handle_t *menu)
|
|||||||
sizeof(subitem->name));
|
sizeof(subitem->name));
|
||||||
subitem->alpha = 0.0;
|
subitem->alpha = 0.0;
|
||||||
subitem->zoom = kk ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
subitem->zoom = kk ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
||||||
subitem->y = kk ? vspacing * (kk + under_item_offset)
|
subitem->y = kk ? vspacing * (kk + lakka->under_item_offset)
|
||||||
: vspacing * active_item_factor;
|
: vspacing * lakka->active_item_factor;
|
||||||
|
|
||||||
subitem->setting = (rarch_setting_t*)&setting_data[k];
|
subitem->setting = (rarch_setting_t*)&setting_data[k];
|
||||||
|
|
||||||
@ -787,8 +784,8 @@ static bool lakka_init_settings(menu_handle_t *menu)
|
|||||||
strlcpy(itemq->name, "Quit RetroArch", sizeof(itemq->name));
|
strlcpy(itemq->name, "Quit RetroArch", sizeof(itemq->name));
|
||||||
itemq->alpha = jj ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
itemq->alpha = jj ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
||||||
itemq->zoom = jj ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
itemq->zoom = jj ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
||||||
itemq->y = jj ? vspacing*(under_item_offset+jj) :
|
itemq->y = jj ? vspacing * (lakka->under_item_offset + jj) :
|
||||||
vspacing * active_item_factor;
|
vspacing * lakka->active_item_factor;
|
||||||
itemq->active_subitem = 0;
|
itemq->active_subitem = 0;
|
||||||
itemq->num_subitems = 0;
|
itemq->num_subitems = 0;
|
||||||
|
|
||||||
@ -986,8 +983,8 @@ static void lakka_init_subitems(lakka_handle_t *lakka, menu_item_t *item)
|
|||||||
}
|
}
|
||||||
subitem->alpha = 0;
|
subitem->alpha = 0;
|
||||||
subitem->zoom = k ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
subitem->zoom = k ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
||||||
subitem->y = k ? vspacing * (k+under_item_offset) :
|
subitem->y = k ? vspacing * (k + lakka->under_item_offset) :
|
||||||
vspacing * active_item_factor;
|
vspacing * lakka->active_item_factor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1009,8 +1006,8 @@ static void lakka_init_item(lakka_handle_t *lakka,
|
|||||||
item->alpha = i != menu_active_category ? 0 :
|
item->alpha = i != menu_active_category ? 0 :
|
||||||
n ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
n ? lakka->i_passive_alpha : lakka->i_active_alpha;
|
||||||
item->zoom = n ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
item->zoom = n ? lakka->i_passive_zoom : lakka->i_active_zoom;
|
||||||
item->y = n ? vspacing*(under_item_offset+n) :
|
item->y = n ? (vspacing * (lakka->under_item_offset + n)) :
|
||||||
vspacing*active_item_factor;
|
(vspacing * lakka->active_item_factor);
|
||||||
item->active_subitem = 0;
|
item->active_subitem = 0;
|
||||||
item->num_subitems = 5;
|
item->num_subitems = 5;
|
||||||
item->subitems = (menu_subitem_t*)
|
item->subitems = (menu_subitem_t*)
|
||||||
@ -1154,10 +1151,10 @@ static void *lakka_init(void)
|
|||||||
lakka->i_active_alpha = 1.0;
|
lakka->i_active_alpha = 1.0;
|
||||||
lakka->i_passive_alpha = 0.5;
|
lakka->i_passive_alpha = 0.5;
|
||||||
|
|
||||||
above_subitem_offset = 1.5;
|
lakka->above_subitem_offset = 1.5;
|
||||||
above_item_offset = -1.0;
|
lakka->above_item_offset = -1.0;
|
||||||
active_item_factor = 2.75;
|
lakka->active_item_factor = 2.75;
|
||||||
under_item_offset = 4.0;
|
lakka->under_item_offset = 4.0;
|
||||||
|
|
||||||
if (gl->win_width >= 3840)
|
if (gl->win_width >= 3840)
|
||||||
{
|
{
|
||||||
|
@ -54,10 +54,6 @@ extern float global_scale;
|
|||||||
extern float arrow_alpha;
|
extern float arrow_alpha;
|
||||||
extern float hspacing;
|
extern float hspacing;
|
||||||
extern float vspacing;
|
extern float vspacing;
|
||||||
extern float above_subitem_offset;
|
|
||||||
extern float above_item_offset;
|
|
||||||
extern float active_item_factor;
|
|
||||||
extern float under_item_offset;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -119,6 +115,10 @@ typedef struct lakka_handle
|
|||||||
float label_margin_left;
|
float label_margin_left;
|
||||||
float label_margin_top;
|
float label_margin_top;
|
||||||
float setting_margin_left;
|
float setting_margin_left;
|
||||||
|
float above_subitem_offset;
|
||||||
|
float above_item_offset;
|
||||||
|
float active_item_factor;
|
||||||
|
float under_item_offset;
|
||||||
menu_category_t *categories;
|
menu_category_t *categories;
|
||||||
struct lakka_texture_item textures[TEXTURE_LAST];
|
struct lakka_texture_item textures[TEXTURE_LAST];
|
||||||
} lakka_handle_t;
|
} lakka_handle_t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user