mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Create menu_refresh
This commit is contained in:
parent
8f0b03d920
commit
7baa41422d
24
menu/menu.c
24
menu/menu.c
@ -258,6 +258,21 @@ void menu_free(menu_handle_t *menu)
|
||||
free(menu);
|
||||
}
|
||||
|
||||
int menu_refresh(void)
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
if (!menu->need_refresh)
|
||||
return -1;
|
||||
if (menu->nonblocking_refresh)
|
||||
return -1;
|
||||
if (menu->input.joypad == MENU_ACTION_MESSAGE)
|
||||
return -1;
|
||||
|
||||
menu_entry_iterate(MENU_ACTION_REFRESH);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* menu_iterate:
|
||||
* @input : input sample for this frame
|
||||
@ -275,7 +290,6 @@ int menu_iterate(retro_input_t input,
|
||||
static retro_time_t last_clock_update = 0;
|
||||
int32_t ret = 0;
|
||||
unsigned action = 0;
|
||||
runloop_t *runloop = rarch_main_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -297,16 +311,8 @@ int menu_iterate(retro_input_t input,
|
||||
|
||||
action = menu->input.joypad;
|
||||
|
||||
if (menu->need_refresh && !menu->nonblocking_refresh && action != MENU_ACTION_MESSAGE)
|
||||
action = MENU_ACTION_REFRESH;
|
||||
|
||||
menu_entry_iterate(action);
|
||||
|
||||
if (runloop->is_menu && !runloop->is_idle)
|
||||
menu_display_fb();
|
||||
|
||||
menu_driver_set_texture();
|
||||
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
|
@ -154,6 +154,8 @@ typedef enum
|
||||
**/
|
||||
void *menu_init(const void *data);
|
||||
|
||||
int menu_refresh(void);
|
||||
|
||||
/**
|
||||
* menu_iterate:
|
||||
* @input : input sample for this frame
|
||||
|
@ -206,3 +206,13 @@ void menu_display_unset_viewport(void)
|
||||
video_driver_set_viewport(global->video_data.width,
|
||||
global->video_data.height, false, true);
|
||||
}
|
||||
|
||||
void menu_display_frame(void)
|
||||
{
|
||||
runloop_t *runloop = rarch_main_get_ptr();
|
||||
|
||||
if (runloop->is_menu && !runloop->is_idle)
|
||||
menu_display_fb();
|
||||
|
||||
menu_driver_set_texture();
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ void menu_display_set_viewport(void);
|
||||
|
||||
void menu_display_unset_viewport(void);
|
||||
|
||||
void menu_display_frame(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
14
runloop.c
14
runloop.c
@ -29,6 +29,7 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu.h"
|
||||
#include "menu/menu_display.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
@ -1113,15 +1114,20 @@ int rarch_main_iterate(void)
|
||||
rarch_main_data_iterate();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (runloop->is_menu)
|
||||
if (menu_refresh() == -1)
|
||||
{
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
if (menu)
|
||||
if (runloop->is_menu)
|
||||
{
|
||||
if (menu_iterate(input, old_input, trigger_input) == -1)
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
|
||||
}
|
||||
}
|
||||
|
||||
if (runloop->is_menu)
|
||||
{
|
||||
if (!input && settings->menu.pause_libretro)
|
||||
ret = 1;
|
||||
ret = 1;
|
||||
menu_display_frame();
|
||||
goto success;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user