Cleanups/style nits

This commit is contained in:
twinaphex 2018-04-23 12:03:50 +02:00
parent bac0d22ce9
commit 5370c59201
2 changed files with 208 additions and 204 deletions

View File

@ -605,7 +605,7 @@ static void materialui_compute_entries_box(materialui_handle_t* mui, int width)
char *sublabel_str = NULL;
unsigned lines = 0;
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, i);
file_list_get_userdata_at_offset(list, i);
menu_entry_init(&entry);
menu_entry_get(&entry, 0, i, NULL, true);
@ -641,7 +641,7 @@ static void materialui_compute_entries_box(materialui_handle_t* mui, int width)
}
/* Called on each frame. We use this callback to implement the touch scroll
with acceleration */
with acceleration */
static void materialui_render(void *data, bool is_idle)
{
menu_animation_ctx_delta_t delta;
@ -686,12 +686,12 @@ static void materialui_render(void *data, bool is_idle)
for (ii = 0; ii < entries_end; ii++)
{
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, ii);
file_list_get_userdata_at_offset(list, ii);
if (pointer_y > (-mui->scroll_y + header_height + node->y)
&& pointer_y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
menu_input_ctl(MENU_INPUT_CTL_POINTER_PTR, &ii);
&& pointer_y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
menu_input_ctl(MENU_INPUT_CTL_POINTER_PTR, &ii);
}
menu_input_ctl(MENU_INPUT_CTL_POINTER_ACCEL_READ, &old_accel_val);
@ -712,12 +712,12 @@ static void materialui_render(void *data, bool is_idle)
for (ii = 0; ii < entries_end; ii++)
{
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, ii);
file_list_get_userdata_at_offset(list, ii);
if (mouse_y > (-mui->scroll_y + header_height + node->y)
&& mouse_y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
menu_input_ctl(MENU_INPUT_CTL_MOUSE_PTR, &ii);
&& mouse_y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
menu_input_ctl(MENU_INPUT_CTL_MOUSE_PTR, &ii);
}
}
@ -799,7 +799,7 @@ static void materialui_render_label_value(
do_draw_text = true;
}
else if (string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) ||
(string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))))
(string_is_equal(value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))))
{
if (mui->textures.list[MUI_TEXTURE_SWITCH_ON])
{
@ -896,7 +896,7 @@ static void materialui_render_label_value(
0,
1,
&label_color[0]
);
);
if (texture_switch)
{
@ -959,7 +959,7 @@ static void materialui_render_menu_list(
char *rich_label = NULL;
bool entry_selected = false;
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, i);
file_list_get_userdata_at_offset(list, i);
size_t selection = menu_navigation_get_selection();
int y = header_height - mui->scroll_y + sum;
@ -982,21 +982,21 @@ static void materialui_render_menu_list(
/* Render label, value, and associated icons */
materialui_render_label_value(
mui,
video_info,
node,
(int)i,
y,
width,
height,
frame_count / 20,
font_hover_color,
entry_selected,
rich_label,
entry_value,
menu_list_color,
sublabel_color
);
mui,
video_info,
node,
(int)i,
y,
width,
height,
frame_count / 20,
font_hover_color,
entry_selected,
rich_label,
entry_value,
menu_list_color,
sublabel_color
);
menu_entry_free(&entry);
free(rich_label);
@ -1075,7 +1075,7 @@ static void materialui_draw_bg(menu_display_ctx_draw_t *draw,
}
/* Main function of the menu driver. Takes care of drawing the header, the tabs,
and the menu list */
and the menu list */
static void materialui_frame(void *data, video_frame_info_t *video_info)
{
/* This controls the main background color */
@ -1236,7 +1236,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
clearcolor.a = 0.75f;
break;
case MATERIALUI_THEME_GREEN:
hex32_to_rgba_normalized(0x4CAF50, green_500, 1.00);
hex32_to_rgba_normalized(0x4CAF50, green_500, 1.00);
hex32_to_rgba_normalized(0x4CAF50, header_bg_color_real, 1.00);
hex32_to_rgba_normalized(0xC8E6C9, green_50, 0.90);
hex32_to_rgba_normalized(0xFFFFFF, footer_bg_color_real, 1.00);
@ -1575,9 +1575,9 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
if (mui->font)
menu_display_draw_text(mui->font, title_buf,
title_margin,
header_height / 2 + mui->font->size / 3,
width, height, font_header_color, TEXT_ALIGN_LEFT, 1.0f, false, 0);
title_margin,
header_height / 2 + mui->font->size / 3,
width, height, font_header_color, TEXT_ALIGN_LEFT, 1.0f, false, 0);
materialui_draw_scrollbar(mui, video_info, width, height, &grey_bg[0]);
@ -1591,7 +1591,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
materialui_render_messagebox(mui, video_info,
msg, &body_bg_color[0], font_hover_color);
msg, &body_bg_color[0], font_hover_color);
}
if (!string_is_empty(mui->box_message))
@ -1600,7 +1600,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
0, 0, width, height, width, height, &black_bg[0]);
materialui_render_messagebox(mui, video_info,
mui->box_message, &body_bg_color[0], font_hover_color);
mui->box_message, &body_bg_color[0], font_hover_color);
free(mui->box_message);
mui->box_message = NULL;
@ -1795,10 +1795,10 @@ static float materialui_get_scroll(materialui_handle_t *mui)
for (i = 0; i < selection; i++)
{
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, i);
file_list_get_userdata_at_offset(list, i);
if (node)
sum += node->line_height;
sum += node->line_height;
}
if (sum < half)
@ -1808,7 +1808,7 @@ static float materialui_get_scroll(materialui_handle_t *mui)
}
/* The navigation pointer has been updated (for example by pressing up or down
on the keyboard). We use this function to animate the scroll. */
on the keyboard). We use this function to animate the scroll. */
static void materialui_navigation_set(void *data, bool scroll)
{
menu_animation_ctx_entry_t entry;
@ -1953,7 +1953,7 @@ static void materialui_preswitch_tabs(materialui_handle_t *mui, unsigned action)
}
/* This callback is not caching anything. We use it to navigate the tabs
with the keyboard */
with the keyboard */
static void materialui_list_cache(void *data,
enum menu_list_type type, unsigned action)
{
@ -2003,7 +2003,7 @@ static void materialui_list_cache(void *data,
}
/* A new list has been pushed. We use this callback to customize a few lists for
this menu driver */
this menu driver */
static int materialui_list_push(void *data, void *userdata,
menu_displaylist_info_t *info, unsigned type)
{
@ -2176,7 +2176,7 @@ static size_t materialui_list_get_selection(void *data)
}
/* The pointer or the mouse is pressed down. We use this callback to
highlight the entry that has been pressed */
highlight the entry that has been pressed */
static int materialui_pointer_down(void *userdata,
unsigned x, unsigned y,
unsigned ptr, menu_file_list_cbs_t *cbs,
@ -2209,11 +2209,11 @@ static int materialui_pointer_down(void *userdata,
for (ii = 0; ii < entries_end; ii++)
{
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, ii);
file_list_get_userdata_at_offset(list, ii);
if (y > (-mui->scroll_y + header_height + node->y)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
menu_navigation_set_selection(ii);
}
@ -2224,9 +2224,9 @@ static int materialui_pointer_down(void *userdata,
}
/* The pointer or the left mouse button has been released.
If we clicked on the header, we perform a cancel action.
If we clicked on the tabs, we switch to a new list.
If we clicked on a menu entry, we call the entry action callback. */
If we clicked on the header, we perform a cancel action.
If we clicked on the tabs, we switch to a new list.
If we clicked on a menu entry, we call the entry action callback. */
static int materialui_pointer_up(void *userdata,
unsigned x, unsigned y,
unsigned ptr, menu_file_list_cbs_t *cbs,
@ -2278,11 +2278,11 @@ static int materialui_pointer_up(void *userdata,
for (ii = 0; ii < entries_end; ii++)
{
materialui_node_t *node = (materialui_node_t*)
file_list_get_userdata_at_offset(list, ii);
file_list_get_userdata_at_offset(list, ii);
if (y > (-mui->scroll_y + header_height + node->y)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
&& y < (-mui->scroll_y + header_height + node->y + node->line_height)
)
{
if (ptr == ii && cbs && cbs->action_select)
return menu_entry_action(entry, (unsigned)ii, MENU_ACTION_SELECT);

View File

@ -105,9 +105,11 @@ enum
#ifdef HAVE_NETWORKING
XMB_TEXTURE_NETPLAY,
XMB_TEXTURE_ROOM,
/* stub these out until we have the icons
#if 0
/* stub these out until we have the icons */
XMB_TEXTURE_ROOM_LAN,
XMB_TEXTURE_ROOM_MITM,*/
XMB_TEXTURE_ROOM_MITM,
#endif
#endif
#ifdef HAVE_IMAGEVIEWER
XMB_TEXTURE_IMAGES,
@ -317,9 +319,9 @@ static float item_color[] = {
float gradient_dark_purple[16] = {
20/255.0, 13/255.0, 20/255.0, 1.0,
20/255.0, 13/255.0, 20/255.0, 1.0,
92/255.0, 44/255.0, 92/255.0, 1.0,
20/255.0, 13/255.0, 20/255.0, 1.0,
20/255.0, 13/255.0, 20/255.0, 1.0,
92/255.0, 44/255.0, 92/255.0, 1.0,
148/255.0, 90/255.0, 148/255.0, 1.0,
};
@ -345,24 +347,24 @@ float gradient_legacy_red[16] = {
};
float gradient_electric_blue[16] = {
1/255.0, 2/255.0, 67/255.0, 1.0,
1/255.0, 73/255.0, 183/255.0, 1.0,
1/255.0, 93/255.0, 194/255.0, 1.0,
3/255.0, 162/255.0, 254/255.0, 1.0,
1/255.0, 2/255.0, 67/255.0, 1.0,
1/255.0, 73/255.0, 183/255.0, 1.0,
1/255.0, 93/255.0, 194/255.0, 1.0,
3/255.0, 162/255.0, 254/255.0, 1.0,
};
float gradient_apple_green[16] = {
102/255.0, 134/255.0, 58/255.0, 1.0,
122/255.0, 131/255.0, 52/255.0, 1.0,
82/255.0, 101/255.0, 35/255.0, 1.0,
63/255.0, 95/255.0, 30/255.0, 1.0,
82/255.0, 101/255.0, 35/255.0, 1.0,
63/255.0, 95/255.0, 30/255.0, 1.0,
};
float gradient_undersea[16] = {
23/255.0, 18/255.0, 41/255.0, 1.0,
30/255.0, 72/255.0, 114/255.0, 1.0,
52/255.0, 88/255.0, 110/255.0, 1.0,
69/255.0, 125/255.0, 140/255.0, 1.0,
23/255.0, 18/255.0, 41/255.0, 1.0,
30/255.0, 72/255.0, 114/255.0, 1.0,
52/255.0, 88/255.0, 110/255.0, 1.0,
69/255.0, 125/255.0, 140/255.0, 1.0,
};
@ -445,15 +447,15 @@ static xmb_node_t *xmb_alloc_node(void)
static void xmb_free_node(xmb_node_t *node)
{
if (!node)
return;
if (!node)
return;
if (node->fullpath)
free(node->fullpath);
if (node->fullpath)
free(node->fullpath);
node->fullpath = NULL;
node->fullpath = NULL;
free(node);
free(node);
}
/**
@ -908,8 +910,8 @@ static void xmb_update_thumbnail_path(void *data, unsigned i, char pos)
file_list_get_userdata_at_offset(selection_buf, i);
if (!string_is_empty(node->fullpath) &&
(pos == 'R' || (pos == 'L' && string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))))
(pos == 'R' || (pos == 'L' && string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))))
{
if (!string_is_empty(entry.path))
fill_pathname_join(
@ -1099,28 +1101,28 @@ static void xmb_update_thumbnail_image(void *data)
return;
if (!(string_is_empty(xmb->thumbnail_file_path)))
{
if (filestream_exists(xmb->thumbnail_file_path))
task_push_image_load(xmb->thumbnail_file_path,
menu_display_handle_thumbnail_upload, NULL);
else
xmb->thumbnail = 0;
{
if (filestream_exists(xmb->thumbnail_file_path))
task_push_image_load(xmb->thumbnail_file_path,
menu_display_handle_thumbnail_upload, NULL);
else
xmb->thumbnail = 0;
free(xmb->thumbnail_file_path);
xmb->thumbnail_file_path = NULL;
}
free(xmb->thumbnail_file_path);
xmb->thumbnail_file_path = NULL;
}
if (!(string_is_empty(xmb->left_thumbnail_file_path)))
{
if (filestream_exists(xmb->left_thumbnail_file_path))
task_push_image_load(xmb->left_thumbnail_file_path,
menu_display_handle_left_thumbnail_upload, NULL);
else
xmb->left_thumbnail = 0;
{
if (filestream_exists(xmb->left_thumbnail_file_path))
task_push_image_load(xmb->left_thumbnail_file_path,
menu_display_handle_left_thumbnail_upload, NULL);
else
xmb->left_thumbnail = 0;
free(xmb->left_thumbnail_file_path);
xmb->left_thumbnail_file_path = NULL;
}
free(xmb->left_thumbnail_file_path);
xmb->left_thumbnail_file_path = NULL;
}
}
static void xmb_set_thumbnail_system(void *data, char*s, size_t len)
@ -1232,22 +1234,22 @@ static void xmb_selection_pointer_changed(
ia = xmb->items_active_alpha;
iz = xmb->items_active_zoom;
if (!string_is_equal(thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) || !string_is_equal(lft_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) || !string_is_equal(lft_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
if ((xmb_system_tab > XMB_SYSTEM_TAB_SETTINGS && depth == 1) ||
(xmb_system_tab < XMB_SYSTEM_TAB_SETTINGS && depth == 4))
(xmb_system_tab < XMB_SYSTEM_TAB_SETTINGS && depth == 4))
{
if (!string_is_empty(entry.path))
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
if (!string_is_equal(thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'R');
xmb_update_thumbnail_image(xmb);
}
if (!string_is_equal(lft_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'L');
xmb_update_thumbnail_image(xmb);
@ -1255,18 +1257,18 @@ static void xmb_selection_pointer_changed(
}
else if (((entry_type == FILE_TYPE_IMAGE || entry_type == FILE_TYPE_IMAGEVIEWER ||
entry_type == FILE_TYPE_RDB || entry_type == FILE_TYPE_RDB_ENTRY)
&& xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS))
&& xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS))
{
if (!string_is_empty(entry.path))
xmb_set_thumbnail_content(xmb, entry.path, 0 /* will be ignored */);
if (!string_is_equal(thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'R');
xmb_update_thumbnail_image(xmb);
}
else if (!string_is_equal(lft_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'L');
xmb_update_thumbnail_image(xmb);
@ -1276,13 +1278,13 @@ static void xmb_selection_pointer_changed(
{
xmb_reset_thumbnail_content(xmb);
if (!string_is_equal(thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'R');
xmb_update_thumbnail_image(xmb);
}
else if (!string_is_equal(lft_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
xmb_update_thumbnail_path(xmb, i, 'L');
xmb_update_thumbnail_image(xmb);
@ -1295,7 +1297,7 @@ static void xmb_selection_pointer_changed(
if ( (!allow_animations)
|| (real_iy < -threshold
|| real_iy > height+threshold))
|| real_iy > height+threshold))
{
node->alpha = node->label_alpha = ia;
node->y = iy;
@ -1606,19 +1608,19 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
fill_pathname_application_special(path, path_size,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG);
if(!string_is_equal(path, xmb->bg_file_path))
{
if(filestream_exists(path))
{
task_push_image_load(path,
if(!string_is_equal(path, xmb->bg_file_path))
{
if(filestream_exists(path))
{
task_push_image_load(path,
menu_display_handle_wallpaper_upload, NULL);
if (!string_is_empty(xmb->bg_file_path))
free(xmb->bg_file_path);
xmb->bg_file_path = strdup(path);
}
}
if (!string_is_empty(xmb->bg_file_path))
free(xmb->bg_file_path);
xmb->bg_file_path = strdup(path);
}
}
free(path);
free(path);
}
end = file_list_get_size(list);
@ -1987,7 +1989,7 @@ static void xmb_context_reset_horizontal_list(
malloc(PATH_MAX_LENGTH * sizeof(char));
iconpath[0] = sysname[0] =
texturepath[0] = content_texturepath[0] = '\0';
texturepath[0] = content_texturepath[0] = '\0';
fill_pathname_base_noext(sysname, path, sizeof(sysname));
@ -2324,7 +2326,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_ROOM:
return xmb->textures.list[XMB_TEXTURE_ROOM];
#if 0
/* stub these out until we have the icons */
/* stub these out until we have the icons */
case MENU_ROOM_LAN:
return xmb->textures.list[XMB_TEXTURE_ROOM_LAN];
case MENU_ROOM_MITM:
@ -2494,7 +2496,7 @@ static int xmb_draw_item(
{
}
else
do_draw_text = true;
do_draw_text = true;
}
else
do_draw_text = true;
@ -2508,7 +2510,7 @@ static int xmb_draw_item(
(thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
&& xmb->thumbnail) ||
(!string_is_equal
(!string_is_equal
(left_thumb_ident,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))
&& xmb->left_thumbnail
@ -2689,7 +2691,7 @@ static void xmb_draw_items(
if (list == xmb->selection_buf_old)
{
xmb_node_t *node = (xmb_node_t*)
file_list_get_userdata_at_offset(list, current);
file_list_get_userdata_at_offset(list, current);
if (node && (uint8_t)(255 * node->alpha) == 0)
return;
@ -2986,7 +2988,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
xmb->raster_block2.carr.coords.vertices = 0;
menu_display_set_alpha(coord_black, MIN(
(float)video_info->xmb_alpha_factor/100, xmb->alpha));
(float)video_info->xmb_alpha_factor/100, xmb->alpha));
menu_display_set_alpha(coord_white, xmb->alpha);
xmb_draw_bg(
@ -3046,31 +3048,31 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
if (xmb->savestate_thumbnail)
{
xmb_draw_thumbnail(video_info,
xmb, &coord_white[0], width, height,
xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal + pseudo_font_length,
xmb->margins_screen_top + xmb->icon_size +
xmb->savestate_thumbnail_height * scale_mod[4],
xmb->savestate_thumbnail_width * scale_mod[4],
xmb->savestate_thumbnail_height * scale_mod[4],
xmb->savestate_thumbnail);
xmb, &coord_white[0], width, height,
xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal + pseudo_font_length,
xmb->margins_screen_top + xmb->icon_size +
xmb->savestate_thumbnail_height * scale_mod[4],
xmb->savestate_thumbnail_width * scale_mod[4],
xmb->savestate_thumbnail_height * scale_mod[4],
xmb->savestate_thumbnail);
}
/* Right thumbnail big size */
if (!settings->bools.menu_xmb_vertical_thumbnails ||
(settings->bools.menu_xmb_vertical_thumbnails && !xmb->left_thumbnail))
(settings->bools.menu_xmb_vertical_thumbnails && !xmb->left_thumbnail))
{
/* Do not draw the right thumbnail if there is no space available */
if (((xmb->margins_screen_top +
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
{
if (xmb->thumbnail
&& !string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
&& !string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
/* Limit thumbnail width */
@ -3080,11 +3082,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
- (xmb->margins_screen_left * scale_mod[5]) -
xmb->icon_spacing_horizontal - pseudo_font_length;
#ifdef XMB_DEBUG
#ifdef XMB_DEBUG
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
xmb->thumbnail_width, xmb->thumbnail_height);
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
#endif
#endif
if (xmb->thumbnail_width * scale_mod[4] > thumb_max_width)
{
@ -3129,7 +3131,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
/* Do not draw the left thumbnail if there is no space available */
if (!settings->bools.menu_xmb_vertical_thumbnails &&
(xmb->margins_screen_top + xmb->icon_size *
(!(xmb->depth == 1)? 2.1 : 1) + min_thumb_size)
(!(xmb->depth == 1)? 2.1 : 1) + min_thumb_size)
<= (float)height)
{
/* Left Thumbnail in the left margin */
@ -3144,11 +3146,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
float left_thumb_height = 0.0f;
float thumb_max_width = xmb->icon_size * 3.4;
#ifdef XMB_DEBUG
#ifdef XMB_DEBUG
RARCH_LOG("[XMB left thumbnail] width: %.2f, height: %.2f\n",
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
RARCH_LOG("[XMB left thumbnail] w: %.2f, h: %.2f\n", width, height);
#endif
#endif
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
{
@ -3187,7 +3189,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
(xmb->icon_size / 6) +
((thumb_max_width - left_thumb_width) / 2),
xmb->margins_screen_top + xmb->icon_size *
(!(xmb->depth == 1)? 2.1 : 1) + left_thumb_height,
(!(xmb->depth == 1)? 2.1 : 1) + left_thumb_height,
left_thumb_width, left_thumb_height,
xmb->left_thumbnail);
}
@ -3200,13 +3202,13 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
if (((xmb->margins_screen_top +
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
{
if (xmb->left_thumbnail
&& !string_is_equal(xmb_thumbnails_ident('L'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
&& !string_is_equal(xmb_thumbnails_ident('L'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
/* Limit left thumbnail width */
@ -3216,11 +3218,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
- (xmb->margins_screen_left * scale_mod[5]) -
xmb->icon_spacing_horizontal - pseudo_font_length;
#ifdef XMB_DEBUG
#ifdef XMB_DEBUG
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
xmb->thumbnail_width, xmb->thumbnail_height);
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
#endif
#endif
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
{
@ -3238,16 +3240,16 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
/* Limit left thumbnail height to screen height + margin. */
if (xmb->margins_screen_top + xmb->icon_size + left_thumb_height >=
((float)height * under_thumb_margin))
((float)height * under_thumb_margin))
{
left_thumb_width = left_thumb_width *
((((float)height * under_thumb_margin) -
xmb->margins_screen_top - xmb->icon_size) /
left_thumb_height);
xmb->margins_screen_top - xmb->icon_size) /
left_thumb_height);
left_thumb_height = left_thumb_height *
((((float)height * under_thumb_margin) -
xmb->margins_screen_top - xmb->icon_size) /
left_thumb_height);
xmb->margins_screen_top - xmb->icon_size) /
left_thumb_height);
}
xmb_draw_thumbnail(video_info,
@ -3390,7 +3392,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
/* Horizontal tab icons */
for (i = 0; i <= xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
+ xmb->system_tab_end; i++)
+ xmb->system_tab_end; i++)
{
xmb_node_t *node = xmb_get_node(xmb, i);
@ -3405,9 +3407,9 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
math_matrix_4x4 mymat;
uintptr_t texture = node->icon;
float x = xmb->x + xmb->categories_x_pos +
xmb->margins_screen_left +
xmb->icon_spacing_horizontal
* (i + 1) - xmb->icon_size / 2.0;
xmb->margins_screen_left +
xmb->icon_spacing_horizontal
* (i + 1) - xmb->icon_size / 2.0;
float y = xmb->margins_screen_top
+ xmb->icon_size / 2.0;
float rotation = 0;
@ -3444,14 +3446,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
{
/* Do not draw the right thumbnail if there is no space available */
if (((xmb->margins_screen_top +
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
{
if (xmb->thumbnail &&
!string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
!string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
/* Limit right thumbnail width */
@ -3461,11 +3463,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
(xmb->margins_screen_left * scale_mod[5]) -
xmb->icon_spacing_horizontal - pseudo_font_length;
#ifdef XMB_DEBUG
#ifdef XMB_DEBUG
RARCH_LOG("[XMB thumbnail] width: %.2f, height: %.2f\n",
xmb->thumbnail_width, xmb->thumbnail_height);
xmb->thumbnail_width, xmb->thumbnail_height);
RARCH_LOG("[XMB thumbnail] w: %.2f, h: %.2f\n", width, height);
#endif
#endif
if (xmb->thumbnail_width * scale_mod[4] > thumb_max_width)
{
@ -3483,39 +3485,39 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
/* Limit right thumbnail height to usable area. */
if (thumb_height >=
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
{
thumb_width = thumb_width *
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
thumb_height);
thumb_height);
thumb_height = thumb_height *
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
thumb_height);
thumb_height);
}
xmb_draw_thumbnail(video_info,
xmb, &coord_white[0], width, height,
(float)width - (xmb->icon_size / 6) - thumb_max_width +
((thumb_max_width - thumb_width) / 2),
xmb->icon_size + ((((float)height / 2 -
(xmb->icon_size + (xmb->icon_size/12))) - thumb_height) / 2) +
thumb_height,
thumb_width, thumb_height,
xmb->thumbnail);
xmb, &coord_white[0], width, height,
(float)width - (xmb->icon_size / 6) - thumb_max_width +
((thumb_max_width - thumb_width) / 2),
xmb->icon_size + ((((float)height / 2 -
(xmb->icon_size + (xmb->icon_size/12))) - thumb_height) / 2) +
thumb_height,
thumb_width, thumb_height,
xmb->thumbnail);
}
}
/* Do not draw the left thumbnail if there is no space available */
if (((xmb->margins_screen_top +
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
xmb->icon_size + min_thumb_size) <= height) &&
((xmb->margins_screen_left * scale_mod[5] +
xmb->icon_spacing_horizontal +
pseudo_font_length + min_thumb_size) <= width))
{
if (xmb->left_thumbnail &&
!string_is_equal(xmb_thumbnails_ident('L'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
!string_is_equal(xmb_thumbnails_ident('L'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
{
/* Limit left thumbnail width */
@ -3525,11 +3527,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
(xmb->margins_screen_left * scale_mod[5]) -
xmb->icon_spacing_horizontal - pseudo_font_length;
#ifdef XMB_DEBUG
#ifdef XMB_DEBUG
RARCH_LOG("[XMB left thumbnail] width: %.2f, height: %.2f\n",
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
xmb->left_thumbnail_width, xmb->left_thumbnail_height);
RARCH_LOG("[XMB left thumbnail] w: %.2f, h: %.2f\n", width, height);
#endif
#endif
if (xmb->left_thumbnail_width * scale_mod[4] > thumb_max_width)
{
@ -3547,26 +3549,26 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
/* Limit left thumbnail height to usable area. */
if (left_thumb_height >=
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2)
{
left_thumb_width = left_thumb_width *
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
left_thumb_height);
left_thumb_height);
left_thumb_height = left_thumb_height *
((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) /
left_thumb_height);
left_thumb_height);
}
xmb_draw_thumbnail(video_info,
xmb, &coord_white[0], width, height,
(float)width - (xmb->icon_size / 6) - thumb_max_width +
xmb, &coord_white[0], width, height,
(float)width - (xmb->icon_size / 6) - thumb_max_width +
((thumb_max_width - left_thumb_width) / 2),
xmb->icon_size +
xmb->icon_size +
(((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) +
(((((float)height - ((xmb->icon_size / 6) * 2) - xmb->icon_size) / 2) -
left_thumb_height) / 2) + left_thumb_height,
left_thumb_width, left_thumb_height,
xmb->left_thumbnail);
left_thumb_height) / 2) + left_thumb_height,
left_thumb_width, left_thumb_height,
xmb->left_thumbnail);
}
}
}
@ -3918,23 +3920,24 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
/* scaling multiplier formulas made from these values: */
/* xmb_scale 50 = {2.5, 2.5, 2, 1.7, 2.5, 4, 2.4, 2.5} */
/* xmb_scale 75 = { 2, 1.6, 1.6, 1.4, 1.5, 2.3, 1.9, 1.3} */
if (scale_value < 100)
{
/* text length & word wrap (base 35 apply to file browser, 1st column) */
/* text length & word wrap (base 35 apply to file browser, 1st column) */
scale_mod[0] = -0.03 * scale_value + 4.083;
/* playlist text length when thumbnail is ON (small, base 40) */
/* playlist text length when thumbnail is ON (small, base 40) */
scale_mod[1] = -0.03 * scale_value + 3.95;
/* playlist text length when thumbnail is OFF (large, base 70) */
/* playlist text length when thumbnail is OFF (large, base 70) */
scale_mod[2] = -0.02 * scale_value + 3.033;
/* sub-label length & word wrap */
/* sub-label length & word wrap */
scale_mod[3] = -0.014 * scale_value + 2.416;
/* thumbnail size & vertical margin from top */
/* thumbnail size & vertical margin from top */
scale_mod[4] = -0.03 * scale_value + 3.916;
/* thumbnail horizontal left margin (horizontal positioning) */
/* thumbnail horizontal left margin (horizontal positioning) */
scale_mod[5] = -0.06 * scale_value + 6.933;
/* margin before 2nd column start (shaders parameters, cheats...) */
/* margin before 2nd column start (shaders parameters, cheats...) */
scale_mod[6] = -0.028 * scale_value + 3.866;
/* text length & word wrap (base 35 apply to 2nd column in cheats, shaders, etc) */
/* text length & word wrap (base 35 apply to 2nd column in cheats, shaders, etc) */
scale_mod[7] = 134.179 * pow(scale_value, -1.0778);
for (i = 0; i < 8; i++)
@ -4249,12 +4252,13 @@ static const char *xmb_texture_path(unsigned id)
return "netplay.png";
case XMB_TEXTURE_ROOM:
return "room.png";
/* stub these out until we have the icons
#if 0
/* stub these out until we have the icons */
case XMB_TEXTURE_ROOM_LAN:
return "room_lan.png";
case XMB_TEXTURE_ROOM_MITM:
return "room_mitm.png";
*/
#endif
#endif
case XMB_TEXTURE_KEY:
return "key.png";
@ -4745,7 +4749,7 @@ static void xmb_toggle(void *userdata, bool menu_on)
static int deferred_push_content_actions(menu_displaylist_info_t *info)
{
if (!menu_displaylist_ctl(
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
return -1;
menu_displaylist_process(info);
menu_displaylist_info_free(info);