Enable widget persistence across drivers_init()/driver_uninit() events
This commit is contained in:
parent
2a0833378d
commit
086c68bca7
|
@ -295,7 +295,7 @@
|
||||||
{
|
{
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
bool widgets_active = gfx_widgets_active();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[self _beginFrame];
|
[self _beginFrame];
|
||||||
|
@ -338,7 +338,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
if (widgets_active)
|
||||||
{
|
{
|
||||||
[rce pushDebugGroup:@"menu widgets"];
|
[rce pushDebugGroup:@"menu widgets"];
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
|
|
|
@ -1206,7 +1206,6 @@ static bool d3d10_gfx_frame(
|
||||||
D3D10Device context = d3d10->device;
|
D3D10Device context = d3d10->device;
|
||||||
unsigned video_width = video_info->width;
|
unsigned video_width = video_info->width;
|
||||||
unsigned video_height = video_info->height;
|
unsigned video_height = video_info->height;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
struct font_params
|
struct font_params
|
||||||
*osd_params = (struct font_params*)
|
*osd_params = (struct font_params*)
|
||||||
|
@ -1510,7 +1509,6 @@ static bool d3d10_gfx_frame(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1285,7 +1285,6 @@ static bool d3d11_gfx_frame(
|
||||||
d3d11_texture_t* texture = NULL;
|
d3d11_texture_t* texture = NULL;
|
||||||
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
||||||
D3D11DeviceContext context = d3d11->context;
|
D3D11DeviceContext context = d3d11->context;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
const char *stat_text = video_info->stat_text;
|
const char *stat_text = video_info->stat_text;
|
||||||
unsigned video_width = video_info->width;
|
unsigned video_width = video_info->width;
|
||||||
unsigned video_height = video_info->height;
|
unsigned video_height = video_info->height;
|
||||||
|
@ -1583,7 +1582,6 @@ static bool d3d11_gfx_frame(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1170,7 +1170,6 @@ static bool d3d12_gfx_frame(
|
||||||
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
||||||
const char *stat_text = video_info->stat_text;
|
const char *stat_text = video_info->stat_text;
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
unsigned video_width = video_info->width;
|
unsigned video_width = video_info->width;
|
||||||
unsigned video_height = video_info->height;
|
unsigned video_height = video_info->height;
|
||||||
struct font_params *osd_params = (struct font_params*)
|
struct font_params *osd_params = (struct font_params*)
|
||||||
|
@ -1566,7 +1565,6 @@ static bool d3d12_gfx_frame(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1528,7 +1528,6 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||||
unsigned width = video_info->width;
|
unsigned width = video_info->width;
|
||||||
unsigned height = video_info->height;
|
unsigned height = video_info->height;
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
bool black_frame_insertion = video_info->black_frame_insertion;
|
bool black_frame_insertion = video_info->black_frame_insertion;
|
||||||
struct font_params *osd_params = (struct font_params*)
|
struct font_params *osd_params = (struct font_params*)
|
||||||
&video_info->osd_stat_params;
|
&video_info->osd_stat_params;
|
||||||
|
@ -1628,7 +1627,6 @@ static bool d3d9_frame(void *data, const void *frame,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2813,7 +2813,6 @@ static bool gl2_frame(void *data, const void *frame,
|
||||||
unsigned height = gl->video_height;
|
unsigned height = gl->video_height;
|
||||||
bool use_rgba = video_info->use_rgba;
|
bool use_rgba = video_info->use_rgba;
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
bool msg_bgcolor_enable = video_info->msg_bgcolor_enable;
|
bool msg_bgcolor_enable = video_info->msg_bgcolor_enable;
|
||||||
bool black_frame_insertion = video_info->black_frame_insertion;
|
bool black_frame_insertion = video_info->black_frame_insertion;
|
||||||
bool input_driver_nonblock_state = video_info->input_driver_nonblock_state;
|
bool input_driver_nonblock_state = video_info->input_driver_nonblock_state;
|
||||||
|
@ -3051,7 +3050,6 @@ static bool gl2_frame(void *data, const void *frame,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -858,7 +858,6 @@ static bool gl1_gfx_frame(void *data, const void *frame,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (video_info->widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1843,7 +1843,6 @@ static bool gl_core_frame(void *data, const void *frame,
|
||||||
&video_info->osd_stat_params;
|
&video_info->osd_stat_params;
|
||||||
const char *stat_text = video_info->stat_text;
|
const char *stat_text = video_info->stat_text;
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
bool msg_bgcolor_enable = video_info->msg_bgcolor_enable;
|
bool msg_bgcolor_enable = video_info->msg_bgcolor_enable;
|
||||||
bool black_frame_insertion = video_info->black_frame_insertion;
|
bool black_frame_insertion = video_info->black_frame_insertion;
|
||||||
void *context_data = video_info->context_data;
|
void *context_data = video_info->context_data;
|
||||||
|
@ -1938,7 +1937,6 @@ static bool gl_core_frame(void *data, const void *frame,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1348,7 +1348,6 @@ static bool wiiu_gfx_frame(void *data, const void *frame,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (video_info->widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1677,7 +1677,6 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||||
void *context_data = video_info->context_data;
|
void *context_data = video_info->context_data;
|
||||||
bool statistics_show = video_info->statistics_show;
|
bool statistics_show = video_info->statistics_show;
|
||||||
const char *stat_text = video_info->stat_text;
|
const char *stat_text = video_info->stat_text;
|
||||||
bool widgets_inited = video_info->widgets_inited;
|
|
||||||
bool black_frame_insertion = video_info->black_frame_insertion;
|
bool black_frame_insertion = video_info->black_frame_insertion;
|
||||||
bool input_driver_nonblock_state = video_info->input_driver_nonblock_state;
|
bool input_driver_nonblock_state = video_info->input_driver_nonblock_state;
|
||||||
bool runloop_is_slowmotion = video_info->runloop_is_slowmotion;
|
bool runloop_is_slowmotion = video_info->runloop_is_slowmotion;
|
||||||
|
@ -1988,7 +1987,6 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||||
font_driver_render_msg(vk, msg, NULL, NULL);
|
font_driver_render_msg(vk, msg, NULL, NULL);
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (widgets_inited)
|
|
||||||
gfx_widgets_frame(video_info);
|
gfx_widgets_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,20 @@
|
||||||
#include "../cheevos-new/badges.h"
|
#include "../cheevos-new/badges.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO: Fix context reset freezing everything in place (probably kills animations when it shouldn't anymore) */
|
static bool widgets_inited = false;
|
||||||
|
static bool widgets_active = false;
|
||||||
|
|
||||||
|
bool gfx_widgets_active(void)
|
||||||
|
{
|
||||||
|
return widgets_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool widgets_persisting = false;
|
||||||
|
|
||||||
|
void gfx_widgets_set_persistence(bool persist)
|
||||||
|
{
|
||||||
|
widgets_persisting = persist;
|
||||||
|
}
|
||||||
|
|
||||||
static float msg_queue_background[16] = COLOR_HEX_TO_FLOAT(0x3A3A3A, 1.0f);
|
static float msg_queue_background[16] = COLOR_HEX_TO_FLOAT(0x3A3A3A, 1.0f);
|
||||||
static float msg_queue_info[16] = COLOR_HEX_TO_FLOAT(0x12ACF8, 1.0f);
|
static float msg_queue_info[16] = COLOR_HEX_TO_FLOAT(0x12ACF8, 1.0f);
|
||||||
|
@ -228,7 +241,7 @@ static uintptr_t msg_queue_icon_outline = 0;
|
||||||
static uintptr_t msg_queue_icon_rect = 0;
|
static uintptr_t msg_queue_icon_rect = 0;
|
||||||
static bool msg_queue_has_icons = false;
|
static bool msg_queue_has_icons = false;
|
||||||
|
|
||||||
extern gfx_animation_ctx_tag gfx_widgets_generic_tag;
|
static gfx_animation_ctx_tag gfx_widgets_generic_tag = (uintptr_t)&widgets_active;
|
||||||
|
|
||||||
gfx_animation_ctx_tag gfx_widgets_get_generic_tag(void)
|
gfx_animation_ctx_tag gfx_widgets_get_generic_tag(void)
|
||||||
{
|
{
|
||||||
|
@ -410,6 +423,9 @@ void gfx_widgets_msg_queue_push(
|
||||||
{
|
{
|
||||||
menu_widget_msg_t* msg_widget = NULL;
|
menu_widget_msg_t* msg_widget = NULL;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fifo_write_avail(msg_queue) > 0)
|
if (fifo_write_avail(msg_queue) > 0)
|
||||||
{
|
{
|
||||||
/* Get current msg if it exists */
|
/* Get current msg if it exists */
|
||||||
|
@ -922,7 +938,12 @@ static void gfx_widgets_hourglass_tick(void *userdata)
|
||||||
gfx_animation_push(&entry);
|
gfx_animation_push(&entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Forward declaration */
|
/* Forward declarations */
|
||||||
|
static void gfx_widgets_context_reset(bool is_threaded,
|
||||||
|
unsigned width, unsigned height, bool fullscreen,
|
||||||
|
const char *dir_assets, char *font_path);
|
||||||
|
static void gfx_widgets_context_destroy(void);
|
||||||
|
static void gfx_widgets_free(void);
|
||||||
static void gfx_widgets_layout(
|
static void gfx_widgets_layout(
|
||||||
bool is_threaded, const char *dir_assets, char *font_path);
|
bool is_threaded, const char *dir_assets, char *font_path);
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
@ -936,10 +957,14 @@ void gfx_widgets_iterate(
|
||||||
bool is_threaded)
|
bool is_threaded)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
float scale_factor;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Check whether screen dimensions or menu scale
|
/* Check whether screen dimensions or menu scale
|
||||||
* factor have changed */
|
* factor have changed */
|
||||||
float scale_factor = (gfx_display_get_driver_id() == MENU_DRIVER_ID_XMB) ?
|
scale_factor = (gfx_display_get_driver_id() == MENU_DRIVER_ID_XMB) ?
|
||||||
gfx_display_get_widget_pixel_scale(width, height, fullscreen) :
|
gfx_display_get_widget_pixel_scale(width, height, fullscreen) :
|
||||||
gfx_display_get_widget_dpi_scale(width, height, fullscreen);
|
gfx_display_get_widget_dpi_scale(width, height, fullscreen);
|
||||||
|
|
||||||
|
@ -1473,20 +1498,42 @@ static void gfx_widgets_draw_load_content_animation(
|
||||||
|
|
||||||
void gfx_widgets_frame(void *data)
|
void gfx_widgets_frame(void *data)
|
||||||
{
|
{
|
||||||
|
/* (Pointless) optimisation: allocating these
|
||||||
|
* costs nothing, so do it *before* the
|
||||||
|
* 'widgets_active' check... */
|
||||||
size_t i;
|
size_t i;
|
||||||
video_frame_info_t *video_info = (video_frame_info_t*)data;
|
video_frame_info_t *video_info;
|
||||||
bool framecount_show = video_info->framecount_show;
|
bool framecount_show;
|
||||||
bool memory_show = video_info->memory_show;
|
bool memory_show;
|
||||||
void *userdata = video_info->userdata;
|
void *userdata;
|
||||||
unsigned video_width = video_info->width;
|
unsigned video_width;
|
||||||
unsigned video_height = video_info->height;
|
unsigned video_height;
|
||||||
bool widgets_is_paused = video_info->widgets_is_paused;
|
bool widgets_is_paused;
|
||||||
bool fps_show = video_info->fps_show;
|
bool fps_show;
|
||||||
bool widgets_is_fastforwarding = video_info->widgets_is_fast_forwarding;
|
bool widgets_is_fastforwarding;
|
||||||
bool widgets_is_rewinding = video_info->widgets_is_rewinding;
|
bool widgets_is_rewinding;
|
||||||
bool runloop_is_slowmotion = video_info->runloop_is_slowmotion;
|
bool runloop_is_slowmotion;
|
||||||
int top_right_x_advance = video_width;
|
int top_right_x_advance;
|
||||||
int scissor_me_timbers = 0;
|
int scissor_me_timbers;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* ...but assigning them costs a tiny amount,
|
||||||
|
* so do it *after* the 'widgets_active' check */
|
||||||
|
video_info = (video_frame_info_t*)data;
|
||||||
|
framecount_show = video_info->framecount_show;
|
||||||
|
memory_show = video_info->memory_show;
|
||||||
|
userdata = video_info->userdata;
|
||||||
|
video_width = video_info->width;
|
||||||
|
video_height = video_info->height;
|
||||||
|
widgets_is_paused = video_info->widgets_is_paused;
|
||||||
|
fps_show = video_info->fps_show;
|
||||||
|
widgets_is_fastforwarding = video_info->widgets_is_fast_forwarding;
|
||||||
|
widgets_is_rewinding = video_info->widgets_is_rewinding;
|
||||||
|
runloop_is_slowmotion = video_info->runloop_is_slowmotion;
|
||||||
|
top_right_x_advance = video_width;
|
||||||
|
scissor_me_timbers = 0;
|
||||||
|
|
||||||
gfx_widgets_frame_count++;
|
gfx_widgets_frame_count++;
|
||||||
|
|
||||||
|
@ -1974,13 +2021,18 @@ void gfx_widgets_frame(void *data)
|
||||||
gfx_display_unset_viewport(video_width, video_height);
|
gfx_display_unset_viewport(video_width, video_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gfx_widgets_init(bool video_is_threaded, bool fullscreen)
|
bool gfx_widgets_init(
|
||||||
|
bool video_is_threaded,
|
||||||
|
unsigned width, unsigned height, bool fullscreen,
|
||||||
|
const char *dir_assets, char *font_path)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
if (!gfx_display_init_first_driver(video_is_threaded))
|
if (!gfx_display_init_first_driver(video_is_threaded))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
if (!widgets_inited)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
gfx_widgets_frame_count = 0;
|
gfx_widgets_frame_count = 0;
|
||||||
|
|
||||||
for (i = 0; i < widgets_len; i++)
|
for (i = 0; i < widgets_len; i++)
|
||||||
|
@ -2004,22 +2056,34 @@ bool gfx_widgets_init(bool video_is_threaded, bool fullscreen)
|
||||||
if (!file_list_reserve(current_msgs, MSG_QUEUE_ONSCREEN_MAX))
|
if (!file_list_reserve(current_msgs, MSG_QUEUE_ONSCREEN_MAX))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Initialise scaling parameters
|
widgets_inited = true;
|
||||||
* NOTE - special cases:
|
}
|
||||||
* > Ozone has a capped scale factor
|
|
||||||
* > XMB uses pixel based scaling - all other drivers
|
gfx_widgets_context_reset(video_is_threaded,
|
||||||
* use DPI based scaling */
|
width, height, fullscreen,
|
||||||
video_driver_get_size(&last_video_width, &last_video_height);
|
dir_assets, font_path);
|
||||||
last_scale_factor = (gfx_display_get_driver_id() == MENU_DRIVER_ID_XMB) ?
|
|
||||||
gfx_display_get_widget_pixel_scale(last_video_width, last_video_height, fullscreen) :
|
widgets_active = true;
|
||||||
gfx_display_get_widget_dpi_scale(last_video_width, last_video_height, fullscreen);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
gfx_widgets_free();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gfx_widgets_deinit(void)
|
||||||
|
{
|
||||||
|
if (!widgets_inited)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gfx_widgets_context_destroy();
|
||||||
|
widgets_active = false;
|
||||||
|
|
||||||
|
if (!widgets_persisting)
|
||||||
|
gfx_widgets_free();
|
||||||
|
}
|
||||||
|
|
||||||
static void gfx_widgets_layout(
|
static void gfx_widgets_layout(
|
||||||
bool is_threaded, const char *dir_assets, char *font_path)
|
bool is_threaded, const char *dir_assets, char *font_path)
|
||||||
{
|
{
|
||||||
|
@ -2156,7 +2220,7 @@ static void gfx_widgets_layout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_widgets_context_reset(bool is_threaded,
|
static void gfx_widgets_context_reset(bool is_threaded,
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -2302,13 +2366,11 @@ static void gfx_widgets_achievement_next(void* userdata)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gfx_widgets_free(void)
|
static void gfx_widgets_free(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
gfx_animation_ctx_tag libretro_tag;
|
gfx_animation_ctx_tag libretro_tag;
|
||||||
|
|
||||||
gfx_widgets_context_destroy();
|
|
||||||
|
|
||||||
for (i = 0; i < widgets_len; i++)
|
for (i = 0; i < widgets_len; i++)
|
||||||
{
|
{
|
||||||
const gfx_widget_t* widget = widgets[i];
|
const gfx_widget_t* widget = widgets[i];
|
||||||
|
@ -2388,6 +2450,9 @@ void gfx_widgets_free(void)
|
||||||
|
|
||||||
/* Volume */
|
/* Volume */
|
||||||
volume_alpha = 0.0f;
|
volume_alpha = 0.0f;
|
||||||
|
|
||||||
|
widgets_inited = false;
|
||||||
|
widgets_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_widgets_volume_timer_end(void *userdata)
|
static void gfx_widgets_volume_timer_end(void *userdata)
|
||||||
|
@ -2413,6 +2478,9 @@ void gfx_widgets_volume_update_and_show(float new_volume, bool mute)
|
||||||
{
|
{
|
||||||
gfx_timer_ctx_entry_t entry;
|
gfx_timer_ctx_entry_t entry;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
gfx_animation_kill_by_tag(&volume_tag);
|
gfx_animation_kill_by_tag(&volume_tag);
|
||||||
|
|
||||||
volume_db = new_volume;
|
volume_db = new_volume;
|
||||||
|
@ -2430,6 +2498,9 @@ void gfx_widgets_volume_update_and_show(float new_volume, bool mute)
|
||||||
|
|
||||||
bool gfx_widgets_set_fps_text(const char *new_fps_text)
|
bool gfx_widgets_set_fps_text(const char *new_fps_text)
|
||||||
{
|
{
|
||||||
|
if (!widgets_active)
|
||||||
|
return false;
|
||||||
|
|
||||||
strlcpy(gfx_widgets_fps_text,
|
strlcpy(gfx_widgets_fps_text,
|
||||||
new_fps_text, sizeof(gfx_widgets_fps_text));
|
new_fps_text, sizeof(gfx_widgets_fps_text));
|
||||||
|
|
||||||
|
@ -2502,6 +2573,9 @@ void gfx_widgets_start_load_content_animation(const char *content_name, bool rem
|
||||||
float icon_color[16] = COLOR_HEX_TO_FLOAT(0x0473C9, 1.0f); /* TODO: random color */
|
float icon_color[16] = COLOR_HEX_TO_FLOAT(0x0473C9, 1.0f); /* TODO: random color */
|
||||||
unsigned timing = 0;
|
unsigned timing = 0;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Prepare data */
|
/* Prepare data */
|
||||||
load_content_animation_icon = 0;
|
load_content_animation_icon = 0;
|
||||||
|
|
||||||
|
@ -2680,6 +2754,9 @@ void gfx_widgets_push_achievement(const char *title, const char *badge)
|
||||||
{
|
{
|
||||||
int start_notification = 1;
|
int start_notification = 1;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
if (cheevo_popup_queue_read_index < 0)
|
if (cheevo_popup_queue_read_index < 0)
|
||||||
{
|
{
|
||||||
/* queue uninitialized */
|
/* queue uninitialized */
|
||||||
|
@ -2744,6 +2821,9 @@ void gfx_widgets_set_message(char *msg)
|
||||||
gfx_timer_ctx_entry_t timer;
|
gfx_timer_ctx_entry_t timer;
|
||||||
gfx_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
|
gfx_animation_ctx_tag tag = (uintptr_t) &generic_message_timer;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
strlcpy(generic_message, msg, sizeof(generic_message));
|
strlcpy(generic_message, msg, sizeof(generic_message));
|
||||||
|
|
||||||
generic_message_alpha = DEFAULT_BACKDROP;
|
generic_message_alpha = DEFAULT_BACKDROP;
|
||||||
|
@ -2781,6 +2861,9 @@ void gfx_widgets_set_libretro_message(const char *msg, unsigned duration)
|
||||||
gfx_timer_ctx_entry_t timer;
|
gfx_timer_ctx_entry_t timer;
|
||||||
gfx_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
|
gfx_animation_ctx_tag tag = (uintptr_t) &libretro_message_timer;
|
||||||
|
|
||||||
|
if (!widgets_active)
|
||||||
|
return;
|
||||||
|
|
||||||
strlcpy(libretro_message, msg, sizeof(libretro_message));
|
strlcpy(libretro_message, msg, sizeof(libretro_message));
|
||||||
|
|
||||||
libretro_message_alpha = DEFAULT_BACKDROP;
|
libretro_message_alpha = DEFAULT_BACKDROP;
|
||||||
|
|
|
@ -115,9 +115,14 @@ typedef struct gfx_widget gfx_widget_t;
|
||||||
|
|
||||||
extern const gfx_widget_t gfx_widget_screenshot;
|
extern const gfx_widget_t gfx_widget_screenshot;
|
||||||
|
|
||||||
bool gfx_widgets_init(bool video_is_threaded, bool fullscreen);
|
bool gfx_widgets_active(void);
|
||||||
|
void gfx_widgets_set_persistence(bool persist);
|
||||||
|
|
||||||
void gfx_widgets_free(void);
|
bool gfx_widgets_init(
|
||||||
|
bool video_is_threaded,
|
||||||
|
unsigned width, unsigned height, bool fullscreen,
|
||||||
|
const char *dir_assets, char *font_path);
|
||||||
|
void gfx_widgets_deinit(void);
|
||||||
|
|
||||||
void gfx_widgets_msg_queue_push(
|
void gfx_widgets_msg_queue_push(
|
||||||
retro_task_t *task, const char *msg,
|
retro_task_t *task, const char *msg,
|
||||||
|
@ -155,10 +160,6 @@ void gfx_widgets_start_load_content_animation(
|
||||||
|
|
||||||
void gfx_widgets_cleanup_load_content_animation(void);
|
void gfx_widgets_cleanup_load_content_animation(void);
|
||||||
|
|
||||||
void gfx_widgets_context_reset(bool is_threaded,
|
|
||||||
unsigned width, unsigned height, bool fullscreen,
|
|
||||||
const char *dir_assets, char *font_path);
|
|
||||||
|
|
||||||
void gfx_widgets_push_achievement(const char *title, const char *badge);
|
void gfx_widgets_push_achievement(const char *title, const char *badge);
|
||||||
|
|
||||||
/* Warning: not thread safe! */
|
/* Warning: not thread safe! */
|
||||||
|
|
|
@ -1216,7 +1216,7 @@ static void thread_apply_state_changes(void *data)
|
||||||
static struct video_shader *thread_get_current_shader(void *data)
|
static struct video_shader *thread_get_current_shader(void *data)
|
||||||
{
|
{
|
||||||
thread_video_t *thr = (thread_video_t*)data;
|
thread_video_t *thr = (thread_video_t*)data;
|
||||||
if (!thr || !thr->poke)
|
if (!thr || !thr->poke || !thr->poke->get_current_shader)
|
||||||
return NULL;
|
return NULL;
|
||||||
return thr->poke->get_current_shader(thr->driver_data);
|
return thr->poke->get_current_shader(thr->driver_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,12 @@ static void gfx_widgets_play_screenshot_flash(void)
|
||||||
|
|
||||||
void gfx_widgets_screenshot_taken(const char *shotname, const char *filename)
|
void gfx_widgets_screenshot_taken(const char *shotname, const char *filename)
|
||||||
{
|
{
|
||||||
gfx_widget_screenshot_state_t* state = gfx_widget_screenshot_get_ptr();
|
gfx_widget_screenshot_state_t* state = NULL;
|
||||||
|
|
||||||
|
if (!gfx_widgets_active())
|
||||||
|
return;
|
||||||
|
|
||||||
|
state = gfx_widget_screenshot_get_ptr();
|
||||||
gfx_widgets_play_screenshot_flash();
|
gfx_widgets_play_screenshot_flash();
|
||||||
strlcpy(state->filename, filename, sizeof(state->filename));
|
strlcpy(state->filename, filename, sizeof(state->filename));
|
||||||
strlcpy(state->shotname, shotname, sizeof(state->shotname));
|
strlcpy(state->shotname, shotname, sizeof(state->shotname));
|
||||||
|
|
83
retroarch.c
83
retroarch.c
|
@ -2636,9 +2636,6 @@ bool is_accessibility_enabled(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
static bool gfx_widgets_inited = false;
|
|
||||||
gfx_animation_ctx_tag gfx_widgets_generic_tag = (uintptr_t) &gfx_widgets_inited;
|
|
||||||
|
|
||||||
/* Status icons */
|
/* Status icons */
|
||||||
static bool gfx_widgets_paused = false;
|
static bool gfx_widgets_paused = false;
|
||||||
static bool gfx_widgets_fast_forward = false;
|
static bool gfx_widgets_fast_forward = false;
|
||||||
|
@ -2648,7 +2645,7 @@ static bool gfx_widgets_rewinding = false;
|
||||||
bool gfx_widgets_ready(void)
|
bool gfx_widgets_ready(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
return gfx_widgets_inited;
|
return gfx_widgets_active();
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -5557,7 +5554,7 @@ bool retroarch_apply_shader(enum rarch_shader_type type, const char *preset_path
|
||||||
preset_file ? "Shader: \"%s\"" : "Shader: %s",
|
preset_file ? "Shader: \"%s\"" : "Shader: %s",
|
||||||
preset_file ? preset_file : "None");
|
preset_file ? preset_file : "None");
|
||||||
#ifdef HAVE_GFX_WIDGETS
|
#ifdef HAVE_GFX_WIDGETS
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_set_message(msg);
|
gfx_widgets_set_message(msg);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -6996,7 +6993,7 @@ static void command_event_set_volume(float gain)
|
||||||
new_volume);
|
new_volume);
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_volume_update_and_show(new_volume, audio_driver_mute_enable);
|
gfx_widgets_volume_update_and_show(new_volume, audio_driver_mute_enable);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -7992,7 +7989,7 @@ static void retroarch_pause_checks(void)
|
||||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
|
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_paused = is_paused;
|
gfx_widgets_paused = is_paused;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -8012,7 +8009,7 @@ static void retroarch_pause_checks(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_paused = is_paused;
|
gfx_widgets_paused = is_paused;
|
||||||
#endif
|
#endif
|
||||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
|
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
|
||||||
|
@ -8529,7 +8526,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
audio_driver_mute_enable = !audio_driver_mute_enable;
|
audio_driver_mute_enable = !audio_driver_mute_enable;
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_volume_update_and_show(
|
gfx_widgets_volume_update_and_show(
|
||||||
configuration_settings->floats.audio_volume,
|
configuration_settings->floats.audio_volume,
|
||||||
audio_driver_mute_enable);
|
audio_driver_mute_enable);
|
||||||
|
@ -9713,6 +9710,10 @@ void main_exit(void *args)
|
||||||
if (config_save_on_exit)
|
if (config_save_on_exit)
|
||||||
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
||||||
|
|
||||||
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
|
/* Do not want menu widgets to live any more. */
|
||||||
|
gfx_widgets_set_persistence(false);
|
||||||
|
#endif
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
/* Do not want menu context to live any more. */
|
/* Do not want menu context to live any more. */
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_OWN_DRIVER, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_UNSET_OWN_DRIVER, NULL);
|
||||||
|
@ -11200,7 +11201,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
|
||||||
const struct retro_message *msg = (const struct retro_message*)data;
|
const struct retro_message *msg = (const struct retro_message*)data;
|
||||||
RARCH_LOG("[Environ]: SET_MESSAGE: %s\n", msg->msg);
|
RARCH_LOG("[Environ]: SET_MESSAGE: %s\n", msg->msg);
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_set_libretro_message(msg->msg,
|
gfx_widgets_set_libretro_message(msg->msg,
|
||||||
roundf((float)msg->frames / 60.0f * 1000.0f));
|
roundf((float)msg->frames / 60.0f * 1000.0f));
|
||||||
else
|
else
|
||||||
|
@ -23615,8 +23616,10 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||||
static retro_time_t curr_time;
|
static retro_time_t curr_time;
|
||||||
static retro_time_t fps_time;
|
static retro_time_t fps_time;
|
||||||
static float last_fps, frame_time;
|
static float last_fps, frame_time;
|
||||||
retro_time_t new_time =
|
retro_time_t new_time = cpu_features_get_time_usec();
|
||||||
cpu_features_get_time_usec();
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
|
bool widgets_active = gfx_widgets_active();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!video_driver_active)
|
if (!video_driver_active)
|
||||||
return;
|
return;
|
||||||
|
@ -23780,7 +23783,7 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||||
* extracted and pushed to the widget message
|
* extracted and pushed to the widget message
|
||||||
* queue instead */
|
* queue instead */
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (widgets_active)
|
||||||
{
|
{
|
||||||
bool msg_found = false;
|
bool msg_found = false;
|
||||||
msg_queue_entry_t msg_entry;
|
msg_queue_entry_t msg_entry;
|
||||||
|
@ -23897,7 +23900,7 @@ static void video_driver_frame(const void *data, unsigned width,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (widgets_active)
|
||||||
gfx_widgets_set_fps_text(video_info.fps_text);
|
gfx_widgets_set_fps_text(video_info.fps_text);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -24073,12 +24076,10 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||||
video_info->fps_text[0] = '\0';
|
video_info->fps_text[0] = '\0';
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
video_info->widgets_inited = gfx_widgets_inited;
|
|
||||||
video_info->widgets_is_paused = gfx_widgets_paused;
|
video_info->widgets_is_paused = gfx_widgets_paused;
|
||||||
video_info->widgets_is_fast_forwarding = gfx_widgets_fast_forward;
|
video_info->widgets_is_fast_forwarding = gfx_widgets_fast_forward;
|
||||||
video_info->widgets_is_rewinding = gfx_widgets_rewinding;
|
video_info->widgets_is_rewinding = gfx_widgets_rewinding;
|
||||||
#else
|
#else
|
||||||
video_info->widgets_inited = false;
|
|
||||||
video_info->widgets_is_paused = false;
|
video_info->widgets_is_paused = false;
|
||||||
video_info->widgets_is_fast_forwarding = false;
|
video_info->widgets_is_fast_forwarding = false;
|
||||||
video_info->widgets_is_rewinding = false;
|
video_info->widgets_is_rewinding = false;
|
||||||
|
@ -24175,7 +24176,10 @@ bool video_driver_translate_coord_viewport(
|
||||||
int norm_full_vp_width = (int)vp->full_width;
|
int norm_full_vp_width = (int)vp->full_width;
|
||||||
int norm_full_vp_height = (int)vp->full_height;
|
int norm_full_vp_height = (int)vp->full_height;
|
||||||
|
|
||||||
if (norm_full_vp_width <= 0 || norm_full_vp_height <= 0)
|
if (norm_vp_width <= 0 ||
|
||||||
|
norm_vp_height <= 0 ||
|
||||||
|
norm_full_vp_width <= 0 ||
|
||||||
|
norm_full_vp_height <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mouse_x >= 0 && mouse_x <= norm_full_vp_width)
|
if (mouse_x >= 0 && mouse_x <= norm_full_vp_width)
|
||||||
|
@ -25292,6 +25296,11 @@ static void drivers_init(int flags)
|
||||||
settings_t *settings = configuration_settings;
|
settings_t *settings = configuration_settings;
|
||||||
bool menu_enable_widgets = settings->bools.menu_enable_widgets;
|
bool menu_enable_widgets = settings->bools.menu_enable_widgets;
|
||||||
|
|
||||||
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
|
/* By default, we want menu widgets to persist through driver reinits. */
|
||||||
|
gfx_widgets_set_persistence(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
/* By default, we want the menu to persist through driver reinits. */
|
/* By default, we want the menu to persist through driver reinits. */
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL);
|
||||||
|
@ -25379,17 +25388,10 @@ static void drivers_init(int flags)
|
||||||
bool video_is_fullscreen = settings->bools.video_fullscreen ||
|
bool video_is_fullscreen = settings->bools.video_fullscreen ||
|
||||||
rarch_force_fullscreen;
|
rarch_force_fullscreen;
|
||||||
|
|
||||||
if (!gfx_widgets_inited)
|
gfx_widgets_init(video_is_threaded,
|
||||||
gfx_widgets_inited = gfx_widgets_init(
|
|
||||||
video_is_threaded, video_is_fullscreen);
|
|
||||||
|
|
||||||
if (gfx_widgets_inited)
|
|
||||||
gfx_widgets_context_reset(video_is_threaded,
|
|
||||||
video_driver_width, video_driver_height, video_is_fullscreen,
|
video_driver_width, video_driver_height, video_is_fullscreen,
|
||||||
settings->paths.directory_assets,
|
settings->paths.directory_assets,
|
||||||
settings->paths.path_font);
|
settings->paths.path_font);
|
||||||
else
|
|
||||||
gfx_widgets_free();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -25461,11 +25463,7 @@ static void driver_uninit(int flags)
|
||||||
/* This absolutely has to be done before video_driver_free_internal()
|
/* This absolutely has to be done before video_driver_free_internal()
|
||||||
* is called/completes, otherwise certain menu drivers
|
* is called/completes, otherwise certain menu drivers
|
||||||
* (e.g. Vulkan) will segfault */
|
* (e.g. Vulkan) will segfault */
|
||||||
{
|
gfx_widgets_deinit();
|
||||||
if (gfx_widgets_inited)
|
|
||||||
gfx_widgets_free();
|
|
||||||
gfx_widgets_inited = false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
@ -25533,11 +25531,7 @@ static void retroarch_deinit_drivers(void)
|
||||||
* in case the handle is lost in the threaded
|
* in case the handle is lost in the threaded
|
||||||
* video driver in the meantime
|
* video driver in the meantime
|
||||||
* (breaking video_driver_has_widgets) */
|
* (breaking video_driver_has_widgets) */
|
||||||
if (gfx_widgets_inited)
|
gfx_widgets_deinit();
|
||||||
{
|
|
||||||
gfx_widgets_free();
|
|
||||||
gfx_widgets_inited = false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Video */
|
/* Video */
|
||||||
|
@ -27870,7 +27864,7 @@ static void runloop_task_msg_queue_push(
|
||||||
bool flush)
|
bool flush)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited && task->title && !task->mute)
|
if (gfx_widgets_active() && task->title && !task->mute)
|
||||||
{
|
{
|
||||||
runloop_msg_queue_lock();
|
runloop_msg_queue_lock();
|
||||||
ui_companion_driver_msg_queue_push(msg,
|
ui_companion_driver_msg_queue_push(msg,
|
||||||
|
@ -28756,7 +28750,7 @@ void runloop_msg_queue_push(const char *msg,
|
||||||
accessibility_speak_priority((char*) msg, 0);
|
accessibility_speak_priority((char*) msg, 0);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
{
|
{
|
||||||
gfx_widgets_msg_queue_push(NULL, msg,
|
gfx_widgets_msg_queue_push(NULL, msg,
|
||||||
roundf((float)duration / 60.0f * 1000.0f),
|
roundf((float)duration / 60.0f * 1000.0f),
|
||||||
|
@ -29002,14 +28996,14 @@ static void update_fastforwarding_state(void)
|
||||||
if (runloop_fastmotion)
|
if (runloop_fastmotion)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
gfx_widgets_fast_forward = true;
|
gfx_widgets_fast_forward = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gfx_widgets_inited)
|
if (gfx_widgets_active())
|
||||||
{
|
{
|
||||||
gfx_widgets_fast_forward = false;
|
gfx_widgets_fast_forward = false;
|
||||||
{
|
{
|
||||||
|
@ -29044,6 +29038,9 @@ static enum runloop_state runloop_check_state(retro_time_t current_time)
|
||||||
bool menu_is_alive = menu_driver_alive;
|
bool menu_is_alive = menu_driver_alive;
|
||||||
bool display_kb = menu_input_dialog_get_display_kb();
|
bool display_kb = menu_input_dialog_get_display_kb();
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
|
bool widgets_active = gfx_widgets_active();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_TRANSLATE) && defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_TRANSLATE) && defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_ai_service_overlay_get_state() == 3)
|
if (gfx_widgets_ai_service_overlay_get_state() == 3)
|
||||||
|
@ -29330,7 +29327,7 @@ static enum runloop_state runloop_check_state(retro_time_t current_time)
|
||||||
video_driver_width, video_driver_height);
|
video_driver_width, video_driver_height);
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (widgets_active)
|
||||||
{
|
{
|
||||||
bool video_is_fullscreen = settings->bools.video_fullscreen ||
|
bool video_is_fullscreen = settings->bools.video_fullscreen ||
|
||||||
rarch_force_fullscreen;
|
rarch_force_fullscreen;
|
||||||
|
@ -29662,7 +29659,7 @@ static enum runloop_state runloop_check_state(retro_time_t current_time)
|
||||||
|
|
||||||
/* Show the fast-forward OSD for 1 frame every frame if menu widgets are disabled */
|
/* Show the fast-forward OSD for 1 frame every frame if menu widgets are disabled */
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (!gfx_widgets_inited && runloop_fastmotion)
|
if (!widgets_active && runloop_fastmotion)
|
||||||
#else
|
#else
|
||||||
if (runloop_fastmotion)
|
if (runloop_fastmotion)
|
||||||
#endif
|
#endif
|
||||||
|
@ -29737,7 +29734,7 @@ static enum runloop_state runloop_check_state(retro_time_t current_time)
|
||||||
runloop_paused, s, sizeof(s), &t);
|
runloop_paused, s, sizeof(s), &t);
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (gfx_widgets_inited)
|
if (widgets_active)
|
||||||
gfx_widgets_rewinding = rewinding;
|
gfx_widgets_rewinding = rewinding;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -29772,7 +29769,7 @@ static enum runloop_state runloop_check_state(retro_time_t current_time)
|
||||||
video_driver_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
#if defined(HAVE_GFX_WIDGETS)
|
#if defined(HAVE_GFX_WIDGETS)
|
||||||
if (!gfx_widgets_inited)
|
if (!widgets_active)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (state_manager_frame_is_reversed())
|
if (state_manager_frame_is_reversed())
|
||||||
|
|
|
@ -1096,7 +1096,6 @@ typedef struct video_info
|
||||||
typedef struct video_frame_info
|
typedef struct video_frame_info
|
||||||
{
|
{
|
||||||
bool menu_mouse_enable;
|
bool menu_mouse_enable;
|
||||||
bool widgets_inited;
|
|
||||||
bool widgets_is_paused;
|
bool widgets_is_paused;
|
||||||
bool widgets_is_fast_forwarding;
|
bool widgets_is_fast_forwarding;
|
||||||
bool widgets_is_rewinding;
|
bool widgets_is_rewinding;
|
||||||
|
|
Loading…
Reference in New Issue