Create menu_do_refresh

This commit is contained in:
twinaphex 2015-05-15 22:22:23 +02:00
parent a4b200abd8
commit 324e55f66d
2 changed files with 16 additions and 2 deletions

View File

@ -297,8 +297,8 @@ int menu_iterate(retro_input_t input,
action = menu->input.joypad; action = menu->input.joypad;
if (menu_needs_refresh() && !menu->nonblocking_refresh && action != MENU_ACTION_MESSAGE) if (menu_do_refresh(action) == 0)
action = MENU_ACTION_REFRESH; return 0;
ret = menu_entry_iterate(action); ret = menu_entry_iterate(action);
@ -313,6 +313,18 @@ int menu_iterate(retro_input_t input,
return 0; return 0;
} }
int menu_do_refresh(unsigned action)
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu || menu->nonblocking_refresh)
return -1;
if (!menu_needs_refresh())
return -1;
if (action == MENU_ACTION_MESSAGE)
return -1;
return menu_entry_iterate(MENU_ACTION_REFRESH);
}
bool menu_needs_refresh(void) bool menu_needs_refresh(void)
{ {
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();

View File

@ -188,6 +188,8 @@ bool menu_load_content(void);
void menu_update_system_info(menu_handle_t *menu, bool *load_no_content); void menu_update_system_info(menu_handle_t *menu, bool *load_no_content);
int menu_do_refresh(unsigned action);
bool menu_needs_refresh(void); bool menu_needs_refresh(void);
void menu_set_refresh(void); void menu_set_refresh(void);