diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 895d00b260..fedeb0a5c9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -759,20 +759,20 @@ static float *xmb_gradient_ident(unsigned xmb_color_theme) return &gradient_morning_blue[0]; case XMB_THEME_SUNBEAM: return &gradient_sunbeam[0]; - case XMB_THEME_LIME: + case XMB_THEME_LIME: return &gradient_lime_green[0]; - case XMB_THEME_MIDGAR: + case XMB_THEME_MIDGAR: return &gradient_midgar[0]; - case XMB_THEME_PIKACHU_YELLOW: - return &gradient_pikachu_yellow[0]; - case XMB_THEME_GAMECUBE_PURPLE: - return &gradient_gamecube_purple[0]; - case XMB_THEME_FAMICOM_RED: - return &gradient_famicom_red[0]; - case XMB_THEME_FLAMING_HOT: - return &gradient_flaming_hot[0]; - case XMB_THEME_ICE_COLD: - return &gradient_ice_cold[0]; + case XMB_THEME_PIKACHU_YELLOW: + return &gradient_pikachu_yellow[0]; + case XMB_THEME_GAMECUBE_PURPLE: + return &gradient_gamecube_purple[0]; + case XMB_THEME_FAMICOM_RED: + return &gradient_famicom_red[0]; + case XMB_THEME_FLAMING_HOT: + return &gradient_flaming_hot[0]; + case XMB_THEME_ICE_COLD: + return &gradient_ice_cold[0]; case XMB_THEME_LEGACY_RED: default: break; @@ -783,7 +783,7 @@ static float *xmb_gradient_ident(unsigned xmb_color_theme) static size_t xmb_list_get_selection(void *data) { - xmb_handle_t *xmb = (xmb_handle_t*)data; + xmb_handle_t *xmb = (xmb_handle_t*)data; if (!xmb) return 0; @@ -793,7 +793,7 @@ static size_t xmb_list_get_selection(void *data) static size_t xmb_list_get_size(void *data, enum menu_list_type type) { - xmb_handle_t *xmb = (xmb_handle_t*)data; + xmb_handle_t *xmb = (xmb_handle_t*)data; switch (type) { @@ -811,8 +811,8 @@ static size_t xmb_list_get_size(void *data, enum menu_list_type type) static void *xmb_list_get_entry(void *data, enum menu_list_type type, unsigned i) { - size_t list_size = 0; - xmb_handle_t *xmb = (xmb_handle_t*)data; + size_t list_size = 0; + xmb_handle_t *xmb = (xmb_handle_t*)data; switch (type) { @@ -1002,8 +1002,7 @@ static void xmb_render_messagebox_internal( string_list_initialize(&list); - if ( - !string_split_noalloc(&list, wrapped_message, "\n") + if (!string_split_noalloc(&list, wrapped_message, "\n") || list.elems == 0 ) { @@ -1144,7 +1143,7 @@ static void xmb_update_savestate_thumbnail_path(void *data, unsigned i) settings_t *settings = config_get_ptr(); xmb_handle_t *xmb = (xmb_handle_t*)data; int state_slot = settings->ints.state_slot; - bool savestate_thumbnail_enable + bool savestate_thumbnail_enable = settings->bools.savestate_thumbnail_enable; if (!xmb) return; @@ -1291,7 +1290,7 @@ static void xmb_refresh_thumbnail_image(void *data, unsigned i) return; /* Only refresh thumbnails if thumbnails are enabled */ - if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { unsigned depth = (unsigned)xmb_list_get_size(xmb, MENU_LIST_PLAIN); @@ -1418,7 +1417,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s) entry.value_enabled = false; entry.sublabel_enabled = false; menu_entry_get(&entry, 0, selection, NULL, true); - if ( !string_is_empty(entry.path) && + if ( !string_is_empty(entry.path) && !string_is_empty(node->fullpath)) { gfx_thumbnail_set_content_image(xmb->thumbnail_path_data, @@ -1525,7 +1524,7 @@ static void xmb_selection_pointer_changed( iz = xmb->items_active_zoom; if ( - gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT) ) { @@ -1780,7 +1779,7 @@ static void xmb_list_open_new(xmb_handle_t *xmb, if (xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS) { - if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { /* This code is horrible, full of hacks... @@ -2234,8 +2233,8 @@ static void xmb_context_reset_horizontal_list( for (i = 0; i < list_size; i++) { - const char *path = NULL; - xmb_node_t *node = + const char *path = NULL; + xmb_node_t *node = xmb_get_userdata_from_horizontal_list(xmb, i); if (!node) @@ -2369,8 +2368,8 @@ static void xmb_list_open(xmb_handle_t *xmb) gfx_animation_ctx_entry_t entry; settings_t *settings = config_get_ptr(); - unsigned - menu_xmb_animation_opening_main_menu = + unsigned + menu_xmb_animation_opening_main_menu = settings->uints.menu_xmb_animation_opening_main_menu; int dir = 0; file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); @@ -3161,7 +3160,7 @@ static int xmb_draw_item( bool use_smooth_ticker = settings->bools.menu_ticker_smooth; enum gfx_animation_ticker_type menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type; - unsigned xmb_thumbnail_scale_factor = + unsigned xmb_thumbnail_scale_factor = settings->uints.menu_xmb_thumbnail_scale_factor; bool menu_xmb_vertical_thumbnails = settings->bools.menu_xmb_vertical_thumbnails; bool menu_show_sublabels = settings->bools.menu_show_sublabels; @@ -3255,22 +3254,22 @@ static int xmb_draw_item( ) { if ( - string_is_equal(entry.value, "(PRESET)") || - string_is_equal(entry.value, "(SHADER)") || - string_is_equal(entry.value, "(COMP)") || - string_is_equal(entry.value, "(CORE)") || - string_is_equal(entry.value, "(MOVIE)") || - string_is_equal(entry.value, "(MUSIC)") || - string_is_equal(entry.value, "(DIR)") || - string_is_equal(entry.value, "(RDB)") || - string_is_equal(entry.value, "(CURSOR)")|| - string_is_equal(entry.value, "(CFILE)") || - string_is_equal(entry.value, "(FILE)") || + string_is_equal(entry.value, "(PRESET)") || + string_is_equal(entry.value, "(SHADER)") || + string_is_equal(entry.value, "(COMP)") || + string_is_equal(entry.value, "(CORE)") || + string_is_equal(entry.value, "(MOVIE)") || + string_is_equal(entry.value, "(MUSIC)") || + string_is_equal(entry.value, "(DIR)") || + string_is_equal(entry.value, "(RDB)") || + string_is_equal(entry.value, "(CURSOR)") || + string_is_equal(entry.value, "(CFILE)") || + string_is_equal(entry.value, "(FILE)") || string_is_equal(entry.value, "(IMAGE)") ) found = true; } - + if (!found) do_draw_text = true; } @@ -3954,7 +3953,7 @@ static int xmb_menu_entry_action( } -static void xmb_render(void *data, +static void xmb_render(void *data, unsigned width, unsigned height, bool is_idle) { /* 'i' must be of 'size_t', since it is passed @@ -4165,7 +4164,7 @@ static bool xmb_shader_pipeline_active(unsigned menu_shader_pipeline) return false; return true; } - + static void xmb_draw_bg( void *userdata, gfx_display_t *p_disp, @@ -4319,7 +4318,7 @@ static void xmb_draw_dark_layer( 0, 0, 0, 1, 0, 0, 0, 1, }; - gfx_display_ctx_driver_t + gfx_display_ctx_driver_t *dispctx = p_disp->dispctx; draw.x = 0; @@ -4412,7 +4411,7 @@ static void xmb_draw_fullscreen_thumbnails( int header_height = show_header ? (int)((float)xmb->font_size * 1.2f) + (frame_width * 2) : 0; bool xmb_vertical_thumbnails = settings->bools.menu_xmb_vertical_thumbnails; bool menu_ticker_smooth = settings->bools.menu_ticker_smooth; - enum gfx_animation_ticker_type + enum gfx_animation_ticker_type menu_ticker_type = (enum gfx_animation_ticker_type)settings->uints.menu_ticker_type; /* Sanity check: Return immediately if this is @@ -4850,8 +4849,8 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) * than for text/icons, and also needs to scale * with screen dimensions */ float shadow_offset = xmb->shadow_offset * 1.5f * xmb->last_scale_factor; - shadow_offset = (shadow_offset > xmb->shadow_offset) - ? shadow_offset + shadow_offset = (shadow_offset > xmb->shadow_offset) + ? shadow_offset : xmb->shadow_offset; thumbnail_shadow.type = GFX_THUMBNAIL_SHADOW_DROP; @@ -5810,7 +5809,7 @@ static void *xmb_init(void **userdata, bool video_is_threaded) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_NETPLAY; #endif - if ( settings->bools.menu_content_show_add + if ( settings->bools.menu_content_show_add && !settings->bools.kiosk_mode_enable) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD; @@ -6430,7 +6429,7 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb, int wideglyph_width = font_driver_get_message_width(xmb->font, wideglyph_str, strlen(wideglyph_str), 1); - if (wideglyph_width > 0 && char_width > 0) + if (wideglyph_width > 0 && char_width > 0) xmb->wideglyph_width = wideglyph_width * 100 / char_width; } @@ -6897,7 +6896,7 @@ static int xmb_list_push(void *data, void *userdata, bool kiosk_mode_enable = settings->bools.kiosk_mode_enable; #ifdef HAVE_QT bool desktop_menu_enable = settings->bools.desktop_menu_enable; -#endif +#endif #if defined(HAVE_NETWORKING) && defined(HAVE_ONLINE_UPDATER) bool menu_show_online_updater = settings->bools.menu_show_online_updater; #endif @@ -7054,7 +7053,7 @@ static int xmb_list_push(void *data, void *userdata, } #endif #endif - if ( !menu_content_show_settings && + if ( !menu_content_show_settings && !string_is_empty(menu_content_show_settings_password)) { MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM( @@ -7336,7 +7335,7 @@ static int xmb_pointer_up(void *userdata, * selection... */ for (;;) { - float top = xmb_item_y(xmb, bottom_idx, selection) + float top = xmb_item_y(xmb, bottom_idx, selection) + xmb->margins_screen_top; if (top > height)