mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
Create MENU_ENTRIES_CTL_NEEDS_REFRESH
This commit is contained in:
parent
a1112d64a0
commit
fa535f788e
@ -249,7 +249,9 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
|
|||||||
hash = menu_hash_calculate(label);
|
hash = menu_hash_calculate(label);
|
||||||
iterate_type = action_iterate_type(hash);
|
iterate_type = action_iterate_type(hash);
|
||||||
|
|
||||||
if (action != MENU_ACTION_NOOP || menu_entries_needs_refresh() || menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL))
|
if ( action != MENU_ACTION_NOOP
|
||||||
|
|| menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL)
|
||||||
|
|| menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL))
|
||||||
{
|
{
|
||||||
BIT64_SET(menu->state, MENU_STATE_RENDER_FRAMEBUFFER);
|
BIT64_SET(menu->state, MENU_STATE_RENDER_FRAMEBUFFER);
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,8 @@ static void rgui_render(void *data)
|
|||||||
{
|
{
|
||||||
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
||||||
|
|
||||||
if (menu_entries_needs_refresh() && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL) && !msg_force)
|
if (menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL)
|
||||||
|
&& menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL) && !msg_force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
|
if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
|
||||||
|
@ -139,7 +139,7 @@ static void rmenu_render(void *data)
|
|||||||
|
|
||||||
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
||||||
|
|
||||||
if (menu_entries_needs_refresh()
|
if (menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL)
|
||||||
&& menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL)
|
&& menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL)
|
||||||
&& !msg_force)
|
&& !msg_force)
|
||||||
return;
|
return;
|
||||||
|
@ -539,7 +539,7 @@ static void rmenu_xui_render(void *data)
|
|||||||
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
menu_entries_needs_refresh()
|
menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL)
|
||||||
&& menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL)
|
&& menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL)
|
||||||
&& !msg_force
|
&& !msg_force
|
||||||
)
|
)
|
||||||
|
@ -2485,7 +2485,7 @@ static void xmb_toggle(void *userdata, 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);
|
||||||
|
|
||||||
tmp = !menu_entries_needs_refresh();
|
tmp = !menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL);
|
||||||
|
|
||||||
if (tmp)
|
if (tmp)
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||||
|
@ -594,7 +594,7 @@ void *menu_init(const void *data)
|
|||||||
strlcpy(settings->menu.driver, menu_ctx->ident,
|
strlcpy(settings->menu.driver, menu_ctx->ident,
|
||||||
sizeof(settings->menu.driver));
|
sizeof(settings->menu.driver));
|
||||||
|
|
||||||
if (!menu_entries_init())
|
if (!menu_entries_ctl(MENU_ENTRIES_CTL_INIT, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_INIT, NULL))
|
if (!runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_INIT, NULL))
|
||||||
|
@ -501,17 +501,6 @@ file_list_t *menu_entries_get_selection_buf_ptr(size_t idx)
|
|||||||
return menu_list->selection_buf[idx];
|
return menu_list->selection_buf[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_entries_needs_refresh(void)
|
|
||||||
{
|
|
||||||
menu_entries_t *entries = menu_entries_data;
|
|
||||||
|
|
||||||
if (!entries || entries->nonblocking_refresh)
|
|
||||||
return false;
|
|
||||||
if (!entries->need_refresh)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void menu_entries_set_refresh(bool nonblocking)
|
void menu_entries_set_refresh(bool nonblocking)
|
||||||
{
|
{
|
||||||
menu_entries_t *entries = menu_entries_data;
|
menu_entries_t *entries = menu_entries_data;
|
||||||
@ -536,7 +525,7 @@ void menu_entries_unset_refresh(bool nonblocking)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_entries_init(void)
|
static bool menu_entries_init(void)
|
||||||
{
|
{
|
||||||
menu_entries_t *entries = (menu_entries_t*)calloc(1, sizeof(*entries));
|
menu_entries_t *entries = (menu_entries_t*)calloc(1, sizeof(*entries));
|
||||||
|
|
||||||
@ -721,6 +710,14 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
|||||||
free(menu_entries_data);
|
free(menu_entries_data);
|
||||||
menu_entries_data = NULL;
|
menu_entries_data = NULL;
|
||||||
return true;
|
return true;
|
||||||
|
case MENU_ENTRIES_CTL_NEEDS_REFRESH:
|
||||||
|
if (!entries || entries->nonblocking_refresh)
|
||||||
|
return false;
|
||||||
|
if (!entries->need_refresh)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
case MENU_ENTRIES_CTL_INIT:
|
||||||
|
return menu_entries_init();
|
||||||
case MENU_ENTRIES_CTL_SHOW_BACK:
|
case MENU_ENTRIES_CTL_SHOW_BACK:
|
||||||
/* Returns true if a Back button should be shown
|
/* Returns true if a Back button should be shown
|
||||||
* (i.e. we are at least
|
* (i.e. we are at least
|
||||||
|
@ -105,6 +105,8 @@ enum menu_entries_ctl_state
|
|||||||
{
|
{
|
||||||
MENU_ENTRIES_CTL_NONE = 0,
|
MENU_ENTRIES_CTL_NONE = 0,
|
||||||
MENU_ENTRIES_CTL_DEINIT,
|
MENU_ENTRIES_CTL_DEINIT,
|
||||||
|
MENU_ENTRIES_CTL_INIT,
|
||||||
|
MENU_ENTRIES_CTL_NEEDS_REFRESH,
|
||||||
MENU_ENTRIES_CTL_SHOW_BACK
|
MENU_ENTRIES_CTL_SHOW_BACK
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -124,8 +126,6 @@ int menu_entries_get_core_title(char *title_msg, size_t title_msg_len);
|
|||||||
|
|
||||||
rarch_setting_t *menu_setting_get_ptr(void);
|
rarch_setting_t *menu_setting_get_ptr(void);
|
||||||
|
|
||||||
bool menu_entries_needs_refresh(void);
|
|
||||||
|
|
||||||
void menu_entries_set_refresh(bool nonblocking);
|
void menu_entries_set_refresh(bool nonblocking);
|
||||||
|
|
||||||
void menu_entries_unset_refresh(bool nonblocking);
|
void menu_entries_unset_refresh(bool nonblocking);
|
||||||
@ -137,8 +137,6 @@ file_list_t *menu_entries_get_menu_stack_ptr(size_t idx);
|
|||||||
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||||
unsigned type, size_t directory_ptr, size_t entry_idx);
|
unsigned type, size_t directory_ptr, size_t entry_idx);
|
||||||
|
|
||||||
bool menu_entries_init(void);
|
|
||||||
|
|
||||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||||
unsigned *file_type, size_t *entry_idx);
|
unsigned *file_type, size_t *entry_idx);
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
|||||||
|
|
||||||
cbs = menu_entries_get_actiondata_at_offset(selection_buf, i);
|
cbs = menu_entries_get_actiondata_at_offset(selection_buf, i);
|
||||||
|
|
||||||
if (menu_entries_needs_refresh())
|
if (menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL))
|
||||||
{
|
{
|
||||||
if (cbs && cbs->action_refresh)
|
if (cbs && cbs->action_refresh)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user