mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 00:32:46 +00:00
Revert "Simplify menu_entries_set_refresh"
This reverts commit 6ca0962f9eb59022ad64f11777c6c925206ff2f0.
This commit is contained in:
parent
6ca0962f9e
commit
f48830cfc0
@ -278,7 +278,7 @@ static int cb_net_generic(void *data_, size_t len)
|
||||
core_len = len;
|
||||
ret = 0;
|
||||
|
||||
menu_entries_unset_refresh();
|
||||
menu_entries_unset_refresh(true);
|
||||
|
||||
end:
|
||||
return ret;
|
||||
|
@ -251,7 +251,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();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, new_size);
|
||||
|
||||
return 0;
|
||||
@ -272,7 +272,7 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
|
||||
|
||||
if (shader->passes)
|
||||
shader->passes--;
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
|
||||
#endif
|
||||
|
@ -1249,7 +1249,7 @@ static int generic_action_ok_network(const char *path,
|
||||
unsigned type_id2 = 0;
|
||||
const char *url_label = NULL;
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(true);
|
||||
|
||||
if (settings->network.buildbot_url[0] == '\0')
|
||||
return -1;
|
||||
|
@ -274,7 +274,7 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
|
||||
return -1;
|
||||
|
||||
new_size = cheat_manager_get_size(cheat) + 1;
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, new_size);
|
||||
|
||||
return 0;
|
||||
@ -295,7 +295,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();
|
||||
menu_entries_set_refresh(false);
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
|
||||
#endif
|
||||
|
@ -229,7 +229,7 @@ static int action_start_shader_num_passes(unsigned type, const char *label)
|
||||
if (shader->passes)
|
||||
shader->passes = 0;
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
#endif
|
||||
return 0;
|
||||
@ -245,7 +245,7 @@ static int action_start_cheat_num_passes(unsigned type, const char *label)
|
||||
|
||||
if (cheat_manager_get_size(cheat))
|
||||
{
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, 0);
|
||||
}
|
||||
|
||||
|
@ -2262,7 +2262,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||
|
||||
menu_entries_push(info->list, info->path, info->label, info->type, info->directory_ptr, 0);
|
||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
}
|
||||
break;
|
||||
case DISPLAYLIST_ACCOUNTS_LIST:
|
||||
|
@ -349,7 +349,7 @@ void menu_driver_toggle(bool latch)
|
||||
|
||||
if (menu_alive == true)
|
||||
{
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
|
||||
/* Menu should always run with vsync on. */
|
||||
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
|
||||
|
@ -32,6 +32,7 @@ struct menu_entries
|
||||
{
|
||||
/* Flagged when menu entries need to be refreshed */
|
||||
bool need_refresh;
|
||||
bool nonblocking_refresh;
|
||||
|
||||
size_t begin;
|
||||
menu_list_t *menu_list;
|
||||
@ -148,7 +149,7 @@ static bool menu_list_pop_stack(menu_list_t *list, size_t *directory_ptr)
|
||||
file_list_pop(menu_list, directory_ptr);
|
||||
menu_driver_list_set_selection(menu_list);
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -163,7 +164,7 @@ static void menu_list_flush_stack(menu_list_t *list,
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
menu_entries_get_last(list->menu_stack,
|
||||
&path, &label, &type, &entry_idx);
|
||||
|
||||
@ -482,25 +483,35 @@ bool menu_entries_needs_refresh(void)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
|
||||
if (!entries)
|
||||
if (!entries || entries->nonblocking_refresh)
|
||||
return false;
|
||||
if (entries->need_refresh)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void menu_entries_set_refresh(void)
|
||||
void menu_entries_set_refresh(bool nonblocking)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (entries)
|
||||
entries->need_refresh = true;
|
||||
{
|
||||
if (nonblocking)
|
||||
entries->nonblocking_refresh = true;
|
||||
else
|
||||
entries->need_refresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
void menu_entries_unset_refresh(void)
|
||||
void menu_entries_unset_refresh(bool nonblocking)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (entries)
|
||||
entries->need_refresh = false;
|
||||
{
|
||||
if (nonblocking)
|
||||
entries->nonblocking_refresh = false;
|
||||
else
|
||||
entries->need_refresh = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool menu_entries_init(void *data)
|
||||
|
@ -121,9 +121,9 @@ rarch_setting_t *menu_setting_get_ptr(void);
|
||||
|
||||
bool menu_entries_needs_refresh(void);
|
||||
|
||||
void menu_entries_set_refresh(void);
|
||||
void menu_entries_set_refresh(bool nonblocking);
|
||||
|
||||
void menu_entries_unset_refresh(void);
|
||||
void menu_entries_unset_refresh(bool nonblocking);
|
||||
|
||||
file_list_t *menu_entries_get_selection_buf_ptr(void);
|
||||
|
||||
|
@ -421,7 +421,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
|
||||
|
||||
cbs->action_refresh(selection_buf, menu_stack);
|
||||
menu_entries_unset_refresh();
|
||||
menu_entries_unset_refresh(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ void menu_shader_manager_set_preset(struct video_shader *shader,
|
||||
}
|
||||
config_file_free(conf);
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user