mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
menu_widgets: implement the user setting
This commit is contained in:
parent
1d1cc87c4f
commit
636f2ddb28
@ -505,7 +505,7 @@ static void rcheevos_award(rcheevos_cheevo_t* cheevo, int mode)
|
|||||||
|
|
||||||
/* Show the OSD message. */
|
/* Show the OSD message. */
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_push_achievement(cheevo->info->title, cheevo->info->badge))
|
if (!menu_widgets_push_achievement(cheevo->info->title, cheevo->info->badge))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
snprintf(buffer, sizeof(buffer), "Achievement Unlocked: %s", cheevo->info->title);
|
snprintf(buffer, sizeof(buffer), "Achievement Unlocked: %s", cheevo->info->title);
|
||||||
|
@ -1658,7 +1658,7 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set)
|
|||||||
cheevo->id, cheevo->title, cheevo->description);
|
cheevo->id, cheevo->title, cheevo->description);
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_push_achievement(cheevo->title, cheevo->badge))
|
if (!menu_widgets_push_achievement(cheevo->title, cheevo->badge))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
char msg[256];
|
char msg[256];
|
||||||
|
15
command.c
15
command.c
@ -988,7 +988,7 @@ static void command_event_set_volume(float gain)
|
|||||||
new_volume);
|
new_volume);
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
if (!menu_widgets_volume_update_and_show())
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
|
||||||
@ -2141,7 +2141,7 @@ TODO: Add a setting for these tweaks */
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
if (!menu_widgets_volume_update_and_show())
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
|
||||||
@ -2531,11 +2531,11 @@ TODO: Add a setting for these tweaks */
|
|||||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_set_paused(is_paused))
|
if (!menu_widgets_set_paused(is_paused))
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
|
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
|
||||||
1, true,
|
1, true,
|
||||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
|
||||||
if (!is_idle)
|
if (!is_idle)
|
||||||
video_driver_cached_frame();
|
video_driver_cached_frame();
|
||||||
@ -2548,8 +2548,7 @@ TODO: Add a setting for these tweaks */
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (video_driver_has_widgets())
|
menu_widgets_set_paused(is_paused);
|
||||||
menu_widgets_set_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));
|
||||||
command_event(CMD_EVENT_AUDIO_START, NULL);
|
command_event(CMD_EVENT_AUDIO_START, NULL);
|
||||||
|
@ -2497,10 +2497,12 @@ void video_driver_frame(const void *data, unsigned width,
|
|||||||
|
|
||||||
/* Display the FPS, with a higher priority. */
|
/* Display the FPS, with a higher priority. */
|
||||||
if (video_info.fps_show || video_info.framecount_show)
|
if (video_info.fps_show || video_info.framecount_show)
|
||||||
|
{
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_set_fps_text(video_info.fps_text))
|
if (!menu_widgets_set_fps_text(video_info.fps_text))
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(video_info.fps_text, 2, 1, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(video_info.fps_text, 2, 1, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
/* trigger set resolution*/
|
/* trigger set resolution*/
|
||||||
if (video_info.crt_switch_resolution)
|
if (video_info.crt_switch_resolution)
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_MENU_WIDGETS)
|
||||||
|
#include "../widgets/menu_widgets.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../playlist.h"
|
#include "../../playlist.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
|
|
||||||
@ -3866,7 +3870,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
|
|||||||
* but for extra safety we will only permit menu widget
|
* but for extra safety we will only permit menu widget
|
||||||
* additions when the current gfx driver reports that it
|
* additions when the current gfx driver reports that it
|
||||||
* has widget support */
|
* has widget support */
|
||||||
rgui->widgets_supported = video_driver_has_widgets();
|
rgui->widgets_supported = menu_widgets_ready();
|
||||||
|
|
||||||
if (rgui->widgets_supported)
|
if (rgui->widgets_supported)
|
||||||
{
|
{
|
||||||
|
@ -1730,6 +1730,9 @@ void menu_widgets_context_reset(bool is_threaded)
|
|||||||
|
|
||||||
unsigned video_info_width;
|
unsigned video_info_width;
|
||||||
|
|
||||||
|
if (!menu_widgets_inited)
|
||||||
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&video_info_width, NULL);
|
video_driver_get_size(&video_info_width, NULL);
|
||||||
|
|
||||||
/* Textures paths */
|
/* Textures paths */
|
||||||
|
15
retroarch.c
15
retroarch.c
@ -584,6 +584,7 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info
|
|||||||
void drivers_init(int flags)
|
void drivers_init(int flags)
|
||||||
{
|
{
|
||||||
bool video_is_threaded = false;
|
bool video_is_threaded = false;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
#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. */
|
||||||
@ -635,7 +636,8 @@ void drivers_init(int flags)
|
|||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
#ifdef HAVE_MENU_WIDGETS
|
#ifdef HAVE_MENU_WIDGETS
|
||||||
if (video_driver_has_widgets())
|
if (settings->bools.menu_enable_widgets
|
||||||
|
&& video_driver_has_widgets())
|
||||||
{
|
{
|
||||||
menu_widgets_init(video_is_threaded);
|
menu_widgets_init(video_is_threaded);
|
||||||
menu_widgets_context_reset(video_is_threaded);
|
menu_widgets_context_reset(video_is_threaded);
|
||||||
@ -3154,7 +3156,7 @@ void runloop_task_msg_queue_push(retro_task_t *task, const char *msg,
|
|||||||
bool flush)
|
bool flush)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_task_msg_queue_push(task, msg, prio, duration, flush))
|
if (!menu_widgets_task_msg_queue_push(task, msg, prio, duration, flush))
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
}
|
}
|
||||||
@ -3171,9 +3173,10 @@ void runloop_msg_queue_push(const char *msg,
|
|||||||
|
|
||||||
rarch_environment_cb(RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE, &target_hz);
|
rarch_environment_cb(RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE, &target_hz);
|
||||||
|
|
||||||
if (video_driver_has_widgets() && menu_widgets_msg_queue_push(msg,
|
if (menu_widgets_msg_queue_push(msg,
|
||||||
duration / target_hz * 1000, title, icon, category, prio, flush))
|
duration / target_hz * 1000, title, icon, category, prio, flush))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
@ -4057,7 +4060,7 @@ static enum runloop_state runloop_check_state(
|
|||||||
if (runloop_fastmotion)
|
if (runloop_fastmotion)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets() || !menu_widgets_set_fast_forward(true))
|
if (!menu_widgets_set_fast_forward(true))
|
||||||
#endif
|
#endif
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
@ -4159,7 +4162,7 @@ static enum runloop_state runloop_check_state(
|
|||||||
settings->uints.rewind_granularity, runloop_paused, s, sizeof(s), &t);
|
settings->uints.rewind_granularity, runloop_paused, s, sizeof(s), &t);
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets())
|
if (!menu_widgets_ready())
|
||||||
#endif
|
#endif
|
||||||
if (rewinding)
|
if (rewinding)
|
||||||
runloop_msg_queue_push(s, 0, t, true, NULL,
|
runloop_msg_queue_push(s, 0, t, true, NULL,
|
||||||
@ -4205,7 +4208,7 @@ static enum runloop_state runloop_check_state(
|
|||||||
video_driver_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (!video_driver_has_widgets())
|
if (!menu_widgets_ready())
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
if (state_manager_frame_is_reversed())
|
if (state_manager_frame_is_reversed())
|
||||||
|
@ -157,7 +157,7 @@ static void task_screenshot_handler(retro_task_t *task)
|
|||||||
/* If menu widgets are enabled, state is freed
|
/* If menu widgets are enabled, state is freed
|
||||||
in the callback after the notification
|
in the callback after the notification
|
||||||
is displayed */
|
is displayed */
|
||||||
if (!video_driver_has_widgets())
|
if (!menu_widgets_ready())
|
||||||
#endif
|
#endif
|
||||||
free(state);
|
free(state);
|
||||||
return;
|
return;
|
||||||
@ -202,7 +202,7 @@ static void task_screenshot_callback(retro_task_t *task,
|
|||||||
{
|
{
|
||||||
screenshot_task_state_t *state = (screenshot_task_state_t*)task->state;
|
screenshot_task_state_t *state = (screenshot_task_state_t*)task->state;
|
||||||
|
|
||||||
if (!video_driver_has_widgets())
|
if (!menu_widgets_ready())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (state && !state->silence)
|
if (state && !state->silence)
|
||||||
@ -320,7 +320,7 @@ static bool screenshot_dump(
|
|||||||
if (use_thread)
|
if (use_thread)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||||
if (video_driver_has_widgets())
|
if (menu_widgets_ready())
|
||||||
task_free_title(task);
|
task_free_title(task);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user