Wrap menu->need_refresh

This commit is contained in:
twinaphex 2015-05-15 22:06:42 +02:00
parent f525899e0e
commit 8dfbc1b54e
9 changed files with 19 additions and 10 deletions

View File

@ -336,7 +336,7 @@ static void glui_frame(void)
glui = (glui_handle_t*)menu->userdata;
if (menu->need_refresh
if (menu_needs_refresh()
&& runloop->is_menu
&& !menu->msg_force
&& !glui->box_message[0])

View File

@ -343,8 +343,7 @@ static void rgui_render(void)
if (!menu)
return;
if (menu->need_refresh && runloop->is_menu
&& !menu->msg_force)
if (menu_needs_refresh() && runloop->is_menu && !menu->msg_force)
return;
if (runloop->is_idle)

View File

@ -143,7 +143,7 @@ static void rmenu_render(void)
return;
}
if (menu->need_refresh && runloop->is_menu
if (menu_needs_refresh() && runloop->is_menu
&& !menu->msg_force)
return;

View File

@ -538,7 +538,7 @@ static void rmenu_xui_render(void)
if (!menu)
return;
if (menu->need_refresh &&
if (menu_needs_refresh() &&
runloop->is_menu && !menu->msg_force)
return;

View File

@ -1885,7 +1885,7 @@ static void xmb_toggle(bool menu_on)
menu_animation_push(menu->animation, XMB_DELAY, 1.0f,
&xmb->alpha, EASING_IN_OUT_QUAD, NULL);
xmb->prevent_populate = !menu->need_refresh;
xmb->prevent_populate = !menu_needs_refresh();
for (i = 0; i < menu->categories.size; i++)
{

View File

@ -297,7 +297,7 @@ int menu_iterate(retro_input_t input,
action = menu->input.joypad;
if (menu->need_refresh && !menu->nonblocking_refresh && action != MENU_ACTION_MESSAGE)
if (menu_needs_refresh() && !menu->nonblocking_refresh && action != MENU_ACTION_MESSAGE)
action = MENU_ACTION_REFRESH;
ret = menu_entry_iterate(action);
@ -313,6 +313,14 @@ int menu_iterate(retro_input_t input,
return 0;
}
bool menu_needs_refresh(void)
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return false;
return menu->need_refresh;
}
void menu_set_refresh(void)
{
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);
bool menu_needs_refresh(void);
void menu_set_refresh(void);
void menu_unset_refresh(void);

View File

@ -356,7 +356,7 @@ static int action_toggle_cheat_num_passes(unsigned type, const char *label,
break;
}
if (menu->need_refresh)
if (menu_needs_refresh())
cheat_manager_realloc(cheat, new_size);
return 0;
@ -390,7 +390,7 @@ static int action_toggle_shader_num_passes(unsigned type, const char *label,
break;
}
if (menu->need_refresh)
if (menu_needs_refresh())
video_shader_resolve_parameters(NULL, menu->shader);
#endif

View File

@ -427,7 +427,7 @@ int menu_entry_iterate(unsigned action)
if (!menu_list)
return -1;
if (action != MENU_ACTION_NOOP || menu->need_refresh || menu_display_update_pending())
if (action != MENU_ACTION_NOOP || menu_needs_refresh() || menu_display_update_pending())
menu->framebuf.dirty = true;
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);