(XMB) Fix horizontal menus

This commit is contained in:
Higor Eurípedes 2015-06-09 21:24:22 -03:00
parent ae1f44cb30
commit 338959eb59
3 changed files with 15 additions and 14 deletions

View File

@ -151,7 +151,7 @@ static int action_right_mainmenu(unsigned type, const char *label,
if (list_size == 1)
{
menu->navigation.selection_ptr = 0;
if (menu->categories.selection_ptr != (menu_driver_list_get_size(MENU_LIST_HORIZONTAL) - 1))
if (menu->categories.selection_ptr != menu_driver_list_get_size(MENU_LIST_HORIZONTAL))
push_list = 1;
}
else

View File

@ -270,8 +270,9 @@ static void *xmb_list_get_entry(void *data, menu_list_type_t type, unsigned i)
case MENU_LIST_HORIZONTAL:
if (xmb && xmb->horizontal_list)
list_size = file_list_get_size(xmb->horizontal_list);
if (i < list_size)
ptr = (void*)&xmb->horizontal_list->list[i];
if (i < list_size+1)
ptr = (void*)&xmb->horizontal_list->list[i-1];
break;
}
@ -789,7 +790,7 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb, menu_handle_t *me
unsigned j;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (j = 0; j < list_size; j++)
for (j = 0; j < list_size + 1; j++)
{
float ia = xmb->categories.passive.alpha;
float iz = xmb->categories.passive.zoom;
@ -850,7 +851,7 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu
unsigned j;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (j = 0; j < list_size; j++)
for (j = 0; j < list_size + 1; j++)
{
float ia = 0;
xmb_node_t *node = &xmb->settings_node;
@ -1260,7 +1261,7 @@ static void xmb_frame_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu, gl
unsigned i;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (i = 0; i < list_size; i++)
for (i = 0; i < list_size + 1; i++)
{
xmb_node_t *node = &xmb->settings_node;
@ -1632,23 +1633,23 @@ static void xmb_context_reset_horizontal_list(xmb_handle_t *xmb,
unsigned i;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (i = 1; i < list_size; i++)
for (i = 0; i < list_size; i++)
{
char iconpath[PATH_MAX_LENGTH], sysname[PATH_MAX_LENGTH];
char texturepath[PATH_MAX_LENGTH], content_texturepath[PATH_MAX_LENGTH];
struct texture_image ti = {0};
xmb_node_t *node = xmb_get_userdata_from_horizontal_list(
xmb, i - 1);
xmb, i);
struct item_file *info = NULL;
if (!node)
{
node = xmb_node_allocate_userdata(xmb, i - 1);
node = xmb_node_allocate_userdata(xmb, i);
if (!node)
continue;
}
info = (struct item_file*)&xmb->horizontal_list->list[i - 1];
info = (struct item_file*)&xmb->horizontal_list->list[i];
if (!info)
continue;
@ -1990,9 +1991,9 @@ static void xmb_context_destroy_horizontal_list(xmb_handle_t *xmb,
unsigned i;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (i = 1; i < list_size; i++)
for (i = 0; i < list_size; i++)
{
xmb_node_t *node = xmb_get_userdata_from_horizontal_list(xmb, i - 1);
xmb_node_t *node = xmb_get_userdata_from_horizontal_list(xmb, i);
if (!node)
continue;
@ -2029,7 +2030,7 @@ static void xmb_toggle_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu)
unsigned i;
size_t list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL);
for (i = 0; i < list_size; i++)
for (i = 0; i < list_size + 1; i++)
{
xmb_node_t *node = &xmb->settings_node;

View File

@ -1368,7 +1368,7 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
struct item_file *item = (struct item_file*)
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL, menu->categories.selection_ptr - 1);
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL, menu->categories.selection_ptr);
if (!item)
return -1;