mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 20:43:10 +00:00
Cleanups - 80-char limit, C-style comments
This commit is contained in:
parent
9bd3800ca0
commit
d36a4c5257
@ -43,7 +43,7 @@ static const frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
|||||||
&frontend_ctx_psp,
|
&frontend_ctx_psp,
|
||||||
#endif
|
#endif
|
||||||
&frontend_ctx_null,
|
&frontend_ctx_null,
|
||||||
NULL // zero length array is not valid
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
const frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident)
|
const frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident)
|
||||||
|
@ -21,12 +21,14 @@ static void menu_common_shader_manager_init(menu_handle_t *menu)
|
|||||||
const char *config_path = NULL;
|
const char *config_path = NULL;
|
||||||
struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
|
struct gfx_shader *shader = (struct gfx_shader*)menu->shader;
|
||||||
|
|
||||||
if (*g_extern.core_specific_config_path && g_settings.core_specific_config)
|
if (*g_extern.core_specific_config_path
|
||||||
|
&& g_settings.core_specific_config)
|
||||||
config_path = g_extern.core_specific_config_path;
|
config_path = g_extern.core_specific_config_path;
|
||||||
else if (*g_extern.config_path)
|
else if (*g_extern.config_path)
|
||||||
config_path = g_extern.config_path;
|
config_path = g_extern.config_path;
|
||||||
|
|
||||||
// In a multi-config setting, we can't have conflicts on menu.cgp/menu.glslp.
|
/* In a multi-config setting, we can't have
|
||||||
|
* conflicts on menu.cgp/menu.glslp. */
|
||||||
if (config_path)
|
if (config_path)
|
||||||
{
|
{
|
||||||
fill_pathname_base(menu->default_glslp, config_path,
|
fill_pathname_base(menu->default_glslp, config_path,
|
||||||
|
@ -231,10 +231,13 @@ static char *str_replace (const char *string, const char *substr, const char *re
|
|||||||
free (oldstr);
|
free (oldstr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memcpy ( newstr, oldstr, tok - oldstr );
|
memcpy(newstr, oldstr, tok - oldstr );
|
||||||
memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) );
|
memcpy(newstr + (tok - oldstr), replacement, strlen ( replacement ) );
|
||||||
memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) );
|
memcpy(newstr + (tok - oldstr) + strlen( replacement ), tok +
|
||||||
memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 );
|
strlen ( substr ), strlen ( oldstr ) -
|
||||||
|
strlen ( substr ) - ( tok - oldstr ) );
|
||||||
|
memset(newstr + strlen ( oldstr ) - strlen ( substr ) +
|
||||||
|
strlen ( replacement ) , 0, 1 );
|
||||||
/* move back head right after the last replacement */
|
/* move back head right after the last replacement */
|
||||||
head = newstr + (tok - oldstr) + strlen( replacement );
|
head = newstr + (tok - oldstr) + strlen( replacement );
|
||||||
free (oldstr);
|
free (oldstr);
|
||||||
@ -250,7 +253,8 @@ float inOutQuad(float t, float b, float c, float d)
|
|||||||
return -c / 2 * ((t - 1) * (t - 3) - 1) + b;
|
return -c / 2 * ((t - 1) * (t - 3) - 1) + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_tween(float duration, float target_value, float* subject, easingFunc easing, tweenCallback callback)
|
void add_tween(float duration, float target_value, float* subject,
|
||||||
|
easingFunc easing, tweenCallback callback)
|
||||||
{
|
{
|
||||||
tween_t *tween;
|
tween_t *tween;
|
||||||
|
|
||||||
@ -315,14 +319,16 @@ static void update_tweens(float dt)
|
|||||||
for(i = 0; i < numtweens; i++)
|
for(i = 0; i < numtweens; i++)
|
||||||
{
|
{
|
||||||
update_tween(&tweens[i], dt);
|
update_tween(&tweens[i], dt);
|
||||||
active_tweens += tweens[i].running_since < tweens[i].duration ? 1 : 0;
|
active_tweens += tweens[i].running_since <
|
||||||
|
tweens[i].duration ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numtweens && !active_tweens)
|
if (numtweens && !active_tweens)
|
||||||
numtweens = 0;
|
numtweens = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lakka_draw_text(const char *str, float x, float y, float scale, float alpha)
|
static void lakka_draw_text(const char *str, float x,
|
||||||
|
float y, float scale, float alpha)
|
||||||
{
|
{
|
||||||
if (alpha > global_alpha)
|
if (alpha > global_alpha)
|
||||||
alpha = global_alpha;
|
alpha = global_alpha;
|
||||||
@ -333,7 +339,8 @@ static void lakka_draw_text(const char *str, float x, float y, float scale, floa
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (x < -icon_size || x > gl->win_width + icon_size || y < -icon_size || y > gl->win_height + icon_size)
|
if (x < -icon_size || x > gl->win_width + icon_size
|
||||||
|
|| y < -icon_size || y > gl->win_height + icon_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
||||||
@ -383,7 +390,8 @@ void lakka_draw_background(void)
|
|||||||
gl->coords.color = gl->white_color_ptr;
|
gl->coords.color = gl->white_color_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lakka_draw_icon(GLuint texture, float x, float y, float alpha, float rotation, float scale)
|
void lakka_draw_icon(GLuint texture, float x, float y,
|
||||||
|
float alpha, float rotation, float scale)
|
||||||
{
|
{
|
||||||
if (alpha > global_alpha)
|
if (alpha > global_alpha)
|
||||||
alpha = global_alpha;
|
alpha = global_alpha;
|
||||||
@ -396,7 +404,8 @@ void lakka_draw_icon(GLuint texture, float x, float y, float alpha, float rotati
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (x < -icon_size || x > gl->win_width + icon_size || y < -icon_size || y > gl->win_height + icon_size)
|
if (x < -icon_size || x > gl->win_width + icon_size
|
||||||
|
|| y < -icon_size || y > gl->win_height + icon_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GLfloat color[] = {
|
GLfloat color[] = {
|
||||||
@ -444,8 +453,10 @@ static void lakka_draw_subitems(int i, int j)
|
|||||||
int k;
|
int k;
|
||||||
menu_category_t *category = (menu_category_t*)&categories[i];
|
menu_category_t *category = (menu_category_t*)&categories[i];
|
||||||
menu_item_t *item = (menu_item_t*)&category->items[j];
|
menu_item_t *item = (menu_item_t*)&category->items[j];
|
||||||
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
|
menu_category_t *active_category = (menu_category_t*)
|
||||||
menu_item_t *active_item = (menu_item_t*)&active_category->items[active_category->active_item];
|
&categories[menu_active_category];
|
||||||
|
menu_item_t *active_item = (menu_item_t*)
|
||||||
|
&active_category->items[active_category->active_item];
|
||||||
|
|
||||||
for(k = 0; k < item->num_subitems; k++)
|
for(k = 0; k < item->num_subitems; k++)
|
||||||
{
|
{
|
||||||
@ -459,13 +470,15 @@ static void lakka_draw_subitems(int i, int j)
|
|||||||
&& strcmp(g_extern.fullpath, &active_item->rom) == 0)
|
&& strcmp(g_extern.fullpath, &active_item->rom) == 0)
|
||||||
{
|
{
|
||||||
lakka_draw_icon(textures[TEXTURE_RESUME].id,
|
lakka_draw_icon(textures[TEXTURE_RESUME].id,
|
||||||
margin_left + hspacing*(i+2.25) + all_categories_x - icon_size/2.0,
|
margin_left + hspacing*(i+2.25) +
|
||||||
|
all_categories_x - icon_size/2.0,
|
||||||
margin_top + subitem->y + icon_size/2.0,
|
margin_top + subitem->y + icon_size/2.0,
|
||||||
subitem->alpha,
|
subitem->alpha,
|
||||||
0,
|
0,
|
||||||
subitem->zoom);
|
subitem->zoom);
|
||||||
lakka_draw_text("Resume",
|
lakka_draw_text("Resume",
|
||||||
margin_left + hspacing*(i+2.25) + all_categories_x + label_margin_left,
|
margin_left + hspacing*(i+2.25) +
|
||||||
|
all_categories_x + label_margin_left,
|
||||||
margin_top + subitem->y + label_margin_top,
|
margin_top + subitem->y + label_margin_top,
|
||||||
1,
|
1,
|
||||||
subitem->alpha);
|
subitem->alpha);
|
||||||
@ -477,13 +490,15 @@ static void lakka_draw_subitems(int i, int j)
|
|||||||
strcmp(g_extern.fullpath, &active_item->rom) == 0))
|
strcmp(g_extern.fullpath, &active_item->rom) == 0))
|
||||||
{
|
{
|
||||||
lakka_draw_icon(subitem->icon,
|
lakka_draw_icon(subitem->icon,
|
||||||
margin_left + hspacing*(i+2.25) + all_categories_x - icon_size/2.0,
|
margin_left + hspacing*(i+2.25) +
|
||||||
|
all_categories_x - icon_size/2.0,
|
||||||
margin_top + subitem->y + icon_size/2.0,
|
margin_top + subitem->y + icon_size/2.0,
|
||||||
subitem->alpha,
|
subitem->alpha,
|
||||||
0,
|
0,
|
||||||
subitem->zoom);
|
subitem->zoom);
|
||||||
lakka_draw_text(subitem->name,
|
lakka_draw_text(subitem->name,
|
||||||
margin_left + hspacing * (i+2.25) + all_categories_x + label_margin_left,
|
margin_left + hspacing * (i+2.25) +
|
||||||
|
all_categories_x + label_margin_left,
|
||||||
margin_top + subitem->y + label_margin_top,
|
margin_top + subitem->y + label_margin_top,
|
||||||
1,
|
1,
|
||||||
subitem->alpha);
|
subitem->alpha);
|
||||||
@ -496,8 +511,10 @@ static void lakka_draw_items(int i)
|
|||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
menu_category_t *category = (menu_category_t*)&categories[i];
|
menu_category_t *category = (menu_category_t*)&categories[i];
|
||||||
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
|
menu_category_t *active_category = (menu_category_t*)
|
||||||
menu_item_t *active_item = (menu_item_t*)&active_category->items[active_category->active_item];
|
&categories[menu_active_category];
|
||||||
|
menu_item_t *active_item = (menu_item_t*)
|
||||||
|
&active_category->items[active_category->active_item];
|
||||||
|
|
||||||
for(j = 0; j < category->num_items; j++)
|
for(j = 0; j < category->num_items; j++)
|
||||||
{
|
{
|
||||||
@ -507,10 +524,11 @@ static void lakka_draw_items(int i)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i >= menu_active_category - 1 &&
|
if (i >= menu_active_category - 1 &&
|
||||||
i <= menu_active_category + 1) // performance improvement
|
i <= menu_active_category + 1) /* performance improvement */
|
||||||
{
|
{
|
||||||
lakka_draw_icon(category->item_icon,
|
lakka_draw_icon(category->item_icon,
|
||||||
margin_left + hspacing*(i+1) + all_categories_x - icon_size/2.0,
|
margin_left + hspacing*(i+1) +
|
||||||
|
all_categories_x - icon_size/2.0,
|
||||||
margin_top + item->y + icon_size/2.0,
|
margin_top + item->y + icon_size/2.0,
|
||||||
item->alpha,
|
item->alpha,
|
||||||
0,
|
0,
|
||||||
@ -518,13 +536,16 @@ static void lakka_draw_items(int i)
|
|||||||
|
|
||||||
if (depth == 0)
|
if (depth == 0)
|
||||||
lakka_draw_text(item->name,
|
lakka_draw_text(item->name,
|
||||||
margin_left + hspacing * (i+1) + all_categories_x + label_margin_left,
|
margin_left + hspacing * (i+1) +
|
||||||
|
all_categories_x + label_margin_left,
|
||||||
margin_top + item->y + label_margin_top,
|
margin_top + item->y + label_margin_top,
|
||||||
1,
|
1,
|
||||||
item->alpha);
|
item->alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == menu_active_category && j == category->active_item && depth == 1) // performance improvement
|
/* performance improvement */
|
||||||
|
if (i == menu_active_category
|
||||||
|
&& j == category->active_item && depth == 1)
|
||||||
lakka_draw_subitems(i, j);
|
lakka_draw_subitems(i, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,12 +561,13 @@ static void lakka_draw_categories(void)
|
|||||||
if (!category)
|
if (!category)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// draw items
|
/* draw items */
|
||||||
lakka_draw_items(i);
|
lakka_draw_items(i);
|
||||||
|
|
||||||
// draw category icon
|
/* draw category icon */
|
||||||
lakka_draw_icon(category->icon,
|
lakka_draw_icon(category->icon,
|
||||||
margin_left + (hspacing*(i+1)) + all_categories_x - icon_size/2.0,
|
margin_left + (hspacing*(i+1)) +
|
||||||
|
all_categories_x - icon_size/2.0,
|
||||||
margin_top + icon_size/2.0,
|
margin_top + icon_size/2.0,
|
||||||
category->alpha,
|
category->alpha,
|
||||||
0,
|
0,
|
||||||
@ -557,13 +579,15 @@ static void lakka_frame(void)
|
|||||||
{
|
{
|
||||||
struct font_output_list *msg;
|
struct font_output_list *msg;
|
||||||
gl_t *gl = (gl_t*)driver.video_data;
|
gl_t *gl = (gl_t*)driver.video_data;
|
||||||
menu_category_t *active_category = (menu_category_t*)&categories[menu_active_category];
|
menu_category_t *active_category = (menu_category_t*)
|
||||||
|
&categories[menu_active_category];
|
||||||
menu_item_t *active_item;
|
menu_item_t *active_item;
|
||||||
|
|
||||||
if (!driver.menu || !gl || !active_category)
|
if (!driver.menu || !gl || !active_category)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
active_item = (menu_item_t*)&active_category->items[active_category->active_item];
|
active_item = (menu_item_t*)
|
||||||
|
&active_category->items[active_category->active_item];
|
||||||
|
|
||||||
update_tweens(0.002);
|
update_tweens(0.002);
|
||||||
|
|
||||||
@ -574,13 +598,17 @@ static void lakka_frame(void)
|
|||||||
lakka_draw_categories();
|
lakka_draw_categories();
|
||||||
|
|
||||||
if (depth == 0 && active_category)
|
if (depth == 0 && active_category)
|
||||||
lakka_draw_text(active_category->name, title_margin_left, title_margin_top, 1, 1.0);
|
lakka_draw_text(active_category->name,
|
||||||
|
title_margin_left, title_margin_top, 1, 1.0);
|
||||||
else if (active_item)
|
else if (active_item)
|
||||||
lakka_draw_text(active_item->name, title_margin_left, title_margin_top, 1, 1.0);
|
lakka_draw_text(active_item->name,
|
||||||
|
title_margin_left, title_margin_top, 1, 1.0);
|
||||||
|
|
||||||
lakka_draw_icon(textures[TEXTURE_ARROW].id,
|
lakka_draw_icon(textures[TEXTURE_ARROW].id,
|
||||||
margin_left + hspacing*(menu_active_category+1) + all_categories_x + icon_size/2.0,
|
margin_left + hspacing*(menu_active_category+1) +
|
||||||
margin_top + vspacing*active_item_factor + icon_size/2.0, arrow_alpha, 0, i_active_zoom);
|
all_categories_x + icon_size/2.0,
|
||||||
|
margin_top + vspacing*active_item_factor +
|
||||||
|
icon_size/2.0, arrow_alpha, 0, i_active_zoom);
|
||||||
|
|
||||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
|
||||||
}
|
}
|
||||||
@ -590,11 +618,12 @@ static GLuint png_texture_load(const char * file_name)
|
|||||||
struct texture_image ti;
|
struct texture_image ti;
|
||||||
texture_image_load(&ti, file_name);
|
texture_image_load(&ti, file_name);
|
||||||
|
|
||||||
// Generate the OpenGL texture object
|
/* Generate the OpenGL texture object */
|
||||||
GLuint texture;
|
GLuint texture;
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ti.width, ti.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, ti.pixels);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ti.width, ti.height, 0,
|
||||||
|
GL_RGBA, GL_UNSIGNED_BYTE, ti.pixels);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
@ -655,7 +684,8 @@ void lakka_init_settings(void)
|
|||||||
category->zoom = c_active_zoom;
|
category->zoom = c_active_zoom;
|
||||||
category->active_item = 0;
|
category->active_item = 0;
|
||||||
category->num_items = 0;
|
category->num_items = 0;
|
||||||
category->items = (menu_item_t*)calloc(category->num_items, sizeof(menu_item_t));
|
category->items = (menu_item_t*)
|
||||||
|
calloc(category->num_items, sizeof(menu_item_t));
|
||||||
|
|
||||||
int j, k;
|
int j, k;
|
||||||
|
|
||||||
@ -663,67 +693,87 @@ void lakka_init_settings(void)
|
|||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
category->num_items++;
|
category->num_items++;
|
||||||
category->items = (menu_item_t*)realloc(category->items, category->num_items * sizeof(menu_item_t));
|
category->items = (menu_item_t*)
|
||||||
|
realloc(category->items, category->num_items * sizeof(menu_item_t));
|
||||||
|
|
||||||
menu_item_t *item0 = (menu_item_t*)&category->items[j];
|
menu_item_t *item0 = (menu_item_t*)&category->items[j];
|
||||||
|
|
||||||
strlcpy(item0->name, "General Options", sizeof(item0->name));
|
strlcpy(item0->name, "General Options", sizeof(item0->name));
|
||||||
item0->alpha = j ? 0.5 : 1.0;
|
item0->alpha = j ? 0.5 : 1.0;
|
||||||
item0->zoom = j ? i_passive_zoom : i_active_zoom;
|
item0->zoom = j ? i_passive_zoom : i_active_zoom;
|
||||||
item0->y = j ? vspacing*(under_item_offset+j) : vspacing * active_item_factor;
|
item0->y = j ?
|
||||||
|
vspacing*(under_item_offset+j) : vspacing * active_item_factor;
|
||||||
item0->active_subitem = 0;
|
item0->active_subitem = 0;
|
||||||
item0->num_subitems = 0;
|
item0->num_subitems = 0;
|
||||||
|
|
||||||
// General options subitems
|
/* General options subitems */
|
||||||
|
|
||||||
k = 0;
|
k = 0;
|
||||||
item0->num_subitems++;
|
item0->num_subitems++;
|
||||||
//item0->subitems = (menu_subitem_t*)realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
#if 0
|
||||||
item0->subitems = (menu_subitem_t*)calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
item0->subitems = (menu_subitem_t*)
|
||||||
|
realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
||||||
|
#endif
|
||||||
|
item0->subitems = (menu_subitem_t*)
|
||||||
|
calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
||||||
|
|
||||||
menu_subitem_t *subitem0 = (menu_subitem_t*)&item0->subitems[k];
|
menu_subitem_t *subitem0 = (menu_subitem_t*)&item0->subitems[k];
|
||||||
|
|
||||||
strlcpy(subitem0->name, "Libretro Logging Level", sizeof(subitem0->name));
|
strlcpy(subitem0->name, "Libretro Logging Level", sizeof(subitem0->name));
|
||||||
subitem0->alpha = k ? 1.0 : 0.5;
|
subitem0->alpha = k ? 1.0 : 0.5;
|
||||||
subitem0->zoom = k ? i_active_zoom : i_passive_zoom;
|
subitem0->zoom = k ? i_active_zoom : i_passive_zoom;
|
||||||
subitem0->y = k ? vspacing * (k + under_item_offset) : vspacing * active_item_factor;
|
subitem0->y = k ? vspacing * (k + under_item_offset)
|
||||||
|
: vspacing * active_item_factor;
|
||||||
|
|
||||||
k = 1;
|
k = 1;
|
||||||
item0->num_subitems++;
|
item0->num_subitems++;
|
||||||
item0->subitems = (menu_subitem_t*)realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
item0->subitems = (menu_subitem_t*)
|
||||||
//item0->subitems = (menu_subitem_t*)calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
||||||
|
#if 0
|
||||||
|
item0->subitems = (menu_subitem_t*)
|
||||||
|
calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
||||||
|
#endif
|
||||||
|
|
||||||
menu_subitem_t *subitem1 = (menu_subitem_t*)&item0->subitems[k];
|
menu_subitem_t *subitem1 = (menu_subitem_t*)&item0->subitems[k];
|
||||||
|
|
||||||
strlcpy(subitem1->name, "Logging Verbosity", sizeof(subitem1->name));
|
strlcpy(subitem1->name, "Logging Verbosity", sizeof(subitem1->name));
|
||||||
subitem1->alpha = k ? 1.0 : 0.5;
|
subitem1->alpha = k ? 1.0 : 0.5;
|
||||||
subitem1->zoom = k ? i_active_zoom : i_passive_zoom;
|
subitem1->zoom = k ? i_active_zoom : i_passive_zoom;
|
||||||
subitem1->y = k ? vspacing * (k + under_item_offset) : vspacing * active_item_factor;
|
subitem1->y = k ? vspacing * (k + under_item_offset) :
|
||||||
|
vspacing * active_item_factor;
|
||||||
|
|
||||||
k = 2;
|
k = 2;
|
||||||
item0->num_subitems++;
|
item0->num_subitems++;
|
||||||
item0->subitems = (menu_subitem_t*)realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
item0->subitems = (menu_subitem_t*)
|
||||||
//item0->subitems = (menu_subitem_t*)calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
realloc(item0->subitems, item0->num_subitems * sizeof(menu_subitem_t));
|
||||||
|
#if 0
|
||||||
|
item0->subitems = (menu_subitem_t*)
|
||||||
|
calloc(item0->num_subitems, sizeof(menu_subitem_t));
|
||||||
|
#endif
|
||||||
|
|
||||||
menu_subitem_t *subitem2 = (menu_subitem_t*)&item0->subitems[k];
|
menu_subitem_t *subitem2 = (menu_subitem_t*)&item0->subitems[k];
|
||||||
|
|
||||||
strlcpy(subitem2->name, "Configuration Save On Exit", sizeof(subitem2->name));
|
strlcpy(subitem2->name, "Configuration Save On Exit",
|
||||||
|
sizeof(subitem2->name));
|
||||||
subitem2->alpha = k ? 1.0 : 0.5;
|
subitem2->alpha = k ? 1.0 : 0.5;
|
||||||
subitem2->zoom = k ? i_active_zoom : i_passive_zoom;
|
subitem2->zoom = k ? i_active_zoom : i_passive_zoom;
|
||||||
subitem2->y = k ? vspacing * (k + under_item_offset) : vspacing * active_item_factor;
|
subitem2->y = k ? vspacing * (k + under_item_offset) :
|
||||||
|
vspacing * active_item_factor;
|
||||||
|
|
||||||
// Quit item
|
/* Quit item */
|
||||||
|
|
||||||
j = 1;
|
j = 1;
|
||||||
category->num_items++;
|
category->num_items++;
|
||||||
category->items = (menu_item_t*)realloc(category->items, category->num_items * sizeof(menu_item_t));
|
category->items = (menu_item_t*)
|
||||||
|
realloc(category->items, category->num_items * sizeof(menu_item_t));
|
||||||
|
|
||||||
menu_item_t *item1 = (menu_item_t*)&category->items[j];
|
menu_item_t *item1 = (menu_item_t*)&category->items[j];
|
||||||
|
|
||||||
strlcpy(item1->name, "Quit RetroArch", sizeof(item1->name));
|
strlcpy(item1->name, "Quit RetroArch", sizeof(item1->name));
|
||||||
item1->alpha = j ? 0.5 : 1.0;
|
item1->alpha = j ? 0.5 : 1.0;
|
||||||
item1->zoom = j ? i_passive_zoom : i_active_zoom;
|
item1->zoom = j ? i_passive_zoom : i_active_zoom;
|
||||||
item1->y = j ? vspacing*(under_item_offset+j) : vspacing * active_item_factor;
|
item1->y = j ? vspacing*(under_item_offset+j) :
|
||||||
|
vspacing * active_item_factor;
|
||||||
item1->active_subitem = 0;
|
item1->active_subitem = 0;
|
||||||
item1->num_subitems = 0;
|
item1->num_subitems = 0;
|
||||||
}
|
}
|
||||||
@ -740,19 +790,17 @@ void lakka_settings_context_reset(void)
|
|||||||
category->icon = textures[TEXTURE_SETTINGS].id;
|
category->icon = textures[TEXTURE_SETTINGS].id;
|
||||||
category->item_icon = textures[TEXTURE_SETTING].id;
|
category->item_icon = textures[TEXTURE_SETTING].id;
|
||||||
|
|
||||||
// General options item
|
/* General options item */
|
||||||
|
|
||||||
item = (menu_item_t*)&category->items[0];
|
item = (menu_item_t*)&category->items[0];
|
||||||
|
|
||||||
// General options subitems
|
/* General options subitems */
|
||||||
for (k = 0; k < 2; k++)
|
for (k = 0; k < 2; k++)
|
||||||
{
|
{
|
||||||
menu_subitem_t *subitem = (menu_subitem_t*)&item->subitems[k];
|
menu_subitem_t *subitem = (menu_subitem_t*)&item->subitems[k];
|
||||||
subitem->icon = textures[TEXTURE_SUBSETTING].id;
|
subitem->icon = textures[TEXTURE_SUBSETTING].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quit item
|
/* Quit item */
|
||||||
|
|
||||||
item = (menu_item_t*)&category->items[1];
|
item = (menu_item_t*)&category->items[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,7 +817,8 @@ static void lakka_context_reset(void *data)
|
|||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fill_pathname_join(mediapath, g_settings.assets_directory, "lakka", sizeof(mediapath));
|
fill_pathname_join(mediapath, g_settings.assets_directory,
|
||||||
|
"lakka", sizeof(mediapath));
|
||||||
fill_pathname_join(themepath, mediapath, THEME, sizeof(themepath));
|
fill_pathname_join(themepath, mediapath, THEME, sizeof(themepath));
|
||||||
fill_pathname_join(iconpath, themepath, icon_dir, sizeof(iconpath));
|
fill_pathname_join(iconpath, themepath, icon_dir, sizeof(iconpath));
|
||||||
fill_pathname_slash(iconpath, sizeof(iconpath));
|
fill_pathname_slash(iconpath, sizeof(iconpath));
|
||||||
@ -778,17 +827,28 @@ static void lakka_context_reset(void *data)
|
|||||||
|
|
||||||
gl_font_init_first(&font_driver, &font, gl, font_path, lakka_font_size);
|
gl_font_init_first(&font_driver, &font, gl, font_path, lakka_font_size);
|
||||||
|
|
||||||
fill_pathname_join(textures[TEXTURE_BG].path, iconpath, "bg.png", sizeof(textures[TEXTURE_BG].path));
|
fill_pathname_join(textures[TEXTURE_BG].path, iconpath,
|
||||||
fill_pathname_join(textures[TEXTURE_SETTINGS].path, iconpath, "settings.png", sizeof(textures[TEXTURE_SETTINGS].path));
|
"bg.png", sizeof(textures[TEXTURE_BG].path));
|
||||||
fill_pathname_join(textures[TEXTURE_SETTING].path, iconpath, "setting.png", sizeof(textures[TEXTURE_SETTING].path));
|
fill_pathname_join(textures[TEXTURE_SETTINGS].path, iconpath,
|
||||||
fill_pathname_join(textures[TEXTURE_SUBSETTING].path, iconpath, "subsetting.png", sizeof(textures[TEXTURE_SUBSETTING].path));
|
"settings.png", sizeof(textures[TEXTURE_SETTINGS].path));
|
||||||
fill_pathname_join(textures[TEXTURE_ARROW].path, iconpath, "arrow.png", sizeof(textures[TEXTURE_ARROW].path));
|
fill_pathname_join(textures[TEXTURE_SETTING].path, iconpath,
|
||||||
fill_pathname_join(textures[TEXTURE_RUN].path, iconpath, "run.png", sizeof(textures[TEXTURE_RUN].path));
|
"setting.png", sizeof(textures[TEXTURE_SETTING].path));
|
||||||
fill_pathname_join(textures[TEXTURE_RESUME].path, iconpath, "resume.png", sizeof(textures[TEXTURE_RESUME].path));
|
fill_pathname_join(textures[TEXTURE_SUBSETTING].path, iconpath,
|
||||||
fill_pathname_join(textures[TEXTURE_SAVESTATE].path, iconpath, "savestate.png", sizeof(textures[TEXTURE_SAVESTATE].path));
|
"subsetting.png", sizeof(textures[TEXTURE_SUBSETTING].path));
|
||||||
fill_pathname_join(textures[TEXTURE_LOADSTATE].path, iconpath, "loadstate.png", sizeof(textures[TEXTURE_LOADSTATE].path));
|
fill_pathname_join(textures[TEXTURE_ARROW].path, iconpath,
|
||||||
fill_pathname_join(textures[TEXTURE_SCREENSHOT].path, iconpath, "screenshot.png", sizeof(textures[TEXTURE_SCREENSHOT].path));
|
"arrow.png", sizeof(textures[TEXTURE_ARROW].path));
|
||||||
fill_pathname_join(textures[TEXTURE_RELOAD].path, iconpath, "reload.png", sizeof(textures[TEXTURE_RELOAD].path));
|
fill_pathname_join(textures[TEXTURE_RUN].path, iconpath,
|
||||||
|
"run.png", sizeof(textures[TEXTURE_RUN].path));
|
||||||
|
fill_pathname_join(textures[TEXTURE_RESUME].path, iconpath,
|
||||||
|
"resume.png", sizeof(textures[TEXTURE_RESUME].path));
|
||||||
|
fill_pathname_join(textures[TEXTURE_SAVESTATE].path, iconpath,
|
||||||
|
"savestate.png", sizeof(textures[TEXTURE_SAVESTATE].path));
|
||||||
|
fill_pathname_join(textures[TEXTURE_LOADSTATE].path, iconpath,
|
||||||
|
"loadstate.png", sizeof(textures[TEXTURE_LOADSTATE].path));
|
||||||
|
fill_pathname_join(textures[TEXTURE_SCREENSHOT].path, iconpath,
|
||||||
|
"screenshot.png", sizeof(textures[TEXTURE_SCREENSHOT].path));
|
||||||
|
fill_pathname_join(textures[TEXTURE_RELOAD].path, iconpath,
|
||||||
|
"reload.png", sizeof(textures[TEXTURE_RELOAD].path));
|
||||||
|
|
||||||
for (k = 0; k < TEXTURE_LAST; k++)
|
for (k = 0; k < TEXTURE_LAST; k++)
|
||||||
textures[k].id = png_texture_load(textures[k].path);
|
textures[k].id = png_texture_load(textures[k].path);
|
||||||
@ -798,11 +858,13 @@ static void lakka_context_reset(void *data)
|
|||||||
{
|
{
|
||||||
menu_category_t *category = (menu_category_t*)&categories[i];
|
menu_category_t *category = (menu_category_t*)&categories[i];
|
||||||
|
|
||||||
char core_id[256], texturepath[256], content_texturepath[256], mediapath[256], themepath[256];
|
char core_id[256], texturepath[256], content_texturepath[256],
|
||||||
|
mediapath[256], themepath[256];
|
||||||
core_info_t *info;
|
core_info_t *info;
|
||||||
core_info_list_t *info_list;
|
core_info_list_t *info_list;
|
||||||
|
|
||||||
fill_pathname_join(mediapath, g_settings.assets_directory, "lakka", sizeof(mediapath));
|
fill_pathname_join(mediapath, g_settings.assets_directory,
|
||||||
|
"lakka", sizeof(mediapath));
|
||||||
fill_pathname_join(themepath, mediapath, THEME, sizeof(themepath));
|
fill_pathname_join(themepath, mediapath, THEME, sizeof(themepath));
|
||||||
fill_pathname_join(iconpath, themepath, icon_dir, sizeof(iconpath));
|
fill_pathname_join(iconpath, themepath, icon_dir, sizeof(iconpath));
|
||||||
fill_pathname_slash(iconpath, sizeof(iconpath));
|
fill_pathname_slash(iconpath, sizeof(iconpath));
|
||||||
@ -862,10 +924,12 @@ static void lakka_context_reset(void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lakka_init_items(int i, menu_category_t *category, core_info_t *info, const char* path)
|
static void lakka_init_items(int i, menu_category_t *category,
|
||||||
|
core_info_t *info, const char* path)
|
||||||
{
|
{
|
||||||
int num_items, j, n, k;
|
int num_items, j, n, k;
|
||||||
struct string_list *list = (struct string_list*)dir_list_new(path, info->supported_extensions, true);
|
struct string_list *list = (struct string_list*)
|
||||||
|
dir_list_new(path, info->supported_extensions, true);
|
||||||
|
|
||||||
dir_list_sort(list, true);
|
dir_list_sort(list, true);
|
||||||
|
|
||||||
@ -882,17 +946,21 @@ static void lakka_init_items(int i, menu_category_t *category, core_info_t *info
|
|||||||
n = category->num_items;
|
n = category->num_items;
|
||||||
|
|
||||||
category->num_items++;
|
category->num_items++;
|
||||||
category->items = (menu_item_t*)realloc(category->items, category->num_items * sizeof(menu_item_t));
|
category->items = (menu_item_t*)realloc(category->items,
|
||||||
|
category->num_items * sizeof(menu_item_t));
|
||||||
item = (menu_item_t*)&category->items[n];
|
item = (menu_item_t*)&category->items[n];
|
||||||
|
|
||||||
strlcpy(item->name, path_basename(list->elems[j].data), sizeof(item->name));
|
strlcpy(item->name, path_basename(list->elems[j].data),
|
||||||
|
sizeof(item->name));
|
||||||
strlcpy(item->rom, list->elems[j].data, sizeof(item->rom));
|
strlcpy(item->rom, list->elems[j].data, sizeof(item->rom));
|
||||||
item->alpha = i != menu_active_category ? 0 : n ? 0.5 : 1;
|
item->alpha = i != menu_active_category ? 0 : n ? 0.5 : 1;
|
||||||
item->zoom = n ? i_passive_zoom : i_active_zoom;
|
item->zoom = n ? i_passive_zoom : i_active_zoom;
|
||||||
item->y = n ? vspacing*(under_item_offset+n) : vspacing*active_item_factor;
|
item->y = n ? vspacing*(under_item_offset+n) :
|
||||||
|
vspacing*active_item_factor;
|
||||||
item->active_subitem = 0;
|
item->active_subitem = 0;
|
||||||
item->num_subitems = 5;
|
item->num_subitems = 5;
|
||||||
item->subitems = (menu_subitem_t*)calloc(item->num_subitems, sizeof(menu_subitem_t));
|
item->subitems = (menu_subitem_t*)
|
||||||
|
calloc(item->num_subitems, sizeof(menu_subitem_t));
|
||||||
|
|
||||||
for (k = 0; k < item->num_subitems; k++)
|
for (k = 0; k < item->num_subitems; k++)
|
||||||
{
|
{
|
||||||
@ -921,7 +989,8 @@ static void lakka_init_items(int i, menu_category_t *category, core_info_t *info
|
|||||||
}
|
}
|
||||||
subitem->alpha = 0;
|
subitem->alpha = 0;
|
||||||
subitem->zoom = k ? i_passive_zoom : i_active_zoom;
|
subitem->zoom = k ? i_passive_zoom : i_active_zoom;
|
||||||
subitem->y = k ? vspacing * (k+under_item_offset) : vspacing * active_item_factor;
|
subitem->y = k ? vspacing * (k+under_item_offset) :
|
||||||
|
vspacing * active_item_factor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -937,7 +1006,8 @@ static void lakka_free(void *data)
|
|||||||
|
|
||||||
static int lakka_input_postprocess(uint64_t old_state)
|
static int lakka_input_postprocess(uint64_t old_state)
|
||||||
{
|
{
|
||||||
if ((driver.menu && driver.menu->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
|
if ((driver.menu && driver.menu->trigger_state
|
||||||
|
& (1ULL << RARCH_MENU_TOGGLE)) &&
|
||||||
g_extern.main_is_init &&
|
g_extern.main_is_init &&
|
||||||
!g_extern.libretro_dummy)
|
!g_extern.libretro_dummy)
|
||||||
{
|
{
|
||||||
@ -960,7 +1030,9 @@ static void lakka_init_core_info(void *data)
|
|||||||
core_info_list_free(menu->core_info);
|
core_info_list_free(menu->core_info);
|
||||||
menu->core_info = NULL;
|
menu->core_info = NULL;
|
||||||
|
|
||||||
menu->core_info = (core_info_list_t*)core_info_list_new(*g_settings.libretro_directory ? g_settings.libretro_directory : "/usr/lib/libretro");
|
menu->core_info = (core_info_list_t*)
|
||||||
|
core_info_list_new(*g_settings.libretro_directory ?
|
||||||
|
g_settings.libretro_directory : "/usr/lib/libretro");
|
||||||
|
|
||||||
if (menu->core_info)
|
if (menu->core_info)
|
||||||
{
|
{
|
||||||
@ -980,7 +1052,8 @@ static void *lakka_init(void)
|
|||||||
lakka_responsive();
|
lakka_responsive();
|
||||||
|
|
||||||
lakka_init_core_info(menu);
|
lakka_init_core_info(menu);
|
||||||
categories = (menu_category_t*)calloc(num_categories, sizeof(menu_category_t));
|
categories = (menu_category_t*)
|
||||||
|
calloc(num_categories, sizeof(menu_category_t));
|
||||||
|
|
||||||
lakka_init_settings();
|
lakka_init_settings();
|
||||||
|
|
||||||
@ -1002,7 +1075,8 @@ static void *lakka_init(void)
|
|||||||
category->zoom = c_passive_zoom;
|
category->zoom = c_passive_zoom;
|
||||||
category->active_item = 0;
|
category->active_item = 0;
|
||||||
category->num_items = 0;
|
category->num_items = 0;
|
||||||
category->items = (menu_item_t*)calloc(category->num_items, sizeof(menu_item_t));
|
category->items = (menu_item_t*)
|
||||||
|
calloc(category->num_items, sizeof(menu_item_t));
|
||||||
|
|
||||||
lakka_init_items(i, category, info, g_settings.content_directory);
|
lakka_init_items(i, category, info, g_settings.content_directory);
|
||||||
}
|
}
|
||||||
|
@ -188,13 +188,15 @@ static void rgui_render_background(void)
|
|||||||
5, 5, driver.menu->width - 10, 5, green_filler);
|
5, 5, driver.menu->width - 10, 5, green_filler);
|
||||||
|
|
||||||
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
||||||
5, driver.menu->height - 10, driver.menu->width - 10, 5, green_filler);
|
5, driver.menu->height - 10, driver.menu->width - 10, 5,
|
||||||
|
green_filler);
|
||||||
|
|
||||||
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
||||||
5, 5, 5, driver.menu->height - 10, green_filler);
|
5, 5, 5, driver.menu->height - 10, green_filler);
|
||||||
|
|
||||||
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
fill_rect(driver.menu->frame_buf, driver.menu->frame_buf_pitch,
|
||||||
driver.menu->width - 10, 5, 5, driver.menu->height - 10, green_filler);
|
driver.menu->width - 10, 5, 5, driver.menu->height - 10,
|
||||||
|
green_filler);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rgui_render_messagebox(const char *message)
|
static void rgui_render_messagebox(const char *message)
|
||||||
@ -280,7 +282,7 @@ static void rgui_render(void)
|
|||||||
driver.menu->selection_ptr + RGUI_TERM_HEIGHT :
|
driver.menu->selection_ptr + RGUI_TERM_HEIGHT :
|
||||||
file_list_get_size(driver.menu->selection_buf);
|
file_list_get_size(driver.menu->selection_buf);
|
||||||
|
|
||||||
// Do not scroll if all items are visible.
|
/* Do not scroll if all items are visible. */
|
||||||
if (file_list_get_size(driver.menu->selection_buf) <= RGUI_TERM_HEIGHT)
|
if (file_list_get_size(driver.menu->selection_buf) <= RGUI_TERM_HEIGHT)
|
||||||
begin = 0;
|
begin = 0;
|
||||||
|
|
||||||
@ -466,7 +468,8 @@ static void rgui_render(void)
|
|||||||
file_list_get_at_offset(driver.menu->selection_buf, i, &path,
|
file_list_get_at_offset(driver.menu->selection_buf, i, &path,
|
||||||
&label, &type);
|
&label, &type);
|
||||||
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(
|
rarch_setting_t *setting = (rarch_setting_t*)setting_data_find_setting(
|
||||||
setting_data_get_list(), driver.menu->selection_buf->list[i].label);
|
setting_data_get_list(),
|
||||||
|
driver.menu->selection_buf->list[i].label);
|
||||||
unsigned w = 19;
|
unsigned w = 19;
|
||||||
(void)setting;
|
(void)setting;
|
||||||
if (menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS)
|
if (menu_type == MENU_SETTINGS_PERFORMANCE_COUNTERS)
|
||||||
@ -515,7 +518,7 @@ static void rgui_render(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
// Pretty-print libretro cores from menu.
|
/* Pretty-print libretro cores from menu. */
|
||||||
if (
|
if (
|
||||||
menu_type == MENU_SETTINGS_CORE ||
|
menu_type == MENU_SETTINGS_CORE ||
|
||||||
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||||
|
@ -107,8 +107,10 @@ static void rmenu_render_messagebox(const char *message)
|
|||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_data && driver.video_poke
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
|
&& driver.video_poke->set_osd_msg)
|
||||||
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
msg, &font_parms);
|
||||||
}
|
}
|
||||||
|
|
||||||
render_normal = false;
|
render_normal = false;
|
||||||
@ -137,8 +139,12 @@ static void rmenu_render(void)
|
|||||||
if (!menu->selection_buf)
|
if (!menu->selection_buf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
begin = (menu->selection_ptr >= (ENTRIES_HEIGHT / 2)) ? (menu->selection_ptr - (ENTRIES_HEIGHT / 2)) : 0;
|
begin = (menu->selection_ptr >= (ENTRIES_HEIGHT / 2)) ?
|
||||||
end = ((menu->selection_ptr + ENTRIES_HEIGHT) <= file_list_get_size(menu->selection_buf)) ? menu->selection_ptr + ENTRIES_HEIGHT : file_list_get_size(menu->selection_buf);
|
(menu->selection_ptr - (ENTRIES_HEIGHT / 2)) : 0;
|
||||||
|
end = ((menu->selection_ptr + ENTRIES_HEIGHT) <=
|
||||||
|
file_list_get_size(menu->selection_buf)) ?
|
||||||
|
menu->selection_ptr + ENTRIES_HEIGHT :
|
||||||
|
file_list_get_size(menu->selection_buf);
|
||||||
|
|
||||||
if (file_list_get_size(menu->selection_buf) <= ENTRIES_HEIGHT)
|
if (file_list_get_size(menu->selection_buf) <= ENTRIES_HEIGHT)
|
||||||
begin = 0;
|
begin = 0;
|
||||||
@ -155,7 +161,8 @@ static void rmenu_render(void)
|
|||||||
unsigned menu_type_is = 0;
|
unsigned menu_type_is = 0;
|
||||||
file_list_get_last(menu->menu_stack, &dir, &label, &menu_type);
|
file_list_get_last(menu->menu_stack, &dir, &label, &menu_type);
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
|
if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
|
&& driver.menu_ctx->backend->type_is)
|
||||||
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
|
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
|
||||||
|
|
||||||
if (menu_type == MENU_SETTINGS_CORE)
|
if (menu_type == MENU_SETTINGS_CORE)
|
||||||
@ -283,15 +290,19 @@ static void rmenu_render(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char title_buf[256];
|
char title_buf[256];
|
||||||
menu_ticker_line(title_buf, RMENU_TERM_WIDTH, g_extern.frame_count / 15, title, true);
|
menu_ticker_line(title_buf, RMENU_TERM_WIDTH,
|
||||||
|
g_extern.frame_count / 15, title, true);
|
||||||
|
|
||||||
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
|
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
|
||||||
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET - (POSITION_OFFSET*2);
|
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET
|
||||||
|
- (POSITION_OFFSET*2);
|
||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_data && driver.video_poke
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, title_buf, &font_parms);
|
&& driver.video_poke->set_osd_msg)
|
||||||
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
title_buf, &font_parms);
|
||||||
|
|
||||||
char title_msg[64];
|
char title_msg[64];
|
||||||
const char *core_name = menu->info.library_name;
|
const char *core_name = menu->info.library_name;
|
||||||
@ -311,10 +322,13 @@ static void rmenu_render(void)
|
|||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION, core_name, core_version);
|
snprintf(title_msg, sizeof(title_msg), "%s - %s %s",
|
||||||
|
PACKAGE_VERSION, core_name, core_version);
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_data && driver.video_poke
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, title_msg, &font_parms);
|
&& driver.video_poke->set_osd_msg)
|
||||||
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
title_msg, &font_parms);
|
||||||
|
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
@ -330,7 +344,8 @@ static void rmenu_render(void)
|
|||||||
char type_str[256];
|
char type_str[256];
|
||||||
|
|
||||||
unsigned w = 19;
|
unsigned w = 19;
|
||||||
if (menu_type == MENU_SETTINGS_INPUT_OPTIONS || menu_type == MENU_SETTINGS_CUSTOM_BIND)
|
if (menu_type == MENU_SETTINGS_INPUT_OPTIONS ||
|
||||||
|
menu_type == MENU_SETTINGS_CUSTOM_BIND)
|
||||||
w = 21;
|
w = 21;
|
||||||
else if (menu_type == MENU_SETTINGS_PATH_OPTIONS)
|
else if (menu_type == MENU_SETTINGS_PATH_OPTIONS)
|
||||||
w = 24;
|
w = 24;
|
||||||
@ -339,7 +354,8 @@ static void rmenu_render(void)
|
|||||||
if (type >= MENU_SETTINGS_SHADER_FILTER &&
|
if (type >= MENU_SETTINGS_SHADER_FILTER &&
|
||||||
type <= MENU_SETTINGS_SHADER_LAST)
|
type <= MENU_SETTINGS_SHADER_LAST)
|
||||||
{
|
{
|
||||||
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
|
/* HACK. Work around that we're using the menu_type as
|
||||||
|
* dir type to propagate state correctly. */
|
||||||
if ((menu_type_is == MENU_SETTINGS_SHADER_OPTIONS)
|
if ((menu_type_is == MENU_SETTINGS_SHADER_OPTIONS)
|
||||||
&& (menu_type_is == MENU_SETTINGS_SHADER_OPTIONS))
|
&& (menu_type_is == MENU_SETTINGS_SHADER_OPTIONS))
|
||||||
{
|
{
|
||||||
@ -347,23 +363,33 @@ static void rmenu_render(void)
|
|||||||
strlcpy(type_str, "(DIR)", sizeof(type_str));
|
strlcpy(type_str, "(DIR)", sizeof(type_str));
|
||||||
w = 5;
|
w = 5;
|
||||||
}
|
}
|
||||||
else if (type == MENU_SETTINGS_SHADER_OPTIONS || type == MENU_SETTINGS_SHADER_PRESET || type == MENU_SETTINGS_SHADER_PARAMETERS || type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS)
|
else if (
|
||||||
|
type == MENU_SETTINGS_SHADER_OPTIONS ||
|
||||||
|
type == MENU_SETTINGS_SHADER_PRESET ||
|
||||||
|
type == MENU_SETTINGS_SHADER_PARAMETERS ||
|
||||||
|
type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS)
|
||||||
strlcpy(type_str, "...", sizeof(type_str));
|
strlcpy(type_str, "...", sizeof(type_str));
|
||||||
else if (type == MENU_SETTINGS_SHADER_FILTER)
|
else if (type == MENU_SETTINGS_SHADER_FILTER)
|
||||||
snprintf(type_str, sizeof(type_str), "%s",
|
snprintf(type_str, sizeof(type_str), "%s",
|
||||||
g_settings.video.smooth ? "Linear" : "Nearest");
|
g_settings.video.smooth ? "Linear" : "Nearest");
|
||||||
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_get_str)
|
else if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
|
&& driver.menu_ctx->backend->shader_manager_get_str)
|
||||||
{
|
{
|
||||||
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 && type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
if (type >= MENU_SETTINGS_SHADER_PARAMETER_0 &&
|
||||||
driver.menu_ctx->backend->shader_manager_get_str(menu->parameter_shader, type_str, sizeof(type_str), type);
|
type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||||
|
driver.menu_ctx->backend->shader_manager_get_str(
|
||||||
|
menu->parameter_shader, type_str, sizeof(type_str), type);
|
||||||
else
|
else
|
||||||
driver.menu_ctx->backend->shader_manager_get_str(menu->shader, type_str, sizeof(type_str), type);
|
driver.menu_ctx->backend->shader_manager_get_str(
|
||||||
|
menu->shader, type_str, sizeof(type_str), type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
// Pretty-print libretro cores from menu.
|
/* Pretty-print libretro cores from menu. */
|
||||||
if (menu_type == MENU_SETTINGS_CORE || menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
if (
|
||||||
|
menu_type == MENU_SETTINGS_CORE ||
|
||||||
|
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||||
{
|
{
|
||||||
if (type == MENU_FILE_PLAIN)
|
if (type == MENU_FILE_PLAIN)
|
||||||
{
|
{
|
||||||
@ -406,10 +432,13 @@ static void rmenu_render(void)
|
|||||||
}
|
}
|
||||||
else if (type >= MENU_SETTINGS_CORE_OPTION_START)
|
else if (type >= MENU_SETTINGS_CORE_OPTION_START)
|
||||||
strlcpy(type_str,
|
strlcpy(type_str,
|
||||||
core_option_get_val(g_extern.system.core_options, type - MENU_SETTINGS_CORE_OPTION_START),
|
core_option_get_val(g_extern.system.core_options,
|
||||||
|
type - MENU_SETTINGS_CORE_OPTION_START),
|
||||||
sizeof(type_str));
|
sizeof(type_str));
|
||||||
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
|
else if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type, i);
|
&& driver.menu_ctx->backend->setting_set_label)
|
||||||
|
driver.menu_ctx->backend->setting_set_label(type_str,
|
||||||
|
sizeof(type_str), &w, type, i);
|
||||||
|
|
||||||
if (type_str[0] == '\0' && w == 0)
|
if (type_str[0] == '\0' && w == 0)
|
||||||
{
|
{
|
||||||
@ -429,24 +458,32 @@ static void rmenu_render(void)
|
|||||||
char type_str_buf[64];
|
char type_str_buf[64];
|
||||||
bool selected = i == menu->selection_ptr;
|
bool selected = i == menu->selection_ptr;
|
||||||
|
|
||||||
menu_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (w + 1 + 2), g_extern.frame_count / 15, path, selected);
|
menu_ticker_line(entry_title_buf, RMENU_TERM_WIDTH - (w + 1 + 2),
|
||||||
menu_ticker_line(type_str_buf, w, g_extern.frame_count / 15, type_str, selected);
|
g_extern.frame_count / 15, path, selected);
|
||||||
|
menu_ticker_line(type_str_buf, w, g_extern.frame_count / 15,
|
||||||
|
type_str, selected);
|
||||||
|
|
||||||
snprintf(message, sizeof(message), "%c %s", selected ? '>' : ' ', entry_title_buf);
|
snprintf(message, sizeof(message), "%c %s",
|
||||||
|
selected ? '>' : ' ', entry_title_buf);
|
||||||
|
|
||||||
//blit_line(menu, x, y, message, selected);
|
//blit_line(menu, x, y, message, selected);
|
||||||
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
|
font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET;
|
||||||
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET + (POSITION_OFFSET * j);
|
font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET
|
||||||
|
+ (POSITION_OFFSET * j);
|
||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_data && driver.video_poke
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, message, &font_parms);
|
&& driver.video_poke->set_osd_msg)
|
||||||
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
message, &font_parms);
|
||||||
|
|
||||||
font_parms.x = POSITION_EDGE_CENTER + POSITION_OFFSET;
|
font_parms.x = POSITION_EDGE_CENTER + POSITION_OFFSET;
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_data && driver.video_poke
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, type_str_buf, &font_parms);
|
&& driver.video_poke->set_osd_msg)
|
||||||
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
type_str_buf, &font_parms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,9 +494,12 @@ void rmenu_set_texture(void *data)
|
|||||||
if (menu_texture_inited)
|
if (menu_texture_inited)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable && menu_texture && menu_texture->pixels)
|
if (driver.video_data && driver.video_poke
|
||||||
|
&& driver.video_poke->set_texture_enable
|
||||||
|
&& menu_texture && menu_texture->pixels)
|
||||||
{
|
{
|
||||||
driver.video_poke->set_texture_frame(driver.video_data, menu_texture->pixels,
|
driver.video_poke->set_texture_frame(driver.video_data,
|
||||||
|
menu_texture->pixels,
|
||||||
true, menu->width, menu->height, 1.0f);
|
true, menu->width, menu->height, 1.0f);
|
||||||
menu_texture_inited = true;
|
menu_texture_inited = true;
|
||||||
}
|
}
|
||||||
@ -473,7 +513,8 @@ static void rmenu_context_reset(void *data)
|
|||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fill_pathname_join(menu_bg, g_settings.assets_directory, "rmenu", sizeof(menu_bg));
|
fill_pathname_join(menu_bg, g_settings.assets_directory,
|
||||||
|
"rmenu", sizeof(menu_bg));
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
fill_pathname_join(menu_bg, menu_bg, "sd", sizeof(menu_bg));
|
fill_pathname_join(menu_bg, menu_bg, "sd", sizeof(menu_bg));
|
||||||
#else
|
#else
|
||||||
|
@ -200,14 +200,17 @@ static void* rmenu_xui_init(void)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = XuiLoadVisualFromBinary( L"file://game:/media/rarch_scene_skin.xur", NULL);
|
hr = XuiLoadVisualFromBinary(
|
||||||
|
L"file://game:/media/rarch_scene_skin.xur", NULL);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to load skin.\n");
|
RARCH_ERR("Failed to load skin.\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &root_menu);
|
hr = XuiSceneCreate(hdmenus_allowed ?
|
||||||
|
L"file://game:/media/hd/" : L"file://game:/media/sd/",
|
||||||
|
L"rarch_main.xur", NULL, &root_menu);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n");
|
RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n");
|
||||||
@ -215,14 +218,16 @@ static void* rmenu_xui_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
current_menu = root_menu;
|
current_menu = root_menu;
|
||||||
hr = XuiSceneNavigateFirst(app.GetRootObj(), current_menu, XUSER_INDEX_FOCUS);
|
hr = XuiSceneNavigateFirst(app.GetRootObj(),
|
||||||
|
current_menu, XUSER_INDEX_FOCUS);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
RARCH_ERR("XuiSceneNavigateFirst failed.\n");
|
RARCH_ERR("XuiSceneNavigateFirst failed.\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable)
|
if (driver.video_data && driver.video_poke
|
||||||
|
&& driver.video_poke->set_texture_enable)
|
||||||
driver.video_poke->set_texture_frame(driver.video_data, NULL,
|
driver.video_poke->set_texture_frame(driver.video_data, NULL,
|
||||||
true, 0, 0, 1.0f);
|
true, 0, 0, 1.0f);
|
||||||
|
|
||||||
@ -274,7 +279,8 @@ static void xui_render_message(const char *msg)
|
|||||||
msglen = RMENU_TERM_WIDTH;
|
msglen = RMENU_TERM_WIDTH;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
float msg_width = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)) ? 160 : 100;
|
float msg_width = (g_extern.lifecycle_state &
|
||||||
|
(1ULL << MODE_MENU_HD)) ? 160 : 100;
|
||||||
float msg_height = 120;
|
float msg_height = 120;
|
||||||
float msg_offset = 32;
|
float msg_offset = 32;
|
||||||
|
|
||||||
@ -283,7 +289,8 @@ static void xui_render_message(const char *msg)
|
|||||||
font_parms.scale = 21;
|
font_parms.scale = 21;
|
||||||
|
|
||||||
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data,
|
||||||
|
msg, &font_parms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +317,8 @@ static void rmenu_xui_frame(void)
|
|||||||
|
|
||||||
XUIMessage msg;
|
XUIMessage msg;
|
||||||
XUIMessageRender msgRender;
|
XUIMessageRender msgRender;
|
||||||
XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
|
XuiMessageRender( &msg, &msgRender,
|
||||||
|
app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
|
||||||
XuiSendMessage( app.GetRootObj(), &msg );
|
XuiSendMessage( app.GetRootObj(), &msg );
|
||||||
|
|
||||||
XuiRenderSetViewTransform( app.GetDC(), &matOrigView );
|
XuiRenderSetViewTransform( app.GetDC(), &matOrigView );
|
||||||
@ -392,9 +400,11 @@ static void rmenu_xui_render(void)
|
|||||||
|
|
||||||
rmenu_xui_render_background();
|
rmenu_xui_render_background();
|
||||||
|
|
||||||
file_list_get_last(driver.menu->menu_stack, &dir, &label, &menu_type);
|
file_list_get_last(driver.menu->menu_stack, &dir,
|
||||||
|
&label, &menu_type);
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->type_is)
|
if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
|
&& driver.menu_ctx->backend->type_is)
|
||||||
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
|
menu_type_is = driver.menu_ctx->backend->type_is(menu_type);
|
||||||
|
|
||||||
if (menu_type == MENU_SETTINGS_CORE)
|
if (menu_type == MENU_SETTINGS_CORE)
|
||||||
@ -521,7 +531,8 @@ static void rmenu_xui_render(void)
|
|||||||
XuiTextElementSetText(m_menutitle, strw_buffer);
|
XuiTextElementSetText(m_menutitle, strw_buffer);
|
||||||
|
|
||||||
char title_buf[256];
|
char title_buf[256];
|
||||||
menu_ticker_line(title_buf, RXUI_TERM_WIDTH - 3, g_extern.frame_count / 15, title, true);
|
menu_ticker_line(title_buf, RXUI_TERM_WIDTH - 3,
|
||||||
|
g_extern.frame_count / 15, title, true);
|
||||||
blit_line(RXUI_TERM_START_X + 15, 15, title_buf, true);
|
blit_line(RXUI_TERM_START_X + 15, 15, title_buf, true);
|
||||||
|
|
||||||
char title_msg[64];
|
char title_msg[64];
|
||||||
@ -537,8 +548,11 @@ static void rmenu_xui_render(void)
|
|||||||
if (!core_version)
|
if (!core_version)
|
||||||
core_version = "";
|
core_version = "";
|
||||||
|
|
||||||
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION, core_name, core_version);
|
snprintf(title_msg, sizeof(title_msg), "%s - %s %s",
|
||||||
blit_line(RXUI_TERM_START_X + 15, (RXUI_TERM_HEIGHT * FONT_HEIGHT_STRIDE) + RXUI_TERM_START_Y + 2, title_msg, true);
|
PACKAGE_VERSION, core_name, core_version);
|
||||||
|
blit_line(RXUI_TERM_START_X + 15,
|
||||||
|
(RXUI_TERM_HEIGHT * FONT_HEIGHT_STRIDE) + RXUI_TERM_START_Y + 2,
|
||||||
|
title_msg, true);
|
||||||
|
|
||||||
unsigned x, y;
|
unsigned x, y;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -551,12 +565,14 @@ static void rmenu_xui_render(void)
|
|||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
file_list_get_at_offset(driver.menu->selection_buf, i, &path, &label, &type);
|
file_list_get_at_offset(driver.menu->selection_buf, i,
|
||||||
|
&path, &label, &type);
|
||||||
char message[256];
|
char message[256];
|
||||||
char type_str[256];
|
char type_str[256];
|
||||||
|
|
||||||
unsigned w = 19;
|
unsigned w = 19;
|
||||||
if (menu_type == MENU_SETTINGS_INPUT_OPTIONS || menu_type == MENU_SETTINGS_CUSTOM_BIND)
|
if (menu_type == MENU_SETTINGS_INPUT_OPTIONS ||
|
||||||
|
menu_type == MENU_SETTINGS_CUSTOM_BIND)
|
||||||
w = 21;
|
w = 21;
|
||||||
else if (menu_type == MENU_SETTINGS_PATH_OPTIONS)
|
else if (menu_type == MENU_SETTINGS_PATH_OPTIONS)
|
||||||
w = 24;
|
w = 24;
|
||||||
@ -564,7 +580,8 @@ static void rmenu_xui_render(void)
|
|||||||
if (type >= MENU_SETTINGS_SHADER_FILTER &&
|
if (type >= MENU_SETTINGS_SHADER_FILTER &&
|
||||||
type <= MENU_SETTINGS_SHADER_LAST)
|
type <= MENU_SETTINGS_SHADER_LAST)
|
||||||
{
|
{
|
||||||
// HACK. Work around that we're using the menu_type as dir type to propagate state correctly.
|
/* HACK. Work around that we're using the menu_type as
|
||||||
|
* dir type to propagate state correctly. */
|
||||||
if ((menu_type_is == MENU_SETTINGS_SHADER_OPTIONS)
|
if ((menu_type_is == MENU_SETTINGS_SHADER_OPTIONS)
|
||||||
&& (menu_type_is == MENU_SETTINGS_SHADER_OPTIONS))
|
&& (menu_type_is == MENU_SETTINGS_SHADER_OPTIONS))
|
||||||
{
|
{
|
||||||
@ -572,17 +589,21 @@ static void rmenu_xui_render(void)
|
|||||||
strlcpy(type_str, "(DIR)", sizeof(type_str));
|
strlcpy(type_str, "(DIR)", sizeof(type_str));
|
||||||
w = 5;
|
w = 5;
|
||||||
}
|
}
|
||||||
else if (type == MENU_SETTINGS_SHADER_OPTIONS || type == MENU_SETTINGS_SHADER_PRESET)
|
else if (type == MENU_SETTINGS_SHADER_OPTIONS ||
|
||||||
|
type == MENU_SETTINGS_SHADER_PRESET)
|
||||||
strlcpy(type_str, "...", sizeof(type_str));
|
strlcpy(type_str, "...", sizeof(type_str));
|
||||||
else if (type == MENU_SETTINGS_SHADER_FILTER)
|
else if (type == MENU_SETTINGS_SHADER_FILTER)
|
||||||
snprintf(type_str, sizeof(type_str), "%s",
|
snprintf(type_str, sizeof(type_str), "%s",
|
||||||
g_settings.video.smooth ? "Linear" : "Nearest");
|
g_settings.video.smooth ? "Linear" : "Nearest");
|
||||||
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->shader_manager_get_str)
|
else if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
driver.menu_ctx->backend->shader_manager_get_str(driver.menu->shader, type_str, sizeof(type_str), type);
|
&& driver.menu_ctx->backend->shader_manager_get_str)
|
||||||
|
driver.menu_ctx->backend->shader_manager_get_str(
|
||||||
|
driver.menu->shader, type_str, sizeof(type_str), type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// Pretty-print libretro cores from menu.
|
// Pretty-print libretro cores from menu.
|
||||||
if (menu_type == MENU_SETTINGS_CORE || menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
if (menu_type == MENU_SETTINGS_CORE ||
|
||||||
|
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||||
{
|
{
|
||||||
if (type == MENU_FILE_PLAIN)
|
if (type == MENU_FILE_PLAIN)
|
||||||
{
|
{
|
||||||
@ -625,10 +646,13 @@ static void rmenu_xui_render(void)
|
|||||||
}
|
}
|
||||||
else if (type >= MENU_SETTINGS_CORE_OPTION_START)
|
else if (type >= MENU_SETTINGS_CORE_OPTION_START)
|
||||||
strlcpy(type_str,
|
strlcpy(type_str,
|
||||||
core_option_get_val(g_extern.system.core_options, type - MENU_SETTINGS_CORE_OPTION_START),
|
core_option_get_val(g_extern.system.core_options,
|
||||||
|
type - MENU_SETTINGS_CORE_OPTION_START),
|
||||||
sizeof(type_str));
|
sizeof(type_str));
|
||||||
else if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->setting_set_label)
|
else if (driver.menu_ctx && driver.menu_ctx->backend
|
||||||
driver.menu_ctx->backend->setting_set_label(type_str, sizeof(type_str), &w, type, i);
|
&& driver.menu_ctx->backend->setting_set_label)
|
||||||
|
driver.menu_ctx->backend->setting_set_label(type_str,
|
||||||
|
sizeof(type_str), &w, type, i);
|
||||||
|
|
||||||
if (type_str[0] == '\0' && w == 0)
|
if (type_str[0] == '\0' && w == 0)
|
||||||
{
|
{
|
||||||
@ -703,7 +727,8 @@ static void rmenu_xui_navigation_alphabet(void *data, size_t *ptr_out)
|
|||||||
XuiListSetCurSelVisible(m_menulist, *ptr_out);
|
XuiListSetCurSelVisible(m_menulist, *ptr_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rmenu_xui_list_insert(void *data, const char *path, size_t list_size)
|
static void rmenu_xui_list_insert(void *data,
|
||||||
|
const char *path, size_t list_size)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
wchar_t buf[PATH_MAX];
|
wchar_t buf[PATH_MAX];
|
||||||
|
@ -28,9 +28,10 @@ void menu_update_system_info(menu_handle_t *menu, bool *load_no_content)
|
|||||||
libretro_get_system_info(g_settings.libretro, &menu->info,
|
libretro_get_system_info(g_settings.libretro, &menu->info,
|
||||||
load_no_content);
|
load_no_content);
|
||||||
#endif
|
#endif
|
||||||
/* Keep track of info for the currently selected core. */
|
|
||||||
if (menu->core_info)
|
if (menu->core_info)
|
||||||
{
|
{
|
||||||
|
/* Keep track of info for the currently selected core. */
|
||||||
|
|
||||||
if (core_info_list_get_info(menu->core_info,
|
if (core_info_list_get_info(menu->core_info,
|
||||||
menu->core_info_current, g_settings.libretro))
|
menu->core_info_current, g_settings.libretro))
|
||||||
{
|
{
|
||||||
@ -55,8 +56,7 @@ void menu_update_system_info(menu_handle_t *menu, bool *load_no_content)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* When selection is presented back, returns 0.
|
/* When selection is presented back, returns 0.
|
||||||
* If it can make a decision right now, returns -1.
|
* If it can make a decision right now, returns -1. */
|
||||||
*/
|
|
||||||
int menu_defer_core(core_info_list_t *core_info, const char *dir,
|
int menu_defer_core(core_info_list_t *core_info, const char *dir,
|
||||||
const char *path, char *deferred_path, size_t sizeof_deferred_path)
|
const char *path, char *deferred_path, size_t sizeof_deferred_path)
|
||||||
{
|
{
|
||||||
@ -92,13 +92,12 @@ void menu_content_history_push_current(void)
|
|||||||
{
|
{
|
||||||
char tmp[PATH_MAX];
|
char tmp[PATH_MAX];
|
||||||
|
|
||||||
/* g_extern.fullpath can be relative here.
|
|
||||||
* Ensure we're pushing absolute path.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!g_extern.history)
|
if (!g_extern.history)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* g_extern.fullpath can be relative here.
|
||||||
|
* Ensure we're pushing absolute path. */
|
||||||
|
|
||||||
strlcpy(tmp, g_extern.fullpath, sizeof(tmp));
|
strlcpy(tmp, g_extern.fullpath, sizeof(tmp));
|
||||||
|
|
||||||
if (*tmp)
|
if (*tmp)
|
||||||
@ -183,6 +182,8 @@ void load_menu_content_history(unsigned game_index)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update menu state which depends on config. */
|
||||||
|
|
||||||
static void menu_update_libretro_info(menu_handle_t *menu)
|
static void menu_update_libretro_info(menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_DYNAMIC
|
#ifndef HAVE_DYNAMIC
|
||||||
@ -231,7 +232,6 @@ bool load_menu_content(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update menu state which depends on config. */
|
|
||||||
if (driver.menu)
|
if (driver.menu)
|
||||||
menu_update_libretro_info(driver.menu);
|
menu_update_libretro_info(driver.menu);
|
||||||
|
|
||||||
@ -519,8 +519,9 @@ bool menu_iterate(void)
|
|||||||
* Likely to have lots of small bugs.
|
* Likely to have lots of small bugs.
|
||||||
* Cleanly exit the main loop to ensure that all the tiny details
|
* Cleanly exit the main loop to ensure that all the tiny details
|
||||||
* get set properly.
|
* get set properly.
|
||||||
* This should mitigate most of the smaller bugs.
|
*
|
||||||
*/
|
* This should mitigate most of the smaller bugs. */
|
||||||
|
|
||||||
bool menu_replace_config(const char *path)
|
bool menu_replace_config(const char *path)
|
||||||
{
|
{
|
||||||
if (strcmp(path, g_extern.config_path) == 0)
|
if (strcmp(path, g_extern.config_path) == 0)
|
||||||
@ -539,8 +540,8 @@ bool menu_replace_config(const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Save a new config to a file. Filename is based
|
/* Save a new config to a file. Filename is based
|
||||||
* on heuristics to avoid typing.
|
* on heuristics to avoid typing. */
|
||||||
*/
|
|
||||||
bool menu_save_new_config(void)
|
bool menu_save_new_config(void)
|
||||||
{
|
{
|
||||||
char config_dir[PATH_MAX], config_name[PATH_MAX],
|
char config_dir[PATH_MAX], config_name[PATH_MAX],
|
||||||
@ -637,8 +638,7 @@ static inline int menu_list_get_first_char(file_list_t *buf,
|
|||||||
ret = tolower(*path);
|
ret = tolower(*path);
|
||||||
|
|
||||||
/* "Normalize" non-alphabetical entries so they are lumped together
|
/* "Normalize" non-alphabetical entries so they are lumped together
|
||||||
* for purposes of jumping.
|
* for purposes of jumping. */
|
||||||
*/
|
|
||||||
if (ret < 'a')
|
if (ret < 'a')
|
||||||
ret = 'a' - 1;
|
ret = 'a' - 1;
|
||||||
else if (ret > 'z')
|
else if (ret > 'z')
|
||||||
|
@ -220,8 +220,7 @@ static bool menu_poll_find_trigger_pad(struct menu_bind_state *state, struct men
|
|||||||
rested_distance >= 20000)
|
rested_distance >= 20000)
|
||||||
{
|
{
|
||||||
/* Take care of case where axis rests on +/- 0x7fff
|
/* Take care of case where axis rests on +/- 0x7fff
|
||||||
* (e.g. 360 controller on Linux)
|
* (e.g. 360 controller on Linux) */
|
||||||
*/
|
|
||||||
state->target->joyaxis = n->axes[a] > 0 ? AXIS_POS(a) : AXIS_NEG(a);
|
state->target->joyaxis = n->axes[a] > 0 ? AXIS_POS(a) : AXIS_NEG(a);
|
||||||
state->target->joykey = NO_BTN;
|
state->target->joykey = NO_BTN;
|
||||||
|
|
||||||
@ -271,7 +270,8 @@ bool menu_poll_find_trigger(struct menu_bind_state *state,
|
|||||||
{
|
{
|
||||||
if (menu_poll_find_trigger_pad(state, new_state, i))
|
if (menu_poll_find_trigger_pad(state, new_state, i))
|
||||||
{
|
{
|
||||||
// Update the joypad mapping automatically. More friendly that way.
|
/* Update the joypad mapping automatically.
|
||||||
|
* More friendly that way. */
|
||||||
g_settings.input.joypad_map[state->player] = i;
|
g_settings.input.joypad_map[state->player] = i;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user