@@ -524,6 +524,7 @@ static int xmb_menu_entry_action(void *userdata,
524524 menu_entry_t * entry , size_t i , enum menu_action action );
525525static bool xmb_load_image (void * userdata , void * data ,
526526 enum menu_image_type type );
527+ static void xmb_context_bg_destroy (xmb_handle_t * xmb );
527528static void xmb_navigation_set (void * data , bool scroll );
528529static uintptr_t xmb_icon_get_id (xmb_handle_t * xmb ,
529530 xmb_node_t * core_node , xmb_node_t * node ,
@@ -1269,9 +1270,23 @@ static void xmb_update_dynamic_wallpaper(xmb_handle_t *xmb, bool reset)
12691270 {
12701271 if (path_is_valid (path ))
12711272 {
1272- task_push_image_load (path ,
1273- (video_driver_get_disp_flags () & VIDEO_FLAG_USE_RGBA ), 0 ,
1274- menu_display_handle_wallpaper_upload , NULL );
1273+ if (reset )
1274+ {
1275+ xmb_context_bg_destroy (xmb );
1276+
1277+ if (!gfx_display_reset_icon_texture (path ,
1278+ & xmb -> textures .bg , TEXTURE_FILTER_LINEAR ,
1279+ NULL , NULL ))
1280+ task_push_image_load (path ,
1281+ (video_driver_get_disp_flags () & VIDEO_FLAG_USE_RGBA ), 0 ,
1282+ menu_display_handle_wallpaper_upload , NULL );
1283+
1284+ gfx_display_init_white_texture ();
1285+ }
1286+ else
1287+ task_push_image_load (path ,
1288+ (video_driver_get_disp_flags () & VIDEO_FLAG_USE_RGBA ), 0 ,
1289+ menu_display_handle_wallpaper_upload , NULL );
12751290
12761291 free (xmb -> bg_file_path );
12771292 xmb -> bg_file_path = strdup (path );
@@ -6656,7 +6671,6 @@ static void xmb_context_reset_textures(
66566671 unsigned menu_xmb_theme )
66576672{
66586673 unsigned i ;
6659- bool supports_rgba = (video_driver_get_disp_flags () & VIDEO_FLAG_USE_RGBA );
66606674
66616675 /* Invalidate in-flight context texture loads */
66626676 xmb_ctx_icon_load_gen ++ ;
@@ -6681,14 +6695,11 @@ static void xmb_context_reset_textures(
66816695
66826696 fill_pathname_join_special (texpath ,
66836697 iconpath , texture_path , sizeof (texpath ));
6684- gfx_display_load_icon (texpath , supports_rgba ,
6685- & xmb -> textures .list [i ], xmb_ctx_icon_load_gen ,
6686- & xmb_ctx_icon_load_gen );
6698+ gfx_display_reset_icon_texture (texpath ,
6699+ & xmb -> textures .list [i ], TEXTURE_FILTER_LINEAR ,
6700+ NULL , NULL );
66876701 }
66886702
6689- /* Tab node icons will be populated from textures.list[]
6690- * once the async loads complete — handled by the draw-time
6691- * check in xmb_draw_icon_predot / xmb_frame. */
66926703 xmb -> main_menu_node .icon = 0 ;
66936704 xmb -> settings_tab_node .icon = 0 ;
66946705 xmb -> history_tab_node .icon = 0 ;
@@ -6812,9 +6823,9 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
68126823 xmb -> allow_dynamic_wallpaper = true;
68136824 }
68146825
6826+ xmb_update_dynamic_wallpaper (xmb , true);
68156827 xmb_context_reset_horizontal_list (xmb );
68166828 xmb_set_title (xmb );
6817- xmb_update_dynamic_wallpaper (xmb , true);
68186829
68196830 menu_screensaver_context_destroy (xmb -> screensaver );
68206831
@@ -8080,12 +8091,6 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
80808091 uintptr_t tex_bg = xmb -> textures .bg ;
80818092 memcpy (tex_list , xmb -> textures .list , sizeof (tex_list ));
80828093
8083- /* Async icon sync: context textures are loaded asynchronously and
8084- * may complete across multiple frames. Continuously propagate
8085- * finished textures into the tab node icon fields. The writes
8086- * are single-pointer stores so there is no race with the async
8087- * callback, and the per-frame cost is negligible (a few pointer
8088- * comparisons). */
80898094 if (tex_list [XMB_TEXTURE_MAIN_MENU ])
80908095 xmb -> main_menu_node .icon = tex_list [XMB_TEXTURE_MAIN_MENU ];
80918096 if (tex_list [XMB_TEXTURE_SETTINGS ])
0 commit comments