mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Refactor set_refresh functions somewhat
This commit is contained in:
parent
d405d34c0e
commit
5479bae312
@ -278,7 +278,7 @@ static int cb_net_generic(void *data_, size_t len)
|
||||
core_buf[len] = '\0';
|
||||
core_len = len;
|
||||
|
||||
menu_entries_unset_nonblocking_refresh();
|
||||
menu_entries_unset_refresh(true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ static int action_left_cheat_num_passes(unsigned type, const char *label,
|
||||
|
||||
if (cheat->size)
|
||||
new_size = cheat->size - 1;
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, new_size);
|
||||
|
||||
return 0;
|
||||
@ -283,7 +283,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
|
||||
|
@ -553,7 +553,7 @@ static int action_ok_core_updater_list(const char *path,
|
||||
|
||||
(void)url_path;
|
||||
|
||||
menu_entries_set_nonblocking_refresh();
|
||||
menu_entries_set_refresh(true);
|
||||
|
||||
if (settings->network.buildbot_url[0] == '\0')
|
||||
return -1;
|
||||
@ -590,7 +590,7 @@ static int action_ok_core_content_list(const char *path,
|
||||
|
||||
(void)url_path;
|
||||
|
||||
menu_entries_set_nonblocking_refresh();
|
||||
menu_entries_set_refresh(true);
|
||||
|
||||
if (settings->network.buildbot_url[0] == '\0')
|
||||
return -1;
|
||||
|
@ -263,7 +263,7 @@ static int action_right_cheat_num_passes(unsigned type, const char *label,
|
||||
return -1;
|
||||
|
||||
new_size = cheat->size + 1;
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, new_size);
|
||||
|
||||
return 0;
|
||||
@ -284,7 +284,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
|
||||
|
@ -209,7 +209,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;
|
||||
@ -225,7 +225,7 @@ static int action_start_cheat_num_passes(unsigned type, const char *label)
|
||||
|
||||
if (cheat->size)
|
||||
{
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
cheat_manager_realloc(cheat, 0);
|
||||
}
|
||||
|
||||
|
@ -2396,7 +2396,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||
|
||||
menu_list_push(info->list, info->path, info->label, info->type, info->directory_ptr, 0);
|
||||
menu_navigation_clear(nav, true);
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
break;
|
||||
case DISPLAYLIST_HELP_SCREEN_LIST:
|
||||
menu_list_push(info->list,
|
||||
|
@ -164,48 +164,37 @@ int menu_entries_get_core_title(char *s, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool menu_entries_get_nonblocking_refresh(void)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (!entries)
|
||||
return false;
|
||||
return entries->nonblocking_refresh;
|
||||
}
|
||||
|
||||
bool menu_entries_needs_refresh(void)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (menu_entries_get_nonblocking_refresh())
|
||||
|
||||
if (!entries || entries->nonblocking_refresh)
|
||||
return false;
|
||||
if (!entries)
|
||||
return false;
|
||||
return entries->need_refresh;
|
||||
if (entries->need_refresh)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void menu_entries_set_nonblocking_refresh(void)
|
||||
void menu_entries_set_refresh(bool nonblocking)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (entries)
|
||||
entries->nonblocking_refresh = true;
|
||||
{
|
||||
if (nonblocking)
|
||||
entries->nonblocking_refresh = true;
|
||||
else
|
||||
entries->need_refresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
void menu_entries_unset_nonblocking_refresh(void)
|
||||
void menu_entries_unset_refresh(bool nonblocking)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (entries)
|
||||
entries->nonblocking_refresh = false;
|
||||
}
|
||||
|
||||
void menu_entries_set_refresh(void)
|
||||
{
|
||||
menu_entries_t *entries = menu_entries_get_ptr();
|
||||
if (entries)
|
||||
entries->need_refresh = true;
|
||||
}
|
||||
|
||||
void menu_entries_unset_refresh(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -58,13 +58,9 @@ menu_entries_t *menu_entries_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_set_nonblocking_refresh(void);
|
||||
|
||||
void menu_entries_unset_nonblocking_refresh(void);
|
||||
void menu_entries_unset_refresh(bool nonblocking);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
||||
if (cbs && cbs->action_refresh)
|
||||
{
|
||||
ret = cbs->action_refresh(menu_list->selection_buf, menu_list->menu_stack);
|
||||
menu_entries_unset_refresh();
|
||||
menu_entries_unset_refresh(false);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -180,7 +180,7 @@ void menu_list_flush_stack(menu_list_t *list,
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
menu_list_get_last(list->menu_stack,
|
||||
&path, &label, &type, &entry_idx);
|
||||
|
||||
@ -205,7 +205,7 @@ void menu_list_pop_stack(menu_list_t *list)
|
||||
menu_driver_list_cache(MENU_LIST_PLAIN, 0);
|
||||
|
||||
menu_list_pop(list->menu_stack, &nav->selection_ptr);
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
}
|
||||
|
||||
void menu_list_pop_stack_by_needle(menu_list_t *list,
|
||||
@ -221,7 +221,7 @@ void menu_list_pop_stack_by_needle(menu_list_t *list,
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx);
|
||||
needle_hash = menu_hash_calculate(needle);
|
||||
label_hash = menu_hash_calculate(label);
|
||||
|
@ -174,7 +174,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
|
||||
}
|
||||
|
||||
|
@ -1388,7 +1388,7 @@ void rarch_main_set_state(unsigned cmd)
|
||||
system->frame_time_last = 0;
|
||||
}
|
||||
|
||||
menu_entries_set_refresh();
|
||||
menu_entries_set_refresh(false);
|
||||
menu_driver_set_alive();
|
||||
#endif
|
||||
#ifdef HAVE_OVERLAY
|
||||
|
Loading…
x
Reference in New Issue
Block a user