mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +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(
|
void gfx_widgets_msg_queue_push(
|
||||||
retro_task_t *task, const char *msg,
|
void *data,
|
||||||
|
retro_task_t *task,
|
||||||
|
const char *msg,
|
||||||
unsigned duration,
|
unsigned duration,
|
||||||
char *title,
|
char *title,
|
||||||
enum message_queue_icon icon,
|
enum message_queue_icon icon,
|
||||||
@ -235,7 +237,7 @@ void gfx_widgets_msg_queue_push(
|
|||||||
bool menu_is_alive)
|
bool menu_is_alive)
|
||||||
{
|
{
|
||||||
menu_widget_msg_t *msg_widget = NULL;
|
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)
|
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 gfx_widgets_iterate(
|
||||||
|
void *data,
|
||||||
unsigned width, unsigned height, bool fullscreen,
|
unsigned width, unsigned height, bool fullscreen,
|
||||||
const char *dir_assets, char *font_path,
|
const char *dir_assets, char *font_path,
|
||||||
bool is_threaded)
|
bool is_threaded)
|
||||||
{
|
{
|
||||||
size_t i;
|
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
|
/* Check whether screen dimensions or menu scale
|
||||||
* factor have changed */
|
* factor have changed */
|
||||||
float scale_factor = (
|
float scale_factor = (
|
||||||
@ -2298,9 +2301,11 @@ static void gfx_widgets_free(dispgfx_widget_t *p_dispwidget)
|
|||||||
font_driver_bind_block(NULL, NULL);
|
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,
|
strlcpy(p_dispwidget->gfx_widgets_fps_text,
|
||||||
new_fps_text, sizeof(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);
|
bool gfx_widgets_deinit(bool widgets_persisting);
|
||||||
|
|
||||||
void gfx_widgets_msg_queue_push(
|
void gfx_widgets_msg_queue_push(
|
||||||
|
void *data,
|
||||||
retro_task_t *task, const char *msg,
|
retro_task_t *task, const char *msg,
|
||||||
unsigned duration,
|
unsigned duration,
|
||||||
char *title,
|
char *title,
|
||||||
@ -374,6 +375,7 @@ void gfx_widget_volume_update_and_show(float new_volume,
|
|||||||
bool mute);
|
bool mute);
|
||||||
|
|
||||||
void gfx_widgets_iterate(
|
void gfx_widgets_iterate(
|
||||||
|
void *data,
|
||||||
unsigned width, unsigned height, bool fullscreen,
|
unsigned width, unsigned height, bool fullscreen,
|
||||||
const char *dir_assets, char *font_path,
|
const char *dir_assets, char *font_path,
|
||||||
bool is_threaded);
|
bool is_threaded);
|
||||||
@ -416,7 +418,9 @@ void gfx_widgets_frame(void *data);
|
|||||||
|
|
||||||
void *dispwidget_get_ptr(void);
|
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_screenshot;
|
||||||
extern const gfx_widget_t gfx_widget_volume;
|
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)
|
if (msg_found)
|
||||||
gfx_widgets_msg_queue_push(
|
gfx_widgets_msg_queue_push(
|
||||||
|
&p_rarch->dispwidget_st,
|
||||||
NULL,
|
NULL,
|
||||||
msg_entry.msg,
|
msg_entry.msg,
|
||||||
roundf((float)msg_entry.duration / 60.0f * 1000.0f),
|
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 defined(HAVE_GFX_WIDGETS)
|
||||||
if (widgets_active)
|
if (widgets_active)
|
||||||
gfx_widgets_set_fps_text(fps_text);
|
gfx_widgets_set_fps_text(
|
||||||
|
&p_rarch->dispwidget_st,
|
||||||
|
fps_text);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -34953,7 +34956,16 @@ static void runloop_task_msg_queue_push(
|
|||||||
if (is_accessibility_enabled(p_rarch))
|
if (is_accessibility_enabled(p_rarch))
|
||||||
accessibility_speak_priority(p_rarch, (char*)msg, 0);
|
accessibility_speak_priority(p_rarch, (char*)msg, 0);
|
||||||
#endif
|
#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
|
#ifdef HAVE_MENU
|
||||||
p_rarch->menu_driver_alive
|
p_rarch->menu_driver_alive
|
||||||
#else
|
#else
|
||||||
@ -35943,9 +35955,16 @@ void runloop_msg_queue_push(const char *msg,
|
|||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (widgets_active)
|
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),
|
roundf((float)duration / 60.0f * 1000.0f),
|
||||||
title, icon, category, prio, flush,
|
title,
|
||||||
|
icon,
|
||||||
|
category,
|
||||||
|
prio,
|
||||||
|
flush,
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
p_rarch->menu_driver_alive
|
p_rarch->menu_driver_alive
|
||||||
#else
|
#else
|
||||||
@ -36518,6 +36537,7 @@ static enum runloop_state runloop_check_state(
|
|||||||
|
|
||||||
RUNLOOP_MSG_QUEUE_LOCK();
|
RUNLOOP_MSG_QUEUE_LOCK();
|
||||||
gfx_widgets_iterate(
|
gfx_widgets_iterate(
|
||||||
|
&p_rarch->dispwidget_st,
|
||||||
p_rarch->video_driver_width,
|
p_rarch->video_driver_width,
|
||||||
p_rarch->video_driver_height,
|
p_rarch->video_driver_height,
|
||||||
video_is_fullscreen,
|
video_is_fullscreen,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user