(XMB) Hack to prevent icon overlapping when adding or removing shaders and cheap passes

This commit is contained in:
Jean-André Santoni 2015-11-07 11:47:02 +07:00
parent 6792e74ad5
commit 23fee02883
4 changed files with 13 additions and 6 deletions

View File

@ -239,6 +239,7 @@ static int action_left_cheat_num_passes(unsigned type, const char *label,
{ {
unsigned new_size = 0; unsigned new_size = 0;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
cheat_manager_t *cheat = global->cheat; cheat_manager_t *cheat = global->cheat;
if (!cheat) if (!cheat)
@ -247,6 +248,7 @@ static int action_left_cheat_num_passes(unsigned type, const char *label,
if (cheat_manager_get_size(cheat)) if (cheat_manager_get_size(cheat))
new_size = cheat_manager_get_size(cheat) - 1; new_size = cheat_manager_get_size(cheat) - 1;
menu_entries_set_refresh(false); menu_entries_set_refresh(false);
menu->prevent_populate = true;
cheat_manager_realloc(cheat, new_size); cheat_manager_realloc(cheat, new_size);
return 0; return 0;
@ -268,6 +270,7 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
if (shader->passes) if (shader->passes)
shader->passes--; shader->passes--;
menu_entries_set_refresh(false); menu_entries_set_refresh(false);
menu->prevent_populate = true;
video_shader_resolve_parameters(NULL, menu->shader); video_shader_resolve_parameters(NULL, menu->shader);
#endif #endif

View File

@ -264,6 +264,7 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
{ {
unsigned new_size = 0; unsigned new_size = 0;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
cheat_manager_t *cheat = global->cheat; cheat_manager_t *cheat = global->cheat;
if (!cheat) if (!cheat)
@ -271,6 +272,7 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
new_size = cheat_manager_get_size(cheat) + 1; new_size = cheat_manager_get_size(cheat) + 1;
menu_entries_set_refresh(false); menu_entries_set_refresh(false);
menu->prevent_populate = true;
cheat_manager_realloc(cheat, new_size); cheat_manager_realloc(cheat, new_size);
return 0; return 0;
@ -292,6 +294,7 @@ static int action_right_shader_num_passes(unsigned type, const char *label,
if ((shader->passes < GFX_MAX_SHADERS)) if ((shader->passes < GFX_MAX_SHADERS))
shader->passes++; shader->passes++;
menu_entries_set_refresh(false); menu_entries_set_refresh(false);
menu->prevent_populate = true;
video_shader_resolve_parameters(NULL, menu->shader); video_shader_resolve_parameters(NULL, menu->shader);
#endif #endif

View File

@ -218,7 +218,6 @@ typedef struct xmb_handle
xmb_node_t settings_tab_node; xmb_node_t settings_tab_node;
xmb_node_t history_tab_node; xmb_node_t history_tab_node;
xmb_node_t add_tab_node; xmb_node_t add_tab_node;
bool prevent_populate;
gfx_font_raster_block_t raster_block; gfx_font_raster_block_t raster_block;
} xmb_handle_t; } xmb_handle_t;
@ -1113,7 +1112,7 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
free(xmb->horizontal_list); free(xmb->horizontal_list);
xmb->horizontal_list = NULL; xmb->horizontal_list = NULL;
xmb->prevent_populate = true; menu->prevent_populate = true;
xmb_init_horizontal_list(menu, xmb); xmb_init_horizontal_list(menu, xmb);
xmb_context_reset_horizontal_list(xmb, menu, themepath); xmb_context_reset_horizontal_list(xmb, menu, themepath);
@ -1205,10 +1204,10 @@ static void xmb_populate_entries(const char *path,
if (!xmb) if (!xmb)
return; return;
if (xmb->prevent_populate) if (menu->prevent_populate)
{ {
xmb_selection_pointer_changed(false); xmb_selection_pointer_changed(false);
xmb->prevent_populate = false; menu->prevent_populate = false;
return; return;
} }
@ -1974,7 +1973,7 @@ static void *xmb_init(void)
xmb->depth = 1; xmb->depth = 1;
xmb->old_depth = 1; xmb->old_depth = 1;
xmb->alpha = 0; xmb->alpha = 0;
xmb->prevent_populate = false; menu->prevent_populate = false;
/* TODO/FIXME - we don't use framebuffer at all /* TODO/FIXME - we don't use framebuffer at all
* for XMB, we should refactor this dependency * for XMB, we should refactor this dependency
@ -2571,7 +2570,7 @@ static void xmb_toggle(bool menu_on)
menu_animation_push(XMB_DELAY, 1.0f, menu_animation_push(XMB_DELAY, 1.0f,
&xmb->alpha, EASING_IN_OUT_QUAD, -1, NULL); &xmb->alpha, EASING_IN_OUT_QUAD, -1, NULL);
xmb->prevent_populate = !menu_entries_needs_refresh(); menu->prevent_populate = !menu_entries_needs_refresh();
xmb_toggle_horizontal_list(xmb, menu); xmb_toggle_horizontal_list(xmb, menu);
} }

View File

@ -94,6 +94,8 @@ typedef struct
content_playlist_t *playlist; content_playlist_t *playlist;
char db_playlist_file[PATH_MAX_LENGTH]; char db_playlist_file[PATH_MAX_LENGTH];
bool prevent_populate; /* xmb hack */
} menu_handle_t; } menu_handle_t;
typedef struct menu_ctx_driver typedef struct menu_ctx_driver