(XMB) Use menu_list_get_ptr
This commit is contained in:
parent
2cfa890a58
commit
a7b43854e0
|
@ -477,8 +477,9 @@ end:
|
||||||
static void xmb_selection_pointer_changed(void)
|
static void xmb_selection_pointer_changed(void)
|
||||||
{
|
{
|
||||||
unsigned i, current, end;
|
unsigned i, current, end;
|
||||||
xmb_handle_t *xmb = NULL;
|
xmb_handle_t *xmb = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -497,7 +498,7 @@ static void xmb_selection_pointer_changed(void)
|
||||||
float ia = xmb->item.passive.alpha;
|
float ia = xmb->item.passive.alpha;
|
||||||
float iz = xmb->item.passive.zoom;
|
float iz = xmb->item.passive.zoom;
|
||||||
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
xmb_node_t *node = (xmb_node_t*)file_list_get_userdata_at_offset(
|
||||||
menu->menu_list->selection_buf, i);
|
menu_list->selection_buf, i);
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
continue;
|
continue;
|
||||||
|
@ -817,7 +818,8 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb, menu_handle_t *me
|
||||||
static void xmb_list_switch(xmb_handle_t *xmb)
|
static void xmb_list_switch(xmb_handle_t *xmb)
|
||||||
{
|
{
|
||||||
int dir = -1;
|
int dir = -1;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -839,7 +841,7 @@ static void xmb_list_switch(xmb_handle_t *xmb)
|
||||||
|
|
||||||
xmb_list_switch_old(xmb, xmb->selection_buf_old,
|
xmb_list_switch_old(xmb, xmb->selection_buf_old,
|
||||||
dir, xmb->selection_ptr_old);
|
dir, xmb->selection_ptr_old);
|
||||||
xmb_list_switch_new(xmb, menu->menu_list->selection_buf,
|
xmb_list_switch_new(xmb, menu_list->selection_buf,
|
||||||
dir, menu->navigation.selection_ptr);
|
dir, menu->navigation.selection_ptr);
|
||||||
xmb->categories.active.idx_old = menu->categories.selection_ptr;
|
xmb->categories.active.idx_old = menu->categories.selection_ptr;
|
||||||
}
|
}
|
||||||
|
@ -873,8 +875,9 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu
|
||||||
|
|
||||||
static void xmb_list_open(xmb_handle_t *xmb)
|
static void xmb_list_open(xmb_handle_t *xmb)
|
||||||
{
|
{
|
||||||
int dir = 0;
|
int dir = 0;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -890,7 +893,7 @@ static void xmb_list_open(xmb_handle_t *xmb)
|
||||||
|
|
||||||
xmb_list_open_old(xmb, xmb->selection_buf_old,
|
xmb_list_open_old(xmb, xmb->selection_buf_old,
|
||||||
dir, xmb->selection_ptr_old);
|
dir, xmb->selection_ptr_old);
|
||||||
xmb_list_open_new(xmb, menu->menu_list->selection_buf,
|
xmb_list_open_new(xmb, menu_list->selection_buf,
|
||||||
dir, menu->navigation.selection_ptr);
|
dir, menu->navigation.selection_ptr);
|
||||||
|
|
||||||
switch (xmb->depth)
|
switch (xmb->depth)
|
||||||
|
@ -1212,9 +1215,10 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, float x, float y)
|
||||||
static void xmb_render(void)
|
static void xmb_render(void)
|
||||||
{
|
{
|
||||||
unsigned i, current, end;
|
unsigned i, current, end;
|
||||||
xmb_handle_t *xmb = NULL;
|
xmb_handle_t *xmb = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -1227,7 +1231,7 @@ static void xmb_render(void)
|
||||||
menu_animation_update(menu->animation, menu->dt / IDEAL_DT);
|
menu_animation_update(menu->animation, menu->dt / IDEAL_DT);
|
||||||
|
|
||||||
current = menu->navigation.selection_ptr;
|
current = menu->navigation.selection_ptr;
|
||||||
end = menu_list_get_size(menu->menu_list);
|
end = menu_list_get_size(menu_list);
|
||||||
|
|
||||||
if (settings->menu.pointer.enable)
|
if (settings->menu.pointer.enable)
|
||||||
{
|
{
|
||||||
|
@ -1298,8 +1302,9 @@ static void xmb_frame(void)
|
||||||
xmb_handle_t *xmb = NULL;
|
xmb_handle_t *xmb = NULL;
|
||||||
gl_t *gl = NULL;
|
gl_t *gl = NULL;
|
||||||
const struct font_renderer *font_driver = NULL;
|
const struct font_renderer *font_driver = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -1352,8 +1357,8 @@ static void xmb_frame(void)
|
||||||
xmb->categories.selection_ptr_old);
|
xmb->categories.selection_ptr_old);
|
||||||
|
|
||||||
xmb_draw_items(xmb, gl,
|
xmb_draw_items(xmb, gl,
|
||||||
menu->menu_list->selection_buf,
|
menu_list->selection_buf,
|
||||||
menu->menu_list->menu_stack,
|
menu_list->menu_stack,
|
||||||
menu->navigation.selection_ptr,
|
menu->navigation.selection_ptr,
|
||||||
menu->categories.selection_ptr);
|
menu->categories.selection_ptr);
|
||||||
|
|
||||||
|
@ -1933,8 +1938,9 @@ static void xmb_list_delete(file_list_t *list,
|
||||||
static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
||||||
{
|
{
|
||||||
size_t stack_size;
|
size_t stack_size;
|
||||||
xmb_handle_t *xmb = NULL;
|
xmb_handle_t *xmb = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -1944,8 +1950,8 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
||||||
if (!xmb)
|
if (!xmb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
file_list_copy(menu->menu_list->selection_buf, xmb->selection_buf_old);
|
file_list_copy(menu_list->selection_buf, xmb->selection_buf_old);
|
||||||
file_list_copy(menu->menu_list->menu_stack, xmb->menu_stack_old);
|
file_list_copy(menu_list->menu_stack, xmb->menu_stack_old);
|
||||||
xmb->selection_ptr_old = menu->navigation.selection_ptr;
|
xmb->selection_ptr_old = menu->navigation.selection_ptr;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
|
@ -1965,24 +1971,24 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stack_size = menu->menu_list->menu_stack->size;
|
stack_size = menu_list->menu_stack->size;
|
||||||
|
|
||||||
if (menu->menu_list->menu_stack->list[stack_size - 1].label)
|
if (menu_list->menu_stack->list[stack_size - 1].label)
|
||||||
free(menu->menu_list->menu_stack->list[stack_size - 1].label);
|
free(menu_list->menu_stack->list[stack_size - 1].label);
|
||||||
menu->menu_list->menu_stack->list[stack_size - 1].label = NULL;
|
menu_list->menu_stack->list[stack_size - 1].label = NULL;
|
||||||
|
|
||||||
if (menu->categories.selection_ptr == 0)
|
if (menu->categories.selection_ptr == 0)
|
||||||
{
|
{
|
||||||
menu->menu_list->menu_stack->list[stack_size - 1].label =
|
menu_list->menu_stack->list[stack_size - 1].label =
|
||||||
strdup("Main Menu");
|
strdup("Main Menu");
|
||||||
menu->menu_list->menu_stack->list[stack_size - 1].type =
|
menu_list->menu_stack->list[stack_size - 1].type =
|
||||||
MENU_SETTINGS;
|
MENU_SETTINGS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menu->menu_list->menu_stack->list[stack_size - 1].label =
|
menu_list->menu_stack->list[stack_size - 1].label =
|
||||||
strdup("Horizontal Menu");
|
strdup("Horizontal Menu");
|
||||||
menu->menu_list->menu_stack->list[stack_size - 1].type =
|
menu_list->menu_stack->list[stack_size - 1].type =
|
||||||
MENU_SETTING_HORIZONTAL_MENU;
|
MENU_SETTING_HORIZONTAL_MENU;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -40,7 +40,7 @@ static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
||||||
static int action_get_title_default(const char *path, const char *label,
|
static int action_get_title_default(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
uint32_t hash = 0;
|
uint32_t label_hash = 0;
|
||||||
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
||||||
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
||||||
struct string_list *list_label = string_split(label, "|");
|
struct string_list *list_label = string_split(label, "|");
|
||||||
|
@ -72,7 +72,7 @@ static int action_get_title_default(const char *path, const char *label,
|
||||||
string_list_free(list_path);
|
string_list_free(list_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
hash = djb2_calculate(label);
|
label_hash = djb2_calculate(label);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
||||||
|
@ -94,7 +94,7 @@ static int action_get_title_default(const char *path, const char *label,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (hash)
|
switch (label_hash)
|
||||||
{
|
{
|
||||||
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
||||||
snprintf(s, len, "DATABASE SELECTION - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
snprintf(s, len, "DATABASE SELECTION - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
||||||
|
|
Loading…
Reference in New Issue