mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 09:32:52 +00:00
Create menu_set_refresh/menu_unset_refresh
This commit is contained in:
parent
1b4ce6d25e
commit
f525899e0e
16
menu/menu.c
16
menu/menu.c
@ -312,3 +312,19 @@ int menu_iterate(retro_input_t input,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void menu_set_refresh(void)
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
if (!menu)
|
||||
return;
|
||||
menu->need_refresh = true;
|
||||
}
|
||||
|
||||
void menu_unset_refresh(void)
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
if (!menu)
|
||||
return;
|
||||
menu->need_refresh = false;
|
||||
}
|
||||
|
@ -188,6 +188,10 @@ bool menu_load_content(void);
|
||||
|
||||
void menu_update_system_info(menu_handle_t *menu, bool *load_no_content);
|
||||
|
||||
void menu_set_refresh(void);
|
||||
|
||||
void menu_unset_refresh(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -2036,7 +2036,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
||||
|
||||
ret = menu_displaylist_deferred_push(&info);
|
||||
|
||||
menu->need_refresh = false;
|
||||
menu_unset_refresh();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ static int action_start_shader_num_passes(unsigned type, const char *label,
|
||||
return -1;
|
||||
if (shader->passes)
|
||||
shader->passes = 0;
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
|
||||
video_shader_resolve_parameters(NULL, menu->shader);
|
||||
#endif
|
||||
@ -231,7 +231,7 @@ static int action_start_cheat_num_passes(unsigned type, const char *label,
|
||||
if (cheat->size)
|
||||
{
|
||||
cheat_manager_realloc(cheat, 0);
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -347,12 +347,12 @@ static int action_toggle_cheat_num_passes(unsigned type, const char *label,
|
||||
case MENU_ACTION_LEFT:
|
||||
if (cheat->size)
|
||||
new_size = cheat->size - 1;
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
new_size = cheat->size + 1;
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -380,13 +380,13 @@ static int action_toggle_shader_num_passes(unsigned type, const char *label,
|
||||
case MENU_ACTION_LEFT:
|
||||
if (shader->passes)
|
||||
shader->passes--;
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
if ((shader->passes < GFX_MAX_SHADERS))
|
||||
shader->passes++;
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ void menu_list_flush_stack(menu_list_t *list,
|
||||
if (!menu || !list)
|
||||
return;
|
||||
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
file_list_get_last(list->menu_stack, &path, &label, &type);
|
||||
|
||||
while (type != final_type)
|
||||
@ -273,7 +273,7 @@ void menu_list_flush_stack_by_needle(menu_list_t *list,
|
||||
if (!menu || !list)
|
||||
return;
|
||||
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
file_list_get_last(list->menu_stack, &path, &label, &type);
|
||||
|
||||
while (strcmp(needle, label) != 0)
|
||||
@ -295,7 +295,7 @@ void menu_list_pop_stack(menu_list_t *list)
|
||||
menu_driver_list_cache(false, 0);
|
||||
|
||||
menu_list_pop(list->menu_stack, &menu->navigation.selection_ptr);
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
}
|
||||
|
||||
void menu_list_pop_stack_by_needle(menu_list_t *list,
|
||||
@ -309,7 +309,7 @@ void menu_list_pop_stack_by_needle(menu_list_t *list,
|
||||
if (!menu || !list)
|
||||
return;
|
||||
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
file_list_get_last(list->menu_stack, &path, &label, &type);
|
||||
|
||||
while (strcmp(needle, label) == 0)
|
||||
@ -392,7 +392,7 @@ int menu_list_push_stack_refresh(menu_list_t *list,
|
||||
|
||||
menu_list_push(list->menu_stack, path, label, type, directory_ptr);
|
||||
menu_navigation_clear(&menu->navigation, true);
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void menu_shader_manager_set_preset(struct video_shader *shader,
|
||||
}
|
||||
config_file_free(conf);
|
||||
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1273,7 +1273,7 @@ void rarch_main_set_state(unsigned cmd)
|
||||
global->system.frame_time_last = 0;
|
||||
}
|
||||
|
||||
menu->need_refresh = true;
|
||||
menu_set_refresh();
|
||||
runloop->is_menu = true;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user