Create wrapper functions menu_display_fb_set_dirty and menu_display_fb_unset_dirty

This commit is contained in:
twinaphex 2015-05-18 23:14:56 +02:00
parent 6feb1603f7
commit a49e50896c
9 changed files with 34 additions and 21 deletions

View File

@ -1092,15 +1092,10 @@ bool event_command(enum event_command cmd)
input_driver_poll();
#ifdef HAVE_MENU
{
menu_handle_t *menu = menu_driver_get_ptr();
if (menu && menu_display_fb_in_use())
menu->framebuf.dirty = true;
menu_display_fb_set_dirty();
if (runloop->is_menu)
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
}
if (runloop->is_menu)
event_command(EVENT_CMD_VIDEO_SET_BLOCKING_STATE);
#endif
break;
case EVENT_CMD_CHEATS_DEINIT:

View File

@ -353,7 +353,7 @@ static void rgui_render(void)
return;
/* ensures the framebuffer will be rendered on the screen */
menu->framebuf.dirty = true;
menu_display_fb_set_dirty();
menu->animation_is_active = false;
menu->label.is_updated = false;
@ -563,10 +563,8 @@ static void rgui_set_texture(void)
if (!menu)
return;
if (!menu->framebuf.dirty)
return;
menu->framebuf.dirty = false;
menu_display_fb_unset_dirty();
video_driver_set_texture_frame(
menu->frame_buf.data, false,

View File

@ -147,7 +147,7 @@ static void rmenu_render(void)
&& !menu->msg_force)
return;
menu->framebuf.dirty = false;
menu_display_fb_unset_dirty();
menu->animation_is_active = false;
menu->label.is_updated = false;

View File

@ -542,7 +542,7 @@ static void rmenu_xui_render(void)
runloop->is_menu && !menu->msg_force)
return;
menu->framebuf.dirty = false;
menu_display_fb_unset_dirty();
menu->animation_is_active = false;
menu->label.is_updated = false;

View File

@ -169,7 +169,7 @@ void *menu_init(const void *data)
rarch_assert(menu->msg_queue = msg_queue_new(8));
menu->framebuf.dirty = true;
menu_display_fb_set_dirty();
return menu;
error:

View File

@ -30,6 +30,26 @@ bool menu_display_fb_in_use(void)
return menu->frame_buf.data != NULL;
}
void menu_display_fb_set_dirty(void)
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return false;
if (!menu_display_fb_in_use())
return false;
menu->framebuf.dirty = true;
}
void menu_display_fb_unset_dirty(void)
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return false;
if (!menu_display_fb_in_use())
return false;
menu->framebuf.dirty = false;
}
bool menu_display_update_pending(void)
{
menu_handle_t *menu = menu_driver_get_ptr();

View File

@ -29,6 +29,10 @@ void menu_display_fb(void);
bool menu_display_fb_in_use(void);
void menu_display_fb_set_dirty(void);
void menu_display_fb_unset_dirty(void);
void menu_display_free(menu_handle_t *menu);
bool menu_display_init(menu_handle_t *menu);

View File

@ -1843,8 +1843,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_HELP:
menu_list_push(info->list, info->path, info->label, info->type, info->directory_ptr);
menu->push_start_screen = false;
if (menu_display_fb_in_use())
menu->framebuf.dirty = true;
menu_display_fb_set_dirty();
break;
case DISPLAYLIST_MAIN_MENU:
case DISPLAYLIST_SETTINGS:

View File

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