diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 1c51e28061..02c05561db 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -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]) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 8f23d2c269..092bdc8d89 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -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) diff --git a/menu/drivers/rmenu.c b/menu/drivers/rmenu.c index 11b2c00210..309f107d39 100644 --- a/menu/drivers/rmenu.c +++ b/menu/drivers/rmenu.c @@ -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; diff --git a/menu/drivers/rmenu_xui.cpp b/menu/drivers/rmenu_xui.cpp index 923b28b6db..12c6f5da98 100644 --- a/menu/drivers/rmenu_xui.cpp +++ b/menu/drivers/rmenu_xui.cpp @@ -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; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 7affae5f57..2e8a26853e 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -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++) { diff --git a/menu/menu.c b/menu/menu.c index 7b5e6ec517..4e962b9d5e 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -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(); diff --git a/menu/menu.h b/menu/menu.h index 4b299f1e63..66be2d0119 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -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); diff --git a/menu/menu_entries_cbs_toggle.c b/menu/menu_entries_cbs_toggle.c index 534c023332..96cd56f5db 100644 --- a/menu/menu_entries_cbs_toggle.c +++ b/menu/menu_entries_cbs_toggle.c @@ -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 diff --git a/menu/menu_entry.c b/menu/menu_entry.c index 026c0bbd37..4754e1d1e2 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -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);