mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Move widgets_persisting to retroarch.c
This commit is contained in:
parent
73b5bf438b
commit
57c3b1b041
@ -144,7 +144,6 @@ typedef struct dispgfx_widget
|
||||
* avoid confusing users */
|
||||
bool widgets_moving;
|
||||
bool widgets_inited;
|
||||
bool widgets_persisting;
|
||||
bool msg_queue_has_icons;
|
||||
#ifdef HAVE_MENU
|
||||
bool load_content_animation_running;
|
||||
@ -331,12 +330,6 @@ void *dispwidget_get_ptr(void)
|
||||
return &dispwidget_st;
|
||||
}
|
||||
|
||||
void gfx_widgets_set_persistence(bool persist)
|
||||
{
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)dispwidget_get_ptr();
|
||||
p_dispwidget->widgets_persisting = persist;
|
||||
}
|
||||
|
||||
gfx_widget_font_data_t* gfx_widgets_get_font_regular(void *data)
|
||||
{
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)data;
|
||||
@ -2082,7 +2075,7 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool gfx_widgets_deinit(void)
|
||||
bool gfx_widgets_deinit(bool widgets_persisting)
|
||||
{
|
||||
dispgfx_widget_t *p_dispwidget = (dispgfx_widget_t*)dispwidget_get_ptr();
|
||||
if (!p_dispwidget->widgets_inited)
|
||||
@ -2090,7 +2083,7 @@ bool gfx_widgets_deinit(void)
|
||||
|
||||
gfx_widgets_context_destroy(p_dispwidget);
|
||||
|
||||
if (!p_dispwidget->widgets_persisting)
|
||||
if (!widgets_persisting)
|
||||
gfx_widgets_free(p_dispwidget);
|
||||
|
||||
return true;
|
||||
|
@ -159,15 +159,13 @@ void gfx_widgets_flush_text(
|
||||
|
||||
typedef struct gfx_widget gfx_widget_t;
|
||||
|
||||
void gfx_widgets_set_persistence(bool persist);
|
||||
|
||||
bool gfx_widgets_init(
|
||||
uintptr_t widgets_active_ptr,
|
||||
bool video_is_threaded,
|
||||
unsigned width, unsigned height, bool fullscreen,
|
||||
const char *dir_assets, char *font_path);
|
||||
|
||||
bool gfx_widgets_deinit(void);
|
||||
bool gfx_widgets_deinit(bool widgets_persisting);
|
||||
|
||||
void gfx_widgets_msg_queue_push(
|
||||
retro_task_t *task, const char *msg,
|
||||
|
@ -1827,6 +1827,7 @@ struct rarch_state
|
||||
|
||||
#ifdef HAVE_GFX_WIDGETS
|
||||
bool widgets_active;
|
||||
bool widgets_persisting;
|
||||
#endif
|
||||
#ifdef HAVE_NETWORKING
|
||||
/* Only used before init_netplay */
|
||||
@ -15742,7 +15743,7 @@ void main_exit(void *args)
|
||||
|
||||
#if defined(HAVE_GFX_WIDGETS)
|
||||
/* Do not want display widgets to live any more. */
|
||||
gfx_widgets_set_persistence(false);
|
||||
p_rarch->widgets_persisting = false;
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
/* Do not want menu context to live any more. */
|
||||
@ -32320,7 +32321,7 @@ static void drivers_init(struct rarch_state *p_rarch, int flags)
|
||||
bool menu_enable_widgets = settings->bools.menu_enable_widgets;
|
||||
|
||||
/* By default, we want display widgets to persist through driver reinits. */
|
||||
gfx_widgets_set_persistence(true);
|
||||
p_rarch->widgets_persisting = true;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
@ -32495,7 +32496,7 @@ static void driver_uninit(struct rarch_state *p_rarch, int flags)
|
||||
/* This absolutely has to be done before video_driver_free_internal()
|
||||
* is called/completes, otherwise certain menu drivers
|
||||
* (e.g. Vulkan) will segfault */
|
||||
if (gfx_widgets_deinit())
|
||||
if (gfx_widgets_deinit(p_rarch->widgets_persisting))
|
||||
p_rarch->widgets_active = false;
|
||||
#endif
|
||||
|
||||
@ -32562,7 +32563,7 @@ static void retroarch_deinit_drivers(struct rarch_state *p_rarch)
|
||||
* in case the handle is lost in the threaded
|
||||
* video driver in the meantime
|
||||
* (breaking video_driver_has_widgets) */
|
||||
if (gfx_widgets_deinit())
|
||||
if (gfx_widgets_deinit(p_rarch->widgets_persisting))
|
||||
p_rarch->widgets_active = false;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user