mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(display widgets) Cleanups
This commit is contained in:
parent
c9211aff57
commit
5a690b7ac8
@ -226,7 +226,9 @@ static void msg_widget_msg_transition_animation_done(void *userdata)
|
||||
}
|
||||
|
||||
void gfx_widgets_msg_queue_push(
|
||||
retro_task_t *task, const char *msg,
|
||||
void *data,
|
||||
retro_task_t *task,
|
||||
const char *msg,
|
||||
unsigned duration,
|
||||
char *title,
|
||||
enum message_queue_icon icon,
|
||||
@ -235,7 +237,7 @@ void gfx_widgets_msg_queue_push(
|
||||
bool menu_is_alive)
|
||||
{
|
||||
menu_widget_msg_t *msg_widget = NULL;
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)dispwidget_get_ptr();
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
||||
|
||||
if (fifo_write_avail(p_dispwidget->msg_queue) > 0)
|
||||
{
|
||||
@ -802,12 +804,13 @@ static void gfx_widgets_hourglass_tick(void *userdata)
|
||||
}
|
||||
|
||||
void gfx_widgets_iterate(
|
||||
void *data,
|
||||
unsigned width, unsigned height, bool fullscreen,
|
||||
const char *dir_assets, char *font_path,
|
||||
bool is_threaded)
|
||||
{
|
||||
size_t i;
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)dispwidget_get_ptr();
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
||||
/* Check whether screen dimensions or menu scale
|
||||
* factor have changed */
|
||||
float scale_factor = (
|
||||
@ -2298,9 +2301,11 @@ static void gfx_widgets_free(dispgfx_widget_t *p_dispwidget)
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
|
||||
bool gfx_widgets_set_fps_text(const char *new_fps_text)
|
||||
bool gfx_widgets_set_fps_text(
|
||||
void *data,
|
||||
const char *new_fps_text)
|
||||
{
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)dispwidget_get_ptr();
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
||||
|
||||
strlcpy(p_dispwidget->gfx_widgets_fps_text,
|
||||
new_fps_text, sizeof(p_dispwidget->gfx_widgets_fps_text));
|
||||
|
@ -362,6 +362,7 @@ bool gfx_widgets_init(
|
||||
bool gfx_widgets_deinit(bool widgets_persisting);
|
||||
|
||||
void gfx_widgets_msg_queue_push(
|
||||
void *data,
|
||||
retro_task_t *task, const char *msg,
|
||||
unsigned duration,
|
||||
char *title,
|
||||
@ -374,6 +375,7 @@ void gfx_widget_volume_update_and_show(float new_volume,
|
||||
bool mute);
|
||||
|
||||
void gfx_widgets_iterate(
|
||||
void *data,
|
||||
unsigned width, unsigned height, bool fullscreen,
|
||||
const char *dir_assets, char *font_path,
|
||||
bool is_threaded);
|
||||
@ -416,7 +418,9 @@ void gfx_widgets_frame(void *data);
|
||||
|
||||
void *dispwidget_get_ptr(void);
|
||||
|
||||
bool gfx_widgets_set_fps_text(const char *new_fps_text);
|
||||
bool gfx_widgets_set_fps_text(
|
||||
void *data,
|
||||
const char *new_fps_text);
|
||||
|
||||
extern const gfx_widget_t gfx_widget_screenshot;
|
||||
extern const gfx_widget_t gfx_widget_volume;
|
||||
|
28
retroarch.c
28
retroarch.c
@ -30701,6 +30701,7 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
if (msg_found)
|
||||
gfx_widgets_msg_queue_push(
|
||||
&p_rarch->dispwidget_st,
|
||||
NULL,
|
||||
msg_entry.msg,
|
||||
roundf((float)msg_entry.duration / 60.0f * 1000.0f),
|
||||
@ -30804,7 +30805,9 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||
{
|
||||
#if defined(HAVE_GFX_WIDGETS)
|
||||
if (widgets_active)
|
||||
gfx_widgets_set_fps_text(fps_text);
|
||||
gfx_widgets_set_fps_text(
|
||||
&p_rarch->dispwidget_st,
|
||||
fps_text);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
@ -34953,7 +34956,16 @@ static void runloop_task_msg_queue_push(
|
||||
if (is_accessibility_enabled(p_rarch))
|
||||
accessibility_speak_priority(p_rarch, (char*)msg, 0);
|
||||
#endif
|
||||
gfx_widgets_msg_queue_push(task, msg, duration, NULL, (enum message_queue_icon)MESSAGE_QUEUE_CATEGORY_INFO, (enum message_queue_category)MESSAGE_QUEUE_ICON_DEFAULT, prio, flush,
|
||||
gfx_widgets_msg_queue_push(
|
||||
&p_rarch->dispwidget_st,
|
||||
task,
|
||||
msg,
|
||||
duration,
|
||||
NULL,
|
||||
(enum message_queue_icon)MESSAGE_QUEUE_CATEGORY_INFO,
|
||||
(enum message_queue_category)MESSAGE_QUEUE_ICON_DEFAULT,
|
||||
prio,
|
||||
flush,
|
||||
#ifdef HAVE_MENU
|
||||
p_rarch->menu_driver_alive
|
||||
#else
|
||||
@ -35943,9 +35955,16 @@ void runloop_msg_queue_push(const char *msg,
|
||||
#if defined(HAVE_GFX_WIDGETS)
|
||||
if (widgets_active)
|
||||
{
|
||||
gfx_widgets_msg_queue_push(NULL, msg,
|
||||
gfx_widgets_msg_queue_push(
|
||||
&p_rarch->dispwidget_st,
|
||||
NULL,
|
||||
msg,
|
||||
roundf((float)duration / 60.0f * 1000.0f),
|
||||
title, icon, category, prio, flush,
|
||||
title,
|
||||
icon,
|
||||
category,
|
||||
prio,
|
||||
flush,
|
||||
#ifdef HAVE_MENU
|
||||
p_rarch->menu_driver_alive
|
||||
#else
|
||||
@ -36518,6 +36537,7 @@ static enum runloop_state runloop_check_state(
|
||||
|
||||
RUNLOOP_MSG_QUEUE_LOCK();
|
||||
gfx_widgets_iterate(
|
||||
&p_rarch->dispwidget_st,
|
||||
p_rarch->video_driver_width,
|
||||
p_rarch->video_driver_height,
|
||||
video_is_fullscreen,
|
||||
|
Loading…
x
Reference in New Issue
Block a user