Create MENU_DISPLAY_CTL_UPDATE_PENDING

This commit is contained in:
twinaphex 2015-09-25 14:07:01 +02:00
parent 8629697afb
commit 4e4bad9eba
5 changed files with 13 additions and 15 deletions

View File

@ -327,7 +327,7 @@ static void glui_render_menu_list(glui_handle_t *glui,
menu_display_t *disp = menu_display_get_ptr();
menu_navigation_t *nav = menu_navigation_get_ptr();
if (!menu_display_update_pending())
if (!menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL))
return;
glui->list_block.carr.coords.vertices = 0;

View File

@ -422,7 +422,7 @@ static void rgui_render(void)
if (rarch_main_is_idle())
return;
if (!menu_display_update_pending())
if (!menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL))
return;
}

View File

@ -67,15 +67,6 @@ void menu_display_libretro(void)
video_driver_cached_frame();
}
bool menu_display_update_pending(void)
{
menu_animation_t *anim = menu_animation_get_ptr();
menu_framebuf_t *frame_buf = menu_display_fb_get_ptr();
if (menu_animation_is_active(anim) || (frame_buf && frame_buf->dirty))
return true;
return false;
}
static void menu_display_fb_free(menu_framebuf_t *frame_buf)
{
@ -227,6 +218,14 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
switch (state)
{
case MENU_DISPLAY_CTL_UPDATE_PENDING:
{
menu_animation_t *anim = menu_animation_get_ptr();
if (menu_animation_is_active(anim) || (frame_buf && frame_buf->dirty))
return true;
}
return false;
case MENU_DISPLAY_CTL_SET_VIEWPORT:
video_driver_get_size(&width, &height);
video_driver_set_viewport(width,

View File

@ -35,7 +35,8 @@ enum menu_display_ctl_state
MENU_DISPLAY_CTL_UNSET_VIEWPORT,
MENU_DISPLAY_CTL_SET_FRAMEBUFFER_DIRTY_FLAG,
MENU_DISPLAY_CTL_UNSET_FRAMEBUFFER_DIRTY_FLAG,
MENU_DISPLAY_CTL_GET_DPI
MENU_DISPLAY_CTL_GET_DPI,
MENU_DISPLAY_CTL_UPDATE_PENDING
};
typedef struct menu_framebuf
@ -78,8 +79,6 @@ void menu_display_free(void *data);
bool menu_display_init(void *data);
bool menu_display_update_pending(void);
bool menu_display_font_init_first(const void **font_driver,
void **font_handle, void *video_data, const char *font_path,
float font_size);

View File

@ -449,7 +449,7 @@ int menu_iterate(bool render_this_frame, unsigned action)
iterate_type = action_iterate_type(hash);
if (action != MENU_ACTION_NOOP || menu_entries_needs_refresh() || menu_display_update_pending())
if (action != MENU_ACTION_NOOP || menu_entries_needs_refresh() || menu_display_ctl(MENU_DISPLAY_CTL_UPDATE_PENDING, NULL))
{
if (render_this_frame)
BIT64_SET(menu->state, MENU_STATE_RENDER_FRAMEBUFFER);