Merge pull request #2358 from lakkatv/xmb

(XMB) Display bug fixes
This commit is contained in:
Twinaphex 2015-11-07 12:37:18 +01:00
commit 9c4168e93e
4 changed files with 17 additions and 8 deletions

View File

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

View File

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

View File

@ -218,7 +218,6 @@ typedef struct xmb_handle
xmb_node_t settings_tab_node;
xmb_node_t history_tab_node;
xmb_node_t add_tab_node;
bool prevent_populate;
gfx_font_raster_block_t raster_block;
} xmb_handle_t;
@ -1036,12 +1035,14 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb,
menu_handle_t *menu, const char *themepath)
{
unsigned i;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
int depth; /* keep this integer */
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
xmb->categories.x_pos = xmb->icon.spacing.horizontal *
-(float)xmb->categories.selection_ptr;
xmb->x = xmb->icon.size * -(xmb->depth*2-2);
depth = (xmb->depth > 1) ? 2 : 1;
xmb->x = xmb->icon.size * -(depth*2-2);
for (i = 0; i < list_size; i++)
{
@ -1111,7 +1112,7 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
free(xmb->horizontal_list);
xmb->horizontal_list = NULL;
xmb->prevent_populate = true;
menu->prevent_populate = true;
xmb_init_horizontal_list(menu, xmb);
xmb_context_reset_horizontal_list(xmb, menu, themepath);
@ -1203,10 +1204,10 @@ static void xmb_populate_entries(const char *path,
if (!xmb)
return;
if (xmb->prevent_populate)
if (menu->prevent_populate)
{
xmb_selection_pointer_changed(false);
xmb->prevent_populate = false;
menu->prevent_populate = false;
return;
}
@ -1972,7 +1973,7 @@ static void *xmb_init(void)
xmb->depth = 1;
xmb->old_depth = 1;
xmb->alpha = 0;
xmb->prevent_populate = false;
menu->prevent_populate = false;
/* TODO/FIXME - we don't use framebuffer at all
* for XMB, we should refactor this dependency
@ -2569,7 +2570,7 @@ static void xmb_toggle(bool menu_on)
menu_animation_push(XMB_DELAY, 1.0f,
&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);
}

View File

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