(XMB) Fixes

This commit is contained in:
twinaphex 2015-02-10 17:46:35 +01:00
parent 6f165b6801
commit 64372ed4b1
3 changed files with 11 additions and 17 deletions

View File

@ -88,7 +88,6 @@ typedef struct xmb_handle
size_t selection_ptr_old; size_t selection_ptr_old;
int active_category; int active_category;
int active_category_old; int active_category_old;
int num_categories;
int depth; int depth;
int old_depth; int old_depth;
char icon_dir[4]; char icon_dir[4];
@ -775,7 +774,7 @@ static void xmb_list_open(void)
xmb->active_category += dir; xmb->active_category += dir;
for (j = 0; j < xmb->num_categories; j++) for (j = 0; j < driver.menu->num_categories; j++)
{ {
float ia = xmb->c_passive_alpha; float ia = xmb->c_passive_alpha;
float iz = xmb->c_passive_zoom; float iz = xmb->c_passive_zoom;
@ -822,7 +821,7 @@ static void xmb_list_switch(void)
else if (xmb->depth < xmb->old_depth) else if (xmb->depth < xmb->old_depth)
dir = -1; dir = -1;
for (j = 0; j < xmb->num_categories; j++) for (j = 0; j < driver.menu->num_categories; j++)
{ {
float ia = 0; float ia = 0;
xmb_node_t *node = j ? xmb_node_for_core(j-1) : &xmb->settings_node; xmb_node_t *node = j ? xmb_node_for_core(j-1) : &xmb->settings_node;
@ -1116,7 +1115,7 @@ static void xmb_frame(void)
driver.menu->selection_ptr, driver.menu->selection_ptr,
driver.menu->cat_selection_ptr); driver.menu->cat_selection_ptr);
for (i = 0; i < xmb->num_categories; i++) for (i = 0; i < driver.menu->num_categories; i++)
{ {
xmb_node_t *node = i ? xmb_node_for_core(i-1) : &xmb->settings_node; xmb_node_t *node = i ? xmb_node_for_core(i-1) : &xmb->settings_node;
@ -1258,15 +1257,9 @@ static void *xmb_init(void)
xmb->label_margin_top = xmb->font_size/3.0; xmb->label_margin_top = xmb->font_size/3.0;
xmb->setting_margin_left = 600.0 * scale_factor; xmb->setting_margin_left = 600.0 * scale_factor;
xmb->num_categories = 1; menu->num_categories = 1;
if (g_extern.core_info)
if (!g_extern.core_info) menu->num_categories = g_extern.core_info->count + 1;
{
RARCH_ERR("Global core informations not initialized.\n");
goto error;
}
xmb->num_categories = g_extern.core_info->count + 1;
return menu; return menu;
@ -1410,7 +1403,7 @@ static void xmb_context_reset(void *data)
if (!info_list) if (!info_list)
return; return;
for (i = 1; i < xmb->num_categories; i++) for (i = 1; i < driver.menu->num_categories; i++)
{ {
node = xmb_node_for_core(i-1); node = xmb_node_for_core(i-1);
@ -1634,7 +1627,7 @@ static void xmb_context_destroy(void *data)
for (i = 0; i < XMB_TEXTURE_LAST; i++) for (i = 0; i < XMB_TEXTURE_LAST; i++)
glDeleteTextures(1, &xmb->textures[i].id); glDeleteTextures(1, &xmb->textures[i].id);
for (i = 1; i < xmb->num_categories; i++) for (i = 1; i < driver.menu->num_categories; i++)
{ {
xmb_node_t *node = xmb_node_for_core(i-1); xmb_node_t *node = xmb_node_for_core(i-1);
@ -1672,7 +1665,7 @@ static void xmb_toggle(bool menu_on)
xmb->prevent_populate = !menu->need_refresh; xmb->prevent_populate = !menu->need_refresh;
for (i = 0; i < xmb->num_categories; i++) for (i = 0; i < driver.menu->num_categories; i++)
{ {
xmb_node_t *node = i ? xmb_node_for_core(i-1) : &xmb->settings_node; xmb_node_t *node = i ? xmb_node_for_core(i-1) : &xmb->settings_node;

View File

@ -82,6 +82,7 @@ typedef struct
menu_list_t *menu_list; menu_list_t *menu_list;
size_t cat_selection_ptr; size_t cat_selection_ptr;
size_t num_categories;
size_t selection_ptr; size_t selection_ptr;
bool need_refresh; bool need_refresh;
bool msg_force; bool msg_force;

View File

@ -2023,7 +2023,7 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
push_list = 1; push_list = 1;
break; break;
case MENU_ACTION_RIGHT: case MENU_ACTION_RIGHT:
if (driver.menu->cat_selection_ptr == g_extern.core_info->count) if (driver.menu->cat_selection_ptr == driver.menu->num_categories-1)
break; break;
push_list = 1; push_list = 1;
break; break;