mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
(RGUI) Fix delayed info/help/search screens
This commit is contained in:
parent
d188f4e261
commit
71f025c2b6
@ -52,6 +52,10 @@
|
|||||||
#define TITLE_COLOR(settings) (argb32_to_rgba4444(settings->menu.title_color))
|
#define TITLE_COLOR(settings) (argb32_to_rgba4444(settings->menu.title_color))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char msgbox[4096];
|
||||||
|
} rgui_t;
|
||||||
|
|
||||||
static INLINE uint16_t argb32_to_rgba4444(uint32_t col)
|
static INLINE uint16_t argb32_to_rgba4444(uint32_t col)
|
||||||
{
|
{
|
||||||
unsigned a = ((col >> 24) & 0xff) >> 4;
|
unsigned a = ((col >> 24) & 0xff) >> 4;
|
||||||
@ -253,6 +257,18 @@ static void rgui_render_background(void)
|
|||||||
green_filler);
|
green_filler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rgui_set_message(const char *message)
|
||||||
|
{
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
rgui_t *rgui = NULL;
|
||||||
|
|
||||||
|
if (!menu || !menu->userdata)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rgui = (rgui_t*)menu->userdata;
|
||||||
|
strlcpy(rgui->msgbox, message, sizeof(rgui->msgbox));
|
||||||
|
}
|
||||||
|
|
||||||
static void rgui_render_messagebox(const char *message)
|
static void rgui_render_messagebox(const char *message)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -359,6 +375,7 @@ static void rgui_render(void)
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
menu_animation_t *anim = menu_animation_get_ptr();
|
menu_animation_t *anim = menu_animation_get_ptr();
|
||||||
uint64_t frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_driver_get_frame_count();
|
||||||
|
rgui_t *rgui = NULL;
|
||||||
|
|
||||||
title[0] = '\0';
|
title[0] = '\0';
|
||||||
title_buf[0] = '\0';
|
title_buf[0] = '\0';
|
||||||
@ -367,16 +384,17 @@ static void rgui_render(void)
|
|||||||
|
|
||||||
(void)driver;
|
(void)driver;
|
||||||
|
|
||||||
if (!menu)
|
if (!menu || !menu->userdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (menu_entries_needs_refresh() && menu_driver_alive() && !disp->msg_force)
|
rgui = menu->userdata;
|
||||||
return;
|
|
||||||
|
|
||||||
if (runloop->is_idle)
|
if (menu_entries_needs_refresh()
|
||||||
return;
|
&& menu_driver_alive()
|
||||||
|
&& !disp->msg_force
|
||||||
if (!menu_display_update_pending())
|
&& runloop->is_idle
|
||||||
|
&& !menu_display_update_pending()
|
||||||
|
&& rgui->msgbox[0] == '\0')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* ensures the framebuffer will be rendered on the screen */
|
/* ensures the framebuffer will be rendered on the screen */
|
||||||
@ -384,6 +402,7 @@ static void rgui_render(void)
|
|||||||
anim->is_active = false;
|
anim->is_active = false;
|
||||||
anim->label.is_updated = false;
|
anim->label.is_updated = false;
|
||||||
|
|
||||||
|
|
||||||
if (settings->menu.pointer.enable)
|
if (settings->menu.pointer.enable)
|
||||||
{
|
{
|
||||||
menu_input->pointer.ptr = menu_input->pointer.y / 11 - 2 + menu_entries_get_start();
|
menu_input->pointer.ptr = menu_input->pointer.y / 11 - 2 + menu_entries_get_start();
|
||||||
@ -530,6 +549,12 @@ static void rgui_render(void)
|
|||||||
rgui_render_messagebox(msg);
|
rgui_render_messagebox(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rgui->msgbox[0] != '\0')
|
||||||
|
{
|
||||||
|
rgui_render_messagebox(rgui->msgbox);
|
||||||
|
rgui->msgbox[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (settings->menu.mouse.enable)
|
if (settings->menu.mouse.enable)
|
||||||
rgui_blit_cursor(menu);
|
rgui_blit_cursor(menu);
|
||||||
}
|
}
|
||||||
@ -539,10 +564,16 @@ static void *rgui_init(void)
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
menu_framebuf_t *frame_buf = NULL;
|
menu_framebuf_t *frame_buf = NULL;
|
||||||
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
||||||
|
rgui_t *rgui = NULL;
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
menu->userdata = rgui = (rgui_t*)calloc(1, sizeof(rgui_t));
|
||||||
|
|
||||||
|
if (!rgui)
|
||||||
|
goto error;
|
||||||
|
|
||||||
frame_buf = &menu->display.frame_buf;
|
frame_buf = &menu->display.frame_buf;
|
||||||
|
|
||||||
/* 4 extra lines to cache the checked background */
|
/* 4 extra lines to cache the checked background */
|
||||||
@ -687,7 +718,7 @@ static void rgui_populate_entries(const char *path,
|
|||||||
|
|
||||||
menu_ctx_driver_t menu_ctx_rgui = {
|
menu_ctx_driver_t menu_ctx_rgui = {
|
||||||
rgui_set_texture,
|
rgui_set_texture,
|
||||||
rgui_render_messagebox,
|
rgui_set_message,
|
||||||
rgui_render,
|
rgui_render,
|
||||||
NULL,
|
NULL,
|
||||||
rgui_init,
|
rgui_init,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user