Cut down on menu_driver_ctl usage from within video drivers

This commit is contained in:
twinaphex 2017-01-22 17:30:32 +01:00
parent 73e621ad32
commit d4b7edff4a
5 changed files with 11 additions and 6 deletions

View File

@ -137,7 +137,7 @@ static bool caca_gfx_frame(void *data, const void *frame,
if (!caca_cv)
return true;
if (caca_menu_frame && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (caca_menu_frame && video_info->menu_is_alive)
frame_to_copy = caca_menu_frame;
width = caca_get_canvas_width(caca_cv);
@ -149,7 +149,7 @@ static bool caca_gfx_frame(void *data, const void *frame,
(frame_width < width && frame_height < height))
draw = false;
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (video_info->menu_is_alive)
draw = false;
caca_clear_canvas(caca_cv);

View File

@ -184,7 +184,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
}
}
if (gdi_menu_frame && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (gdi_menu_frame && video_info->menu_is_alive)
{
frame_to_copy = gdi_menu_frame;
width = gdi_menu_width;
@ -201,7 +201,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
if (frame_width == 4 && frame_height == 4 && (frame_width < width && frame_height < height))
draw = false;
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (video_info->menu_is_alive)
draw = false;
}

View File

@ -172,7 +172,7 @@ static bool vga_gfx_frame(void *data, const void *frame,
}
}
if (vga_menu_frame && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (vga_menu_frame && video_info->menu_is_alive)
{
frame_to_copy = vga_menu_frame;
width = vga_menu_width;
@ -189,7 +189,7 @@ static bool vga_gfx_frame(void *data, const void *frame,
if (frame_width == 4 && frame_height == 4 && (frame_width < width && frame_height < height))
draw = false;
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
if (video_info->menu_is_alive)
draw = false;
}

View File

@ -39,6 +39,7 @@
#endif
#ifdef HAVE_MENU
#include "../menu/menu_driver.h"
#include "../menu/menu_setting.h"
#endif
@ -2289,6 +2290,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
video_info->libretro_running = false;
#ifdef HAVE_MENU
video_info->menu_is_alive = menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL);
video_info->menu_footer_opacity = settings->menu.footer.opacity;
video_info->menu_header_opacity = settings->menu.header.opacity;
video_info->materialui_color_theme = settings->menu.materialui.menu_color_theme;
@ -2305,6 +2307,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
video_info->libretro_running = (rarch_ctl(RARCH_CTL_IS_INITED, NULL)
&& !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL));
#else
video_info->menu_is_alive = false;
video_info->menu_footer_opacity = 0.0f;
video_info->menu_header_opacity = 0.0f;
video_info->materialui_color_theme = 0;

View File

@ -131,6 +131,8 @@ typedef struct video_frame_info
bool runloop_is_slowmotion;
bool runloop_is_idle;
bool runloop_is_paused;
bool menu_is_alive;
} video_frame_info_t;
/* Optionally implemented interface to poke more