mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-26 21:36:26 +00:00
Get rid of rarch_ctl/runloop_ctl calls from menu_display.c
This commit is contained in:
parent
34870290cd
commit
a7d09733a6
@ -463,9 +463,12 @@ static void blit_line(int x, int y, const char *message, bool green)
|
||||
|
||||
static void xui_render_background(void)
|
||||
{
|
||||
#if 0
|
||||
/* TODO/FIXME - refactor this */
|
||||
if (menu_display_libretro_running())
|
||||
XuiElementSetShow(m_background, FALSE);
|
||||
else
|
||||
#endif
|
||||
XuiElementSetShow(m_background, TRUE);
|
||||
}
|
||||
|
||||
|
@ -312,23 +312,24 @@ void menu_display_set_font_framebuffer(const uint8_t *buffer)
|
||||
menu_display_font_framebuf = buffer;
|
||||
}
|
||||
|
||||
bool menu_display_libretro_running(void)
|
||||
static bool menu_display_libretro_running(
|
||||
bool rarch_is_inited,
|
||||
bool rarch_is_dummy_core)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!settings->bools.menu_pause_libretro)
|
||||
{
|
||||
if (rarch_ctl(RARCH_CTL_IS_INITED, NULL)
|
||||
&& !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
|
||||
if (rarch_is_inited && !rarch_is_dummy_core)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool menu_display_libretro(void)
|
||||
bool menu_display_libretro(bool is_idle, bool rarch_is_inited, bool rarch_is_dummy_core)
|
||||
{
|
||||
video_driver_set_texture_enable(true, false);
|
||||
|
||||
if (menu_display_libretro_running())
|
||||
if (menu_display_libretro_running(rarch_is_inited, rarch_is_dummy_core))
|
||||
{
|
||||
if (!input_driver_is_libretro_input_blocked())
|
||||
input_driver_set_libretro_input_blocked();
|
||||
@ -339,7 +340,7 @@ bool menu_display_libretro(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
|
||||
if (is_idle)
|
||||
return true; /* Maybe return false here for indication of idleness? */
|
||||
return video_driver_cached_frame();
|
||||
}
|
||||
|
@ -215,8 +215,7 @@ void menu_display_coords_array_reset(void);
|
||||
video_coord_array_t *menu_display_get_coords_array(void);
|
||||
const uint8_t *menu_display_get_font_framebuffer(void);
|
||||
void menu_display_set_font_framebuffer(const uint8_t *buffer);
|
||||
bool menu_display_libretro_running(void);
|
||||
bool menu_display_libretro(void);
|
||||
bool menu_display_libretro(bool is_idle, bool is_inited, bool is_dummy);
|
||||
|
||||
void menu_display_set_width(unsigned width);
|
||||
void menu_display_get_fb_size(unsigned *fb_width, unsigned *fb_height,
|
||||
|
@ -332,7 +332,8 @@ static void menu_update_libretro_info(void)
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
}
|
||||
|
||||
bool menu_driver_render(bool is_idle)
|
||||
bool menu_driver_render(bool is_idle, bool rarch_is_inited,
|
||||
bool rarch_is_dummy_core)
|
||||
{
|
||||
if (!menu_driver_data)
|
||||
return false;
|
||||
@ -369,7 +370,7 @@ bool menu_driver_render(bool is_idle)
|
||||
}
|
||||
|
||||
if (menu_driver_alive && !is_idle)
|
||||
menu_display_libretro();
|
||||
menu_display_libretro(is_idle, rarch_is_inited, rarch_is_dummy_core);
|
||||
|
||||
if (menu_driver_ctx->set_texture)
|
||||
menu_driver_ctx->set_texture();
|
||||
|
@ -379,7 +379,7 @@ extern unsigned int rdb_entry_start_game_selection_ptr;
|
||||
|
||||
const char *menu_driver_ident(void);
|
||||
|
||||
bool menu_driver_render(bool is_idle);
|
||||
bool menu_driver_render(bool is_idle, bool is_inited, bool is_dummy);
|
||||
|
||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
||||
|
||||
|
@ -2376,7 +2376,10 @@ static enum runloop_state runloop_check_state(
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
|
||||
|
||||
if (focused || !runloop_idle)
|
||||
menu_driver_render(runloop_idle);
|
||||
menu_driver_render(runloop_idle, rarch_is_inited,
|
||||
(current_core_type == CORE_TYPE_DUMMY)
|
||||
)
|
||||
;
|
||||
|
||||
if (!focused)
|
||||
return RUNLOOP_STATE_SLEEP;
|
||||
|
Loading…
x
Reference in New Issue
Block a user