mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #8199 from natinusala/menu-widgets
First version of menu widgets (gl only)
This commit is contained in:
commit
49f7f457cd
18
.vscode/settings.json
vendored
18
.vscode/settings.json
vendored
@ -40,9 +40,23 @@
|
||||
"ozone_theme.h": "c",
|
||||
"ozone_texture.h": "c",
|
||||
"string_list.h": "c",
|
||||
"core_info.h": "c"
|
||||
"core_info.h": "c",
|
||||
"thread": "c",
|
||||
"xlocale": "c"
|
||||
"xlocale": "c",
|
||||
"menu_widgets.h": "c",
|
||||
"message_queue.h": "c",
|
||||
"task_queue.h": "c",
|
||||
"fifo_queue.h": "c",
|
||||
"file_list.h": "c",
|
||||
"strl.h": "c",
|
||||
"configuration.h": "c",
|
||||
"ozone_display.h": "c",
|
||||
"verbosity.h": "c",
|
||||
"retroarch.h": "c",
|
||||
"menu_animation.h": "c",
|
||||
"audio_driver.h": "c",
|
||||
"netplay.h": "c",
|
||||
"scaler.h": "c"
|
||||
},
|
||||
"C_Cpp.dimInactiveRegions": false,
|
||||
}
|
@ -699,6 +699,10 @@ ifeq ($(HAVE_MENU), 1)
|
||||
DEFINES += -DHAVE_MENU
|
||||
HAVE_MENU_COMMON = 1
|
||||
|
||||
ifeq ($(HAVE_MENU_WIDGETS), 1)
|
||||
DEFINES += -DHAVE_MENU_WIDGETS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RGUI), 1)
|
||||
OBJ += menu/drivers/rgui.o
|
||||
DEFINES += -DHAVE_RGUI
|
||||
@ -782,6 +786,10 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
ifeq ($(HAVE_MENU_COMMON),1)
|
||||
OBJ += menu/drivers_display/menu_display_null.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MENU_WIDGETS), 1)
|
||||
OBJ += menu/widgets/menu_widgets.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
|
@ -1406,7 +1406,7 @@ static void audio_driver_mixer_play_stream_internal(unsigned i, unsigned type)
|
||||
audio_mixer_streams[i].state = (enum audio_mixer_state)type;
|
||||
}
|
||||
|
||||
static void audio_driver_load_menu_bgm_callback(void *task_data, void *user_data, const char *error)
|
||||
static void audio_driver_load_menu_bgm_callback(retro_task_t *task, void *task_data, void *user_data, const char *error)
|
||||
{
|
||||
bool contentless = false;
|
||||
bool is_inited = false;
|
||||
|
@ -206,7 +206,8 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
|
||||
return camera_driver->start(camera_data);
|
||||
|
||||
runloop_msg_queue_push(
|
||||
"Camera is explicitly disabled.\n", 1, 180, false);
|
||||
"Camera is explicitly disabled.\n", 1, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
case RARCH_CAMERA_CTL_SET_CB:
|
||||
|
@ -34,7 +34,7 @@ void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_display_reset_textures_list(badge_file, fullpath,
|
||||
&badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||
&badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -493,8 +493,8 @@ static void cheevos_award(cheevos_cheevo_t* cheevo, int mode)
|
||||
|
||||
/* Show the OSD message. */
|
||||
snprintf(buffer, sizeof(buffer), "Achievement Unlocked: %s", cheevo->info->title);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(cheevo->info->description, 0, 3 * 60, false);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->info->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
/* Start the award task. */
|
||||
if ((mode & CHEEVOS_ACTIVE_HARDCORE) != 0)
|
||||
@ -633,7 +633,7 @@ static void cheevos_lboard_submit(cheevos_lboard_t* lboard)
|
||||
if (lboard->last_value == 0)
|
||||
{
|
||||
CHEEVOS_ERR(CHEEVOS_TAG "Leaderboard %s tried to submit 0\n", lboard->info->title);
|
||||
runloop_msg_queue_push("Leaderboard attempt cancelled!", 0, 2 * 60, false);
|
||||
runloop_msg_queue_push("Leaderboard attempt cancelled!", 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@ static void cheevos_lboard_submit(cheevos_lboard_t* lboard)
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "Submitted %s for %s",
|
||||
value, lboard->info->title);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
/* Start the submit task. */
|
||||
cheevos_lboard_submit_task(NULL, lboard, "no error, first try");
|
||||
@ -689,8 +689,8 @@ static void cheevos_test_leaderboards(void)
|
||||
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"Leaderboard Active: %s", lboard->info->title);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(lboard->info->description, 0, 3 * 60, false);
|
||||
runloop_msg_queue_push(buffer, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(lboard->info->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -958,7 +958,7 @@ bool cheevos_toggle_hardcore_mode(void)
|
||||
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
|
||||
|
||||
CHEEVOS_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1328,7 +1328,7 @@ found:
|
||||
|
||||
if (!coro->json)
|
||||
{
|
||||
runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false);
|
||||
runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
CHEEVOS_ERR(CHEEVOS_TAG "error loading achievements\n");
|
||||
CORO_STOP();
|
||||
}
|
||||
@ -1393,7 +1393,7 @@ found:
|
||||
"You have %d of %d achievements unlocked.",
|
||||
number_of_unlocked, cheevos_locals.patchdata.core_count);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 6 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 6 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
CORO_GOSUB(GET_BADGES);
|
||||
@ -1792,7 +1792,7 @@ found:
|
||||
|
||||
if (!coro->json)
|
||||
{
|
||||
runloop_msg_queue_push("RetroAchievements: Error contacting server.", 0, 5 * 60, false);
|
||||
runloop_msg_queue_push("RetroAchievements: Error contacting server.", 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
CHEEVOS_ERR(CHEEVOS_TAG "error getting user token\n");
|
||||
|
||||
CORO_STOP();
|
||||
@ -1806,7 +1806,7 @@ found:
|
||||
snprintf(msg, sizeof(msg),
|
||||
"RetroAchievements: %s",
|
||||
tok);
|
||||
runloop_msg_queue_push(msg, 0, 5 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
*coro->settings->arrays.cheevos_token = 0;
|
||||
|
||||
CHEEVOS_FREE(coro->json);
|
||||
@ -1822,7 +1822,7 @@ found:
|
||||
"RetroAchievements: Logged in as \"%s\".",
|
||||
coro->settings->arrays.cheevos_username);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
strlcpy(cheevos_locals.token, tok,
|
||||
@ -2047,7 +2047,7 @@ bool cheevos_load(const void *data)
|
||||
if (!coro)
|
||||
return false;
|
||||
|
||||
task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
task = task_init();
|
||||
|
||||
if (!task)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_display_reset_textures_list(badge_file, fullpath,
|
||||
&badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||
&badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <retro_math.h>
|
||||
#include <net/net_http.h>
|
||||
#include <libretro.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
@ -1589,7 +1590,7 @@ static void cheevos_make_unlock_url(const cheevo_t *cheevo,
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cheevos_unlocked(void *task_data, void *user_data,
|
||||
static void cheevos_unlocked(retro_task_t *task, void *task_data, void *user_data,
|
||||
const char *error)
|
||||
{
|
||||
cheevo_t *cheevo = (cheevo_t *)user_data;
|
||||
@ -1657,8 +1658,8 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set)
|
||||
snprintf(msg, sizeof(msg), "Achievement Unlocked: %s",
|
||||
cheevo->title);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(cheevo->description, 0, 3 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(cheevo->description, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
cheevos_make_unlock_url(cheevo, url, sizeof(url));
|
||||
task_push_http_transfer(url, true, NULL,
|
||||
@ -1818,7 +1819,7 @@ static void cheevos_make_lboard_url(const cheevos_leaderboard_t *lboard,
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cheevos_lboard_submit(void *task_data, void *user_data,
|
||||
static void cheevos_lboard_submit(retro_task_t *task, void *task_data, void *user_data,
|
||||
const char *error)
|
||||
{
|
||||
cheevos_leaderboard_t *lboard = (cheevos_leaderboard_t *)user_data;
|
||||
@ -1866,7 +1867,8 @@ static void cheevos_test_leaderboards(void)
|
||||
CHEEVOS_LOG("[CHEEVOS]: error: lboard %s tried to submit 0\n",
|
||||
lboard->title);
|
||||
runloop_msg_queue_push("Leaderboard attempt cancelled!",
|
||||
0, 2 * 60, false);
|
||||
0, 2 * 60, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1884,7 +1886,7 @@ static void cheevos_test_leaderboards(void)
|
||||
snprintf(msg, sizeof(msg), "Submitted %s for %s",
|
||||
formatted_value, lboard->title);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1893,7 +1895,8 @@ static void cheevos_test_leaderboards(void)
|
||||
CHEEVOS_LOG("[CHEEVOS]: cancel lboard %s\n", lboard->title);
|
||||
lboard->active = 0;
|
||||
runloop_msg_queue_push("Leaderboard attempt cancelled!",
|
||||
0, 2 * 60, false);
|
||||
0, 2 * 60, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1909,8 +1912,8 @@ static void cheevos_test_leaderboards(void)
|
||||
snprintf(msg, sizeof(msg),
|
||||
"Leaderboard Active: %s", lboard->title);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false);
|
||||
runloop_msg_queue_push(lboard->description, 0, 3*60, false);
|
||||
runloop_msg_queue_push(msg, 0, 2 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(lboard->description, 0, 3*60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2279,7 +2282,7 @@ bool cheevos_toggle_hardcore_mode(void)
|
||||
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
|
||||
|
||||
CHEEVOS_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2810,7 +2813,7 @@ found:
|
||||
|
||||
if (!coro->json)
|
||||
{
|
||||
runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false);
|
||||
runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
CHEEVOS_ERR("[CHEEVOS]: error loading achievements.\n");
|
||||
CORO_STOP();
|
||||
}
|
||||
@ -2839,7 +2842,8 @@ found:
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
"This game has no achievements.",
|
||||
0, 5 * 60, false);
|
||||
0, 5 * 60, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
cheevos_free_cheevo_set(&cheevos_locals.core);
|
||||
cheevos_free_cheevo_set(&cheevos_locals.unofficial);
|
||||
@ -2887,7 +2891,7 @@ found:
|
||||
"You have %d of %d achievements unlocked.",
|
||||
number_of_unlocked, cheevos_locals.core.count);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 6 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 6 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
CORO_GOSUB(GET_BADGES);
|
||||
@ -3292,10 +3296,12 @@ found:
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
"Missing RetroAchievements account information.",
|
||||
0, 5 * 60, false);
|
||||
0, 5 * 60, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
runloop_msg_queue_push(
|
||||
"Please fill in your account information in Settings.",
|
||||
0, 5 * 60, false);
|
||||
0, 5 * 60, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
CHEEVOS_ERR("[CHEEVOS]: login info not informed.\n");
|
||||
CORO_STOP();
|
||||
}
|
||||
@ -3352,7 +3358,7 @@ found:
|
||||
"RetroAchievements: Logged in as \"%s\".",
|
||||
coro->settings->arrays.cheevos_username);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, false);
|
||||
runloop_msg_queue_push(msg, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
/* Save token to config and clear pass on success */
|
||||
@ -3373,13 +3379,13 @@ found:
|
||||
"RetroAchievements: %s",
|
||||
error_response);
|
||||
error_message[sizeof(error_message) - 1] = 0;
|
||||
runloop_msg_queue_push(error_message, 0, 5 * 60, false);
|
||||
runloop_msg_queue_push(error_message, 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
*coro->settings->arrays.cheevos_token = '\0';
|
||||
|
||||
CORO_STOP();
|
||||
}
|
||||
|
||||
runloop_msg_queue_push("RetroAchievements: Error contacting server.", 0, 5 * 60, false);
|
||||
runloop_msg_queue_push("RetroAchievements: Error contacting server.", 0, 5 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
CHEEVOS_ERR("[CHEEVOS]: error getting user token.\n");
|
||||
|
||||
CORO_STOP();
|
||||
@ -3636,7 +3642,7 @@ bool cheevos_load(const void *data)
|
||||
if (!coro)
|
||||
return false;
|
||||
|
||||
task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
task = task_init();
|
||||
|
||||
if (!task)
|
||||
{
|
||||
|
74
command.c
74
command.c
@ -59,6 +59,9 @@
|
||||
#include "menu/menu_content.h"
|
||||
#include "menu/menu_shader.h"
|
||||
#include "menu/widgets/menu_dialog.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
@ -260,7 +263,7 @@ bool command_set_shader(const char *arg)
|
||||
return false;
|
||||
|
||||
snprintf(msg, sizeof(msg), "Shader: \"%s\"", arg);
|
||||
runloop_msg_queue_push(msg, 1, 120, true);
|
||||
runloop_msg_queue_push(msg, 1, 120, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_APPLYING_SHADER),
|
||||
arg);
|
||||
@ -788,7 +791,7 @@ static void command_event_disk_control_set_eject(bool new_state, bool print_log)
|
||||
|
||||
/* Only noise in menu. */
|
||||
if (print_log)
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -846,7 +849,7 @@ static void command_event_disk_control_set_index(unsigned idx)
|
||||
RARCH_ERR("%s\n", msg);
|
||||
else
|
||||
RARCH_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -887,7 +890,7 @@ static bool command_event_disk_control_append_image(const char *path)
|
||||
snprintf(msg, sizeof(msg), "%s: ", msg_hash_to_str(MSG_APPENDED_DISK));
|
||||
strlcat(msg, path, sizeof(msg));
|
||||
RARCH_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 0, 180, true);
|
||||
runloop_msg_queue_push(msg, 0, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL);
|
||||
|
||||
@ -996,7 +999,12 @@ static void command_event_set_volume(float gain)
|
||||
snprintf(msg, sizeof(msg), "%s: %.1f dB",
|
||||
msg_hash_to_str(MSG_AUDIO_VOLUME),
|
||||
new_volume);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
||||
#endif
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
|
||||
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, new_volume);
|
||||
@ -1023,7 +1031,7 @@ static void command_event_set_mixer_volume(float gain)
|
||||
snprintf(msg, sizeof(msg), "%s: %.1f dB",
|
||||
msg_hash_to_str(MSG_AUDIO_VOLUME),
|
||||
new_volume);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
|
||||
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, new_volume);
|
||||
@ -1502,7 +1510,7 @@ static bool command_event_save_core_config(void)
|
||||
|
||||
if (string_is_empty(config_dir))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("[Config]: %s\n", msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET));
|
||||
free (config_dir);
|
||||
return false;
|
||||
@ -1575,7 +1583,7 @@ static bool command_event_save_core_config(void)
|
||||
command_event_save_config(config_path, msg, sizeof(msg));
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
if (overrides_active)
|
||||
rarch_ctl(RARCH_CTL_SET_OVERRIDES_ACTIVE, NULL);
|
||||
@ -1630,7 +1638,7 @@ static void command_event_save_current_config(enum override_type type)
|
||||
}
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
static void command_event_undo_save_state(char *s, size_t len)
|
||||
@ -1739,7 +1747,7 @@ static bool command_event_main_state(unsigned cmd)
|
||||
MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES), sizeof(msg));
|
||||
|
||||
if (push_msg)
|
||||
runloop_msg_queue_push(msg, 2, 180, true);
|
||||
runloop_msg_queue_push(msg, 2, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
|
||||
free(state_path);
|
||||
@ -1802,7 +1810,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
snprintf(msg, sizeof(msg),"%s: %dx%d",
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION),
|
||||
width, height);
|
||||
runloop_msg_queue_push(msg, 1, 100, true);
|
||||
runloop_msg_queue_push(msg, 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1897,7 +1905,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
cheevos_hardcore_paused = false;
|
||||
#endif
|
||||
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_RESET));
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET), 1, 120, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
cheevos_set_cheats();
|
||||
@ -2122,7 +2130,11 @@ TODO: Add a setting for these tweaks */
|
||||
return false;
|
||||
}
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_volume_update_and_show())
|
||||
#endif
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
break;
|
||||
@ -2379,7 +2391,7 @@ TODO: Add a setting for these tweaks */
|
||||
break;
|
||||
case CMD_EVENT_SHUTDOWN:
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
system("shutdown -P now");
|
||||
@ -2387,7 +2399,7 @@ TODO: Add a setting for these tweaks */
|
||||
break;
|
||||
case CMD_EVENT_REBOOT:
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
system("shutdown -r now");
|
||||
@ -2417,7 +2429,7 @@ TODO: Add a setting for these tweaks */
|
||||
core_path,
|
||||
core_name
|
||||
);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -2437,7 +2449,7 @@ TODO: Add a setting for these tweaks */
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
break;
|
||||
|
||||
}
|
||||
@ -2491,8 +2503,12 @@ TODO: Add a setting for these tweaks */
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_PAUSED));
|
||||
command_event(CMD_EVENT_AUDIO_STOP, NULL);
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
|
||||
1, true);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_set_paused(is_paused))
|
||||
#endif
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_PAUSED), 1,
|
||||
1, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
if (!is_idle)
|
||||
video_driver_cached_frame();
|
||||
@ -2506,6 +2522,11 @@ TODO: Add a setting for these tweaks */
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (video_driver_has_widgets())
|
||||
menu_widgets_set_paused(is_paused);
|
||||
#endif
|
||||
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_UNPAUSED));
|
||||
command_event(CMD_EVENT_AUDIO_START, NULL);
|
||||
}
|
||||
@ -2760,7 +2781,8 @@ TODO: Add a setting for these tweaks */
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
|
||||
1, 120, true);
|
||||
1, 120, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_DISK_NEXT:
|
||||
@ -2784,7 +2806,8 @@ TODO: Add a setting for these tweaks */
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
|
||||
1, 120, true);
|
||||
1, 120, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_DISK_PREV:
|
||||
@ -2808,7 +2831,8 @@ TODO: Add a setting for these tweaks */
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS),
|
||||
1, 120, true);
|
||||
1, 120, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_RUMBLE_STOP:
|
||||
@ -2875,7 +2899,8 @@ TODO: Add a setting for these tweaks */
|
||||
input_driver_keyboard_mapping_set_block(1);
|
||||
if (mode != -1)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON),
|
||||
1, 120, true);
|
||||
1, 120, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2885,7 +2910,8 @@ TODO: Add a setting for these tweaks */
|
||||
input_driver_keyboard_mapping_set_block(0);
|
||||
if (mode != -1)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF),
|
||||
1, 120, true);
|
||||
1, 120, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3416,7 +3416,8 @@ bool config_load_override(void)
|
||||
* since it will be overwritten by the override when reloading. */
|
||||
path_set(RARCH_PATH_CORE, buf);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CONFIG_OVERRIDE_LOADED),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
/* Reset save paths. */
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
@ -3554,7 +3555,8 @@ bool config_load_remap(void)
|
||||
if (input_remapping_load_file(new_conf, game_path))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(
|
||||
MSG_GAME_REMAP_FILE_LOADED), 1, 100, true);
|
||||
MSG_GAME_REMAP_FILE_LOADED), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
||||
goto success;
|
||||
}
|
||||
@ -3575,7 +3577,8 @@ bool config_load_remap(void)
|
||||
if (input_remapping_load_file(new_conf, content_path))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(
|
||||
MSG_GAME_REMAP_FILE_LOADED), 1, 100, true);
|
||||
MSG_GAME_REMAP_FILE_LOADED), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
rarch_ctl(RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, NULL);
|
||||
goto success;
|
||||
}
|
||||
@ -3596,7 +3599,8 @@ bool config_load_remap(void)
|
||||
if (input_remapping_load_file(new_conf, core_path))
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_CORE_REMAP_FILE_LOADED), 1, 100, true);
|
||||
msg_hash_to_str(MSG_CORE_REMAP_FILE_LOADED), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
||||
goto success;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ static void handle_discord_error(int errcode, const char* message)
|
||||
RARCH_LOG("[Discord] error (%d: %s)\n", errcode, message);
|
||||
}
|
||||
|
||||
static void handle_discord_join_cb(void *task_data, void *user_data, const char *err)
|
||||
static void handle_discord_join_cb(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
struct netplay_room *room;
|
||||
char tmp_hostname[32];
|
||||
|
23
driver.c
23
driver.c
@ -26,6 +26,9 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu_driver.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "dynamic.h"
|
||||
@ -306,7 +309,8 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT),
|
||||
2, 180, false);
|
||||
2, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
||||
command_event(CMD_EVENT_RECORD_INIT, NULL);
|
||||
}
|
||||
@ -384,6 +388,14 @@ void drivers_init(int flags)
|
||||
core_info_init_current_core();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (video_driver_has_widgets())
|
||||
{
|
||||
menu_widgets_init(video_is_threaded);
|
||||
menu_widgets_context_reset(video_is_threaded);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (flags & DRIVER_VIDEO_MASK)
|
||||
{
|
||||
if (flags & DRIVER_MENU_MASK)
|
||||
@ -484,6 +496,15 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_DRIVER_CTL_DEINIT:
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
/* Tear down menu widgets no matter what
|
||||
* in case the handle is lost in the threaded
|
||||
* video driver in the meantime
|
||||
* (breaking video_driver_has_widgets) */
|
||||
menu_widgets_context_destroy();
|
||||
menu_widgets_free();
|
||||
|
||||
#endif
|
||||
video_driver_destroy();
|
||||
audio_driver_destroy();
|
||||
input_driver_destroy();
|
||||
|
@ -353,7 +353,7 @@ static bool load_dynamic_core(void)
|
||||
path_get(RARCH_PATH_CORE));
|
||||
RARCH_ERR("Error(s): %s\n", dylib_error());
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1242,7 +1242,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||
{
|
||||
const struct retro_message *msg = (const struct retro_message*)data;
|
||||
RARCH_LOG("Environ SET_MESSAGE: %s\n", msg->msg);
|
||||
runloop_msg_queue_push(msg->msg, 3, msg->frames, true);
|
||||
runloop_msg_queue_push(msg->msg, 3, msg->frames, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,9 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GL_UNSIGNED_INT_8_8_8_8_REV
|
||||
@ -2721,6 +2724,10 @@ static bool gl2_frame(void *data, const void *frame,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
menu_widgets_frame(video_info);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
@ -3546,6 +3553,7 @@ static void *gl2_init(const video_info_t *video,
|
||||
}
|
||||
|
||||
gl2_context_bind_hw_render(gl, true);
|
||||
|
||||
return gl;
|
||||
|
||||
error:
|
||||
@ -4140,6 +4148,14 @@ static void gl2_get_poke_interface(void *data,
|
||||
*iface = &gl2_poke_interface;
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
static bool gl2_menu_widgets_enabled(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
video_driver_t video_gl2 = {
|
||||
gl2_init,
|
||||
gl2_frame,
|
||||
@ -4171,4 +4187,7 @@ video_driver_t video_gl2 = {
|
||||
#endif
|
||||
gl2_get_poke_interface,
|
||||
gl2_wrap_type_to_enum,
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
gl2_menu_widgets_enabled
|
||||
#endif
|
||||
};
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "../audio/audio_driver.h"
|
||||
#include "../menu/menu_shader.h"
|
||||
#include "../menu/menu_animation.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
@ -47,6 +48,9 @@
|
||||
#ifdef HAVE_MENU
|
||||
#include "../menu/menu_driver.h"
|
||||
#include "../menu/menu_setting.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "video_thread_wrapper.h"
|
||||
@ -852,7 +856,9 @@ static void video_driver_free_internal(void)
|
||||
&& video_driver_data
|
||||
&& current_video && current_video->free
|
||||
)
|
||||
current_video->free(video_driver_data);
|
||||
{
|
||||
current_video->free(video_driver_data);
|
||||
}
|
||||
|
||||
video_driver_pixel_converter_free();
|
||||
video_driver_filter_free();
|
||||
@ -1278,7 +1284,7 @@ void video_monitor_set_refresh_rate(float hz)
|
||||
|
||||
snprintf(msg, sizeof(msg),
|
||||
"Setting refresh rate to: %.3f Hz.", hz);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
|
||||
configuration_set_float(settings,
|
||||
@ -2647,7 +2653,10 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
/* Display the FPS, with a higher priority. */
|
||||
if (video_info.fps_show || video_info.framecount_show)
|
||||
runloop_msg_queue_push(video_info.fps_text, 2, 1, true);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_set_fps_text(video_info.fps_text))
|
||||
#endif
|
||||
runloop_msg_queue_push(video_info.fps_text, 2, 1, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
/* trigger set resolution*/
|
||||
if (video_info.crt_switch_resolution)
|
||||
@ -3566,3 +3575,11 @@ float video_driver_get_refresh_rate(void)
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
bool video_driver_has_widgets(void)
|
||||
{
|
||||
return current_video && current_video->menu_widgets_enabled
|
||||
&& current_video->menu_widgets_enabled(video_driver_data);
|
||||
}
|
||||
#endif
|
@ -807,6 +807,12 @@ typedef struct video_driver
|
||||
#endif
|
||||
void (*poke_interface)(void *data, const video_poke_interface_t **iface);
|
||||
unsigned (*wrap_type_to_enum)(enum gfx_wrap_type type);
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
/* if set to true, will use menu widgets when applicable
|
||||
* if set to false, will use OSD as a fallback */
|
||||
bool (*menu_widgets_enabled)(void *data);
|
||||
#endif
|
||||
} video_driver_t;
|
||||
|
||||
extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
|
||||
@ -876,6 +882,10 @@ bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
||||
void video_driver_set_title_buf(void);
|
||||
void video_driver_monitor_adjust_system_rates(void);
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
bool video_driver_has_widgets(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* video_driver_find_handle:
|
||||
* @index : index of driver to get handle to.
|
||||
|
@ -1282,6 +1282,18 @@ static void video_thread_get_poke_interface(
|
||||
*iface = NULL;
|
||||
}
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
static bool video_thread_wrapper_menu_widgets_enabled(void *data)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
|
||||
if (thr && thr->driver)
|
||||
return thr->driver->menu_widgets_enabled(thr->driver_data);
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const video_driver_t video_thread = {
|
||||
video_thread_init_never_call, /* Should never be called directly. */
|
||||
video_thread_frame,
|
||||
@ -1302,6 +1314,10 @@ static const video_driver_t video_thread = {
|
||||
video_thread_get_overlay_interface, /* get_overlay_interface */
|
||||
#endif
|
||||
video_thread_get_poke_interface,
|
||||
NULL,
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
video_thread_wrapper_menu_widgets_enabled
|
||||
#endif
|
||||
};
|
||||
|
||||
static void video_thread_set_callbacks(
|
||||
|
@ -1196,6 +1196,7 @@ MENU
|
||||
#include "../menu/widgets/menu_dialog.c"
|
||||
#include "../menu/widgets/menu_input_dialog.c"
|
||||
#include "../menu/widgets/menu_input_bind_dialog.c"
|
||||
#include "../menu/widgets/menu_widgets.c"
|
||||
#include "../menu/widgets/menu_osk.c"
|
||||
#include "../menu/cbs/menu_cbs_ok.c"
|
||||
#include "../menu/cbs/menu_cbs_cancel.c"
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "../gfx/video_driver.h"
|
||||
#include "input_overlay.h"
|
||||
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#define OVERLAY_GET_KEY(state, key) (((state)->keys[(key) / 32] >> ((key) % 32)) & 1)
|
||||
#define OVERLAY_SET_KEY(state, key) (state)->keys[(key) / 32] |= 1 << ((key) % 32)
|
||||
|
||||
@ -595,7 +597,7 @@ void input_overlay_free(input_overlay_t *ol)
|
||||
}
|
||||
|
||||
/* task_data = overlay_task_data_t* */
|
||||
void input_overlay_loaded(void *task_data, void *user_data, const char *err)
|
||||
void input_overlay_loaded(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
size_t i;
|
||||
overlay_task_data_t *data = (overlay_task_data_t*)task_data;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <retro_common_api.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <formats/image.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include "input_driver.h"
|
||||
|
||||
@ -256,7 +257,7 @@ bool input_overlay_key_pressed(input_overlay_t *ol, unsigned key);
|
||||
|
||||
bool input_overlay_is_alive(input_overlay_t *ol);
|
||||
|
||||
void input_overlay_loaded(void *task_data, void *user_data, const char *err);
|
||||
void input_overlay_loaded(retro_task_t *task, void *task_data, void *user_data, const char *err);
|
||||
|
||||
void input_overlay_set_visibility(int overlay_idx,enum overlay_visibility vis);
|
||||
|
||||
|
@ -4702,6 +4702,10 @@ MSG_HASH(
|
||||
MSG_TAKING_SCREENSHOT,
|
||||
"Taking screenshot."
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_SCREENSHOT_SAVED,
|
||||
"Screenshot saved"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_TO,
|
||||
"to"
|
||||
|
@ -91,6 +91,12 @@ bool file_list_prepend(file_list_t *list,
|
||||
unsigned type, size_t directory_ptr,
|
||||
size_t entry_idx);
|
||||
|
||||
bool file_list_insert(file_list_t *list,
|
||||
const char *path, const char *label,
|
||||
unsigned type, size_t directory_ptr,
|
||||
size_t entry_idx,
|
||||
size_t idx);
|
||||
|
||||
void file_list_pop(file_list_t *list, size_t *directory_ptr);
|
||||
|
||||
void file_list_clear(file_list_t *list);
|
||||
|
@ -29,6 +29,19 @@
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
enum message_queue_icon
|
||||
{
|
||||
MESSAGE_QUEUE_ICON_DEFAULT = 0 /* default icon is tied to category */
|
||||
};
|
||||
|
||||
enum message_queue_category
|
||||
{
|
||||
MESSAGE_QUEUE_CATEGORY_INFO = 0,
|
||||
MESSAGE_QUEUE_CATEGORY_ERROR,
|
||||
MESSAGE_QUEUE_CATEGORY_WARNING,
|
||||
MESSAGE_QUEUE_CATEGORY_SUCCESS
|
||||
};
|
||||
|
||||
typedef struct msg_queue msg_queue_t;
|
||||
|
||||
/**
|
||||
@ -54,7 +67,9 @@ msg_queue_t *msg_queue_new(size_t size);
|
||||
* Push a new message onto the queue.
|
||||
**/
|
||||
void msg_queue_push(msg_queue_t *queue, const char *msg,
|
||||
unsigned prio, unsigned duration);
|
||||
unsigned prio, unsigned duration,
|
||||
char *title,
|
||||
enum message_queue_icon icon, enum message_queue_category category);
|
||||
|
||||
/**
|
||||
* msg_queue_pull:
|
||||
|
@ -43,15 +43,16 @@ enum task_type
|
||||
};
|
||||
|
||||
typedef struct retro_task retro_task_t;
|
||||
typedef void (*retro_task_callback_t)(void *task_data,
|
||||
void *user_data, const char *error);
|
||||
typedef void (*retro_task_callback_t)(retro_task_t *task,
|
||||
void *task_data, void *user_data,
|
||||
const char *error);
|
||||
|
||||
typedef void (*retro_task_handler_t)(retro_task_t *task);
|
||||
|
||||
typedef bool (*retro_task_finder_t)(retro_task_t *task,
|
||||
void *userdata);
|
||||
|
||||
typedef void (*retro_task_queue_msg_t)(const char *msg,
|
||||
typedef void (*retro_task_queue_msg_t)(retro_task_t *task, const char *msg,
|
||||
unsigned prio, unsigned duration, bool flush);
|
||||
|
||||
typedef bool (*retro_task_retriever_t)(retro_task_t *task, void *data);
|
||||
@ -109,6 +110,13 @@ struct retro_task
|
||||
|
||||
enum task_type type;
|
||||
|
||||
/* task identifier */
|
||||
uint32_t ident;
|
||||
|
||||
/* frontend userdata
|
||||
* (e.g. associate a sticky notification to a task) */
|
||||
void *frontend_userdata;
|
||||
|
||||
/* don't touch this. */
|
||||
retro_task_t *next;
|
||||
};
|
||||
@ -231,6 +239,9 @@ void task_queue_deinit(void);
|
||||
* This must only be called from the main thread. */
|
||||
void task_queue_init(bool threaded, retro_task_queue_msg_t msg_push);
|
||||
|
||||
/* Allocs and inits a new retro_task_t */
|
||||
retro_task_t *task_init();
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -85,12 +85,25 @@ bool file_list_prepend(file_list_t *list,
|
||||
unsigned type, size_t directory_ptr,
|
||||
size_t entry_idx)
|
||||
{
|
||||
unsigned i;
|
||||
return file_list_insert(list, path,
|
||||
label, type,
|
||||
directory_ptr, entry_idx,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
bool file_list_insert(file_list_t *list,
|
||||
const char *path, const char *label,
|
||||
unsigned type, size_t directory_ptr,
|
||||
size_t entry_idx,
|
||||
size_t idx)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!file_list_expand_if_needed(list))
|
||||
return false;
|
||||
|
||||
for (i = (unsigned)list->size; i > 0; i--)
|
||||
for (i = (unsigned)list->size; i > idx; i--)
|
||||
{
|
||||
struct item_file *copy = (struct item_file*)
|
||||
calloc(1, sizeof(struct item_file));
|
||||
@ -103,7 +116,7 @@ bool file_list_prepend(file_list_t *list,
|
||||
free(copy);
|
||||
}
|
||||
|
||||
file_list_add(list, 0, path, label, type,
|
||||
file_list_add(list, idx, path, label, type,
|
||||
directory_ptr, entry_idx);
|
||||
|
||||
return true;
|
||||
|
@ -33,6 +33,10 @@ struct queue_elem
|
||||
unsigned duration;
|
||||
unsigned prio;
|
||||
char *msg;
|
||||
|
||||
char *title;
|
||||
enum message_queue_icon icon;
|
||||
enum message_queue_category category;
|
||||
};
|
||||
|
||||
struct msg_queue
|
||||
@ -105,7 +109,9 @@ void msg_queue_free(msg_queue_t *queue)
|
||||
* Push a new message onto the queue.
|
||||
**/
|
||||
void msg_queue_push(msg_queue_t *queue, const char *msg,
|
||||
unsigned prio, unsigned duration)
|
||||
unsigned prio, unsigned duration,
|
||||
char *title,
|
||||
enum message_queue_icon icon, enum message_queue_category category)
|
||||
{
|
||||
size_t tmp_ptr = 0;
|
||||
struct queue_elem *new_elem = NULL;
|
||||
|
@ -62,6 +62,8 @@ static task_queue_t tasks_finished = {NULL, NULL};
|
||||
static struct retro_task_impl *impl_current = NULL;
|
||||
static bool task_threaded_enable = false;
|
||||
|
||||
static uint32_t task_count = 0;
|
||||
|
||||
static void task_queue_msg_push(retro_task_t *task,
|
||||
unsigned prio, unsigned duration,
|
||||
bool flush, const char *fmt, ...)
|
||||
@ -76,7 +78,7 @@ static void task_queue_msg_push(retro_task_t *task,
|
||||
va_end(ap);
|
||||
|
||||
if (impl_current->msg_push)
|
||||
impl_current->msg_push(buf, prio, duration, flush);
|
||||
impl_current->msg_push(task, buf, prio, duration, flush);
|
||||
}
|
||||
|
||||
static void task_queue_push_progress(retro_task_t *task)
|
||||
@ -138,7 +140,7 @@ static void retro_task_internal_gather(void)
|
||||
task_queue_push_progress(task);
|
||||
|
||||
if (task->callback)
|
||||
task->callback(task->task_data, task->user_data, task->error);
|
||||
task->callback(task, task->task_data, task->user_data, task->error);
|
||||
|
||||
if (task->cleanup)
|
||||
task->cleanup(task);
|
||||
@ -820,3 +822,18 @@ char* task_get_title(retro_task_t *task)
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
static uint32_t task_get_next_ident()
|
||||
{
|
||||
return task_count++;
|
||||
}
|
||||
|
||||
retro_task_t *task_init()
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
|
||||
task->ident = task_get_next_ident();
|
||||
task->frontend_userdata = NULL;
|
||||
|
||||
return task;
|
||||
}
|
@ -143,7 +143,7 @@ bool driver_location_start(void)
|
||||
if (settings->bools.location_allow)
|
||||
return location_driver->start(location_data);
|
||||
|
||||
runloop_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true);
|
||||
runloop_msg_queue_push("Location is explicitly disabled.\n", 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ void cheat_manager_apply_cheats(void)
|
||||
|
||||
if (cheat_manager_state.size > 0)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_APPLYING_CHEAT), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_APPLYING_CHEAT), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_APPLYING_CHEAT));
|
||||
}
|
||||
|
||||
@ -574,7 +574,7 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx)
|
||||
(handle->cheats[handle_idx].desc!=NULL) ?
|
||||
(handle->cheats[handle_idx].desc) : (handle->cheats[handle_idx].code)
|
||||
);
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
|
||||
@ -782,7 +782,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound)
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
if (!core_get_memory(&meminfo))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -820,7 +820,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound)
|
||||
cheat_manager_state.prev_memory_buf = (uint8_t*) calloc(cheat_manager_state.total_memory_size, sizeof(uint8_t));
|
||||
if (!cheat_manager_state.prev_memory_buf)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -835,7 +835,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound)
|
||||
{
|
||||
free(cheat_manager_state.prev_memory_buf);
|
||||
cheat_manager_state.prev_memory_buf = NULL;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -854,7 +854,7 @@ int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound)
|
||||
|
||||
cheat_manager_state.memory_initialized = true;
|
||||
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_SUCCESS), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_INIT_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (!wraparound)
|
||||
@ -977,7 +977,7 @@ int cheat_manager_search(enum cheat_search_type search_type)
|
||||
|
||||
if (cheat_manager_state.num_memory_buffers == 0)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_NOT_INITIALIZED), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_NOT_INITIALIZED), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1084,7 +1084,7 @@ int cheat_manager_search(enum cheat_search_type search_type)
|
||||
snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_CHEAT_SEARCH_FOUND_MATCHES), cheat_manager_state.num_matches);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
@ -1126,7 +1126,7 @@ int cheat_manager_add_matches(const char *path,
|
||||
|
||||
if (cheat_manager_state.num_matches + cheat_manager_state.size > 100)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_TOO_MANY), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_TOO_MANY), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
cheat_manager_setup_search_meta(cheat_manager_state.search_bit_size, &bytes_per_item, &mask, &bits);
|
||||
@ -1164,7 +1164,7 @@ int cheat_manager_add_matches(const char *path,
|
||||
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
|
||||
cheat_manager_state.big_endian, curr_val))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
num_added++;
|
||||
@ -1178,7 +1178,7 @@ int cheat_manager_add_matches(const char *path,
|
||||
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, 0xFF,
|
||||
cheat_manager_state.big_endian, curr_val))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
num_added++;
|
||||
@ -1191,7 +1191,7 @@ int cheat_manager_add_matches(const char *path,
|
||||
snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_CHEAT_SEARCH_ADDED_MATCHES_SUCCESS), cheat_manager_state.num_matches);
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
@ -1561,9 +1561,9 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
|
||||
case CHEAT_MATCH_ACTION_TYPE_COPY :
|
||||
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, (mask << (byte_part*bits)),
|
||||
cheat_manager_state.big_endian, curr_val))
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
case CHEAT_MATCH_ACTION_TYPE_DELETE :
|
||||
if (bits < 8)
|
||||
@ -1573,7 +1573,7 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
|
||||
memset(cheat_manager_state.matches+idx,0,bytes_per_item);
|
||||
if (cheat_manager_state.num_matches > 0)
|
||||
cheat_manager_state.num_matches--;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
@ -1601,9 +1601,9 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
|
||||
case CHEAT_MATCH_ACTION_TYPE_COPY :
|
||||
if (!cheat_manager_add_new_code(cheat_manager_state.search_bit_size, idx, 0xFF,
|
||||
cheat_manager_state.big_endian, curr_val))
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_FAIL), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_ADD_MATCH_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
case CHEAT_MATCH_ACTION_TYPE_DELETE :
|
||||
if (bits < 8)
|
||||
@ -1613,7 +1613,7 @@ void cheat_manager_match_action(enum cheat_match_action_type match_action, unsig
|
||||
memset(cheat_manager_state.matches+idx,0,bytes_per_item);
|
||||
if (cheat_manager_state.num_matches > 0)
|
||||
cheat_manager_state.num_matches--;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1082,7 +1082,7 @@ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
void handle_dbscan_finished(void *task_data, void *user_data, const char *err);
|
||||
void handle_dbscan_finished(retro_task_t *task, void *task_data, void *user_data, const char *err);
|
||||
#endif
|
||||
|
||||
static void content_add_to_playlist(const char *path)
|
||||
@ -1411,7 +1411,7 @@ static int generic_action_ok(const char *path,
|
||||
if(!file_copy(action_path, destination_path, message, sizeof(message)))
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_ERROR), 1, 100, true);
|
||||
MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_ERROR), 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("[sideload] %s: %s\n", msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_ERROR), message);
|
||||
RARCH_LOG(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_ERROR));
|
||||
@ -1419,7 +1419,7 @@ static int generic_action_ok(const char *path,
|
||||
else
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_SUCCESS), 1, 100, true);
|
||||
MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_SUCCESS), 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("[sideload] %s\n", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_SUCCESS));
|
||||
}
|
||||
}
|
||||
@ -1788,7 +1788,8 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
"File could not be loaded from playlist.\n",
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
if (playlist_initialized)
|
||||
playlist_free(tmp_playlist);
|
||||
return menu_cbs_exit();
|
||||
@ -1863,7 +1864,8 @@ static int action_ok_playlist_entry(const char *path,
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
"File could not be loaded from playlist.\n",
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return menu_cbs_exit();
|
||||
}
|
||||
|
||||
@ -1938,7 +1940,7 @@ static int action_ok_playlist_entry_start_content(const char *path,
|
||||
|
||||
if (!menu_content_playlist_load(playlist, selection_ptr))
|
||||
{
|
||||
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true);
|
||||
runloop_msg_queue_push("File could not be loaded from playlist.\n", 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -2240,13 +2242,15 @@ static void menu_input_st_string_cb_disable_kiosk_mode(void *userdata,
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_OK),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_NOK),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2267,13 +2271,15 @@ static void menu_input_st_string_cb_enable_settings(void *userdata,
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_INPUT_ENABLE_SETTINGS_PASSWORD_OK),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_INPUT_ENABLE_SETTINGS_PASSWORD_NOK),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2303,11 +2309,13 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
if(ret)
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
menu_input_dialog_end();
|
||||
@ -2435,11 +2443,13 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
||||
if(menu_shader_manager_save_preset(file, false, true))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2525,12 +2535,14 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_REMAP_FILE_SAVED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_SAVING_REMAP_FILE),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2559,12 +2571,14 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_REMAP_FILE_REMOVED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_REMOVING_REMAP_FILE),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2700,7 +2714,7 @@ static int action_ok_set_switch_cpu_profile(const char *path,
|
||||
snprintf(command, sizeof(command), "Current Clock set to %i", profile_clock);
|
||||
#endif
|
||||
|
||||
runloop_msg_queue_push(command, 1, 90, true);
|
||||
runloop_msg_queue_push(command, 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return menu_cbs_exit();
|
||||
}
|
||||
@ -2721,7 +2735,7 @@ static int action_ok_set_switch_gpu_profile(const char *path,
|
||||
|
||||
snprintf(command, sizeof(command), "Current profile set to %s", profile_name);
|
||||
|
||||
runloop_msg_queue_push(command, 1, 90, true);
|
||||
runloop_msg_queue_push(command, 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return menu_cbs_exit();
|
||||
}
|
||||
@ -2739,7 +2753,7 @@ static int action_ok_set_switch_backlight(const char *path,
|
||||
|
||||
snprintf(command, sizeof(command), "Brightness set to %d%%", brightness);
|
||||
|
||||
runloop_msg_queue_push(command, 1, 90, true);
|
||||
runloop_msg_queue_push(command, 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2919,7 +2933,7 @@ static int action_ok_cheat_add_top(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_ADD_TOP_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -2940,7 +2954,7 @@ static int action_ok_cheat_add_bottom(const char *path,
|
||||
msg_hash_to_str(MSG_CHEAT_ADD_BOTTOM_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -2952,7 +2966,7 @@ static int action_ok_cheat_delete_all(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_DELETE_ALL_INSTRUCTIONS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 240, true);
|
||||
runloop_msg_queue_push(msg, 1, 240, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
@ -2984,7 +2998,7 @@ static int action_ok_cheat_add_new_after(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_ADD_AFTER_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -3020,7 +3034,7 @@ static int action_ok_cheat_add_new_before(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_ADD_BEFORE_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -3057,7 +3071,7 @@ static int action_ok_cheat_copy_before(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_COPY_BEFORE_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -3094,7 +3108,7 @@ static int action_ok_cheat_copy_after(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_COPY_AFTER_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
@ -3133,7 +3147,7 @@ static int action_ok_cheat_delete(const char *path,
|
||||
strlcpy(msg, msg_hash_to_str(MSG_CHEAT_DELETE_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
new_selection_ptr = menu_navigation_get_selection();
|
||||
menu_entries_pop_stack(&new_selection_ptr, 0, 1);
|
||||
@ -3245,7 +3259,7 @@ static int action_ok_undo_save_state(const char *path,
|
||||
#ifdef HAVE_NETWORKING
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
static void cb_decompressed(void *task_data, void *user_data, const char *err)
|
||||
static void cb_decompressed(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
|
||||
|
||||
@ -3378,7 +3392,7 @@ default_action_ok_list(action_ok_core_updater_list, MENU_ENUM_LABEL_CB_CORE_UPDA
|
||||
default_action_ok_list(action_ok_thumbnails_updater_list, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST)
|
||||
default_action_ok_list(action_ok_lakka_list, MENU_ENUM_LABEL_CB_LAKKA_LIST)
|
||||
|
||||
static void cb_generic_dir_download(void *task_data,
|
||||
static void cb_generic_dir_download(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
file_transfer_t *transf = (file_transfer_t*)user_data;
|
||||
@ -3392,7 +3406,7 @@ static void cb_generic_dir_download(void *task_data,
|
||||
}
|
||||
|
||||
/* expects http_transfer_t*, file_transfer_t* */
|
||||
void cb_generic_download(void *task_data,
|
||||
void cb_generic_download(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
char output_path[PATH_MAX_LENGTH];
|
||||
@ -3527,10 +3541,14 @@ void cb_generic_download(void *task_data,
|
||||
|
||||
if (path_is_compressed_file(output_path))
|
||||
{
|
||||
void *frontend_userdata = task->frontend_userdata;
|
||||
task->frontend_userdata = NULL;
|
||||
|
||||
if (!task_push_decompress(output_path, dir_path,
|
||||
NULL, NULL, NULL,
|
||||
cb_decompressed, (void*)(uintptr_t)
|
||||
msg_hash_calculate(msg_hash_to_str(transf->enum_idx))))
|
||||
msg_hash_calculate(msg_hash_to_str(transf->enum_idx)),
|
||||
frontend_userdata))
|
||||
{
|
||||
err = msg_hash_to_str(MSG_DECOMPRESSION_FAILED);
|
||||
goto finish;
|
||||
@ -3709,7 +3727,8 @@ static int action_ok_option_create(const char *path,
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_SAVING_CORE_OPTIONS_FILE),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3726,7 +3745,8 @@ static int action_ok_option_create(const char *path,
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_CORE_OPTIONS_FILE_CREATED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
path_set(RARCH_PATH_CORE_OPTIONS, game_path);
|
||||
}
|
||||
config_file_free(conf);
|
||||
@ -4258,7 +4278,7 @@ void netplay_refresh_rooms_menu(file_list_t *list)
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
#endif
|
||||
|
||||
static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const char *err)
|
||||
static void netplay_refresh_rooms_cb(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
char *new_data = NULL;
|
||||
const char *path = NULL;
|
||||
@ -4385,7 +4405,7 @@ finish:
|
||||
|
||||
}
|
||||
|
||||
static void netplay_lan_scan_callback(void *task_data,
|
||||
static void netplay_lan_scan_callback(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
struct netplay_host_list *netplay_hosts = NULL;
|
||||
@ -4876,7 +4896,7 @@ static int action_ok_video_resolution(const char *path,
|
||||
snprintf(msg, sizeof(msg),
|
||||
"Applying: %dx%d\n START to reset",
|
||||
width, height);
|
||||
runloop_msg_queue_push(msg, 1, 100, true);
|
||||
runloop_msg_queue_push(msg, 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
#else
|
||||
generic_action_ok_displaylist_push(
|
||||
@ -4908,7 +4928,8 @@ static int action_ok_netplay_enable_host(const char *path,
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_START_WHEN_LOADED),
|
||||
1, 480, true);
|
||||
1, 480, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4938,7 +4959,8 @@ static void action_ok_netplay_enable_client_hostname_cb(
|
||||
(void*)tmp_hostname);
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_START_WHEN_LOADED),
|
||||
1, 480, true);
|
||||
1, 480, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -284,7 +284,7 @@ static int action_right_cheat_delete_all(unsigned type, const char *label,
|
||||
msg_hash_to_str(MSG_CHEAT_DELETE_ALL_SUCCESS), sizeof(msg));
|
||||
msg[sizeof(msg) - 1] = 0;
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
void handle_dbscan_finished(void *task_data, void *user_data, const char *err)
|
||||
void handle_dbscan_finished(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
menu_ctx_environment_t menu_environ;
|
||||
menu_environ.type = MENU_ENVIRON_RESET_HORIZONTAL_LIST;
|
||||
|
@ -274,7 +274,7 @@ static int action_start_video_resolution(unsigned type, const char *label)
|
||||
video_driver_set_video_mode(width, height, true);
|
||||
|
||||
strlcpy(msg, "Resetting to: DEFAULT", sizeof(msg));
|
||||
runloop_msg_queue_push(msg, 1, 100, true);
|
||||
runloop_msg_queue_push(msg, 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -308,7 +308,7 @@ static void materialui_context_reset_textures(materialui_handle_t *mui)
|
||||
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS);
|
||||
|
||||
for (i = 0; i < MUI_TEXTURE_LAST; i++)
|
||||
menu_display_reset_textures_list(materialui_texture_path(i), iconpath, &mui->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||
menu_display_reset_textures_list(materialui_texture_path(i), iconpath, &mui->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
free(iconpath);
|
||||
}
|
||||
|
||||
@ -641,7 +641,6 @@ static void materialui_compute_entries_box(materialui_handle_t* mui, int width)
|
||||
with acceleration */
|
||||
static void materialui_render(void *data, bool is_idle)
|
||||
{
|
||||
menu_animation_ctx_delta_t delta;
|
||||
unsigned bottom, width, height, header_height;
|
||||
size_t i = 0;
|
||||
materialui_handle_t *mui = (materialui_handle_t*)data;
|
||||
@ -660,11 +659,6 @@ static void materialui_render(void *data, bool is_idle)
|
||||
mui->need_compute = false;
|
||||
}
|
||||
|
||||
delta.current = menu_animation_get_delta_time();
|
||||
|
||||
if (menu_animation_get_ideal_delta_time(&delta))
|
||||
menu_animation_update(delta.ideal);
|
||||
|
||||
menu_display_set_width(width);
|
||||
menu_display_set_height(height);
|
||||
header_height = menu_display_get_header_height();
|
||||
@ -1525,7 +1519,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
ticker.s = title_buf;
|
||||
ticker.len = ticker_limit;
|
||||
ticker.idx = mui->frame_count / 100;
|
||||
ticker.idx = menu_animation_get_ticker_time() / 5.0f;
|
||||
ticker.str = title;
|
||||
ticker.selected = true;
|
||||
|
||||
@ -1547,7 +1541,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
ticker.s = title_buf_msg_tmp;
|
||||
ticker.len = ticker_limit;
|
||||
ticker.idx = mui->frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = title_buf_msg;
|
||||
ticker.selected = true;
|
||||
|
||||
@ -1801,7 +1795,7 @@ static void materialui_navigation_set(void *data, bool scroll)
|
||||
if (!mui || !scroll)
|
||||
return;
|
||||
|
||||
entry.duration = 10;
|
||||
entry.duration = 166;
|
||||
entry.target_value = scroll_pos;
|
||||
entry.subject = &mui->scroll_y;
|
||||
entry.easing_enum = EASING_IN_OUT_QUAD;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "../../content.h"
|
||||
#include "../../retroarch.h"
|
||||
|
||||
#include "../../tasks/task_content.h"
|
||||
|
||||
static enum action_iterate_type action_iterate_type(const char *label)
|
||||
{
|
||||
if (string_is_equal(label, "info_screen"))
|
||||
@ -76,6 +78,16 @@ int generic_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_action a
|
||||
if (!menu)
|
||||
return 0;
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (task_load_content_is_pending())
|
||||
{
|
||||
if (task_load_content_should_resume())
|
||||
action = MENU_ACTION_OK;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
menu_entries_get_last_stack(NULL, &label, &file_type, &enum_idx, NULL);
|
||||
|
||||
menu->menu_state_msg[0] = '\0';
|
||||
|
@ -122,6 +122,9 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
||||
|
||||
char xmb_path[PATH_MAX_LENGTH];
|
||||
char monochrome_path[PATH_MAX_LENGTH];
|
||||
|
||||
if (!menu)
|
||||
return NULL;
|
||||
|
||||
@ -232,14 +235,6 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
sizeof(ozone->png_path)
|
||||
);
|
||||
|
||||
/* Icons path */
|
||||
fill_pathname_join(
|
||||
ozone->icons_path,
|
||||
ozone->png_path,
|
||||
"icons",
|
||||
sizeof(ozone->icons_path)
|
||||
);
|
||||
|
||||
/* Sidebar path */
|
||||
fill_pathname_join(
|
||||
ozone->tab_path,
|
||||
@ -248,6 +243,29 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
sizeof(ozone->tab_path)
|
||||
);
|
||||
|
||||
/* XMB monochrome */
|
||||
fill_pathname_join(
|
||||
xmb_path,
|
||||
settings->paths.directory_assets,
|
||||
"xmb",
|
||||
sizeof(xmb_path)
|
||||
);
|
||||
|
||||
fill_pathname_join(
|
||||
monochrome_path,
|
||||
xmb_path,
|
||||
"monochrome",
|
||||
sizeof(monochrome_path)
|
||||
);
|
||||
|
||||
/* Icons path */
|
||||
fill_pathname_join(
|
||||
ozone->icons_path,
|
||||
monochrome_path,
|
||||
"png",
|
||||
sizeof(ozone->icons_path)
|
||||
);
|
||||
|
||||
last_use_preferred_system_color_theme = settings->bools.menu_use_preferred_system_color_theme;
|
||||
|
||||
return menu;
|
||||
@ -258,7 +276,14 @@ error:
|
||||
ozone_free_list_nodes(ozone->horizontal_list, false);
|
||||
file_list_free(ozone->horizontal_list);
|
||||
}
|
||||
ozone->horizontal_list = NULL;
|
||||
|
||||
if (ozone->selection_buf_old)
|
||||
{
|
||||
ozone_free_list_nodes(ozone->selection_buf_old, false);
|
||||
file_list_free(ozone->selection_buf_old);
|
||||
}
|
||||
ozone->selection_buf_old = NULL;
|
||||
ozone->horizontal_list = NULL;
|
||||
|
||||
if (menu)
|
||||
free(menu);
|
||||
@ -293,6 +318,9 @@ static void ozone_free(void *data)
|
||||
file_list_free(ozone->horizontal_list);
|
||||
}
|
||||
|
||||
ozone->horizontal_list = NULL;
|
||||
ozone->selection_buf_old = NULL;
|
||||
|
||||
if (!string_is_empty(ozone->pending_message))
|
||||
free(ozone->pending_message);
|
||||
}
|
||||
@ -369,13 +397,13 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
fill_pathname_application_special(buf,
|
||||
sizeof(buf),
|
||||
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS);
|
||||
if (!menu_display_reset_textures_list(filename, buf, &ozone->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
if (!menu_display_reset_textures_list(filename, buf, &ozone->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
RARCH_WARN("[OZONE] Asset missing: %s%s%s\n", ozone->png_path, path_default_slash(), filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
if (!menu_display_reset_textures_list(filename, ozone->png_path, &ozone->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
if (!menu_display_reset_textures_list(filename, ozone->png_path, &ozone->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
ozone->has_all_assets = false;
|
||||
RARCH_WARN("[OZONE] Asset missing: %s%s%s\n", ozone->png_path, path_default_slash(), filename);
|
||||
@ -392,7 +420,7 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
strlcpy(filename, OZONE_TAB_TEXTURES_FILES[i], sizeof(filename));
|
||||
strlcat(filename, ".png", sizeof(filename));
|
||||
|
||||
if (!menu_display_reset_textures_list(filename, ozone->tab_path, &ozone->tab_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
if (!menu_display_reset_textures_list(filename, ozone->tab_path, &ozone->tab_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
ozone->has_all_assets = false;
|
||||
RARCH_WARN("[OZONE] Asset missing: %s%s%s\n", ozone->tab_path, path_default_slash(), filename);
|
||||
@ -405,11 +433,13 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
|
||||
/* Icons textures init */
|
||||
for (i = 0; i < OZONE_ENTRIES_ICONS_TEXTURE_LAST; i++)
|
||||
if (!menu_display_reset_textures_list(ozone_entries_icon_texture_path(i), ozone->icons_path, &ozone->icons_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
{
|
||||
if (!menu_display_reset_textures_list(ozone_entries_icon_texture_path(i), ozone->icons_path, &ozone->icons_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
ozone->has_all_assets = false;
|
||||
RARCH_WARN("[OZONE] Asset missing: %s%s%s\n", ozone->icons_path, path_default_slash(), ozone_entries_icon_texture_path(i));
|
||||
}
|
||||
}
|
||||
|
||||
menu_display_allocate_white_texture();
|
||||
|
||||
@ -434,8 +464,9 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
if (!ozone->has_all_assets)
|
||||
{
|
||||
RARCH_WARN("[OZONE] Assets missing\n");
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_MISSING_ASSETS), 1, 256, false);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_MISSING_ASSETS), 1, 256, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
ozone_restart_cursor_animation(ozone);
|
||||
}
|
||||
}
|
||||
@ -901,7 +932,6 @@ static void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||
static void ozone_render(void *data, bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
menu_animation_ctx_delta_t delta;
|
||||
unsigned end = (unsigned)menu_entries_get_size();
|
||||
ozone_handle_t *ozone = (ozone_handle_t*)data;
|
||||
if (!data)
|
||||
@ -915,11 +945,6 @@ static void ozone_render(void *data, bool is_idle)
|
||||
|
||||
ozone->selection = menu_navigation_get_selection();
|
||||
|
||||
delta.current = menu_animation_get_delta_time();
|
||||
|
||||
if (menu_animation_get_ideal_delta_time(&delta))
|
||||
menu_animation_update(delta.ideal);
|
||||
|
||||
/* TODO Handle pointer & mouse */
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
||||
@ -946,7 +971,7 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
/* Title */
|
||||
ticker.s = title;
|
||||
ticker.len = (video_info->width - 128 - 47 - 130) / ozone->title_font_glyph_width;
|
||||
ticker.idx = ozone->frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = ozone->title;
|
||||
ticker.selected = true;
|
||||
|
||||
@ -1423,7 +1448,7 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab
|
||||
|
||||
ozone->fade_direction = new_depth <= ozone->depth;
|
||||
ozone->depth = new_depth;
|
||||
ozone->is_playlist = ozone_is_playlist(ozone);
|
||||
ozone->is_playlist = ozone_is_playlist(ozone, true);
|
||||
|
||||
if (ozone->categories_selection_ptr == ozone->categories_active_idx_old)
|
||||
{
|
||||
@ -1441,14 +1466,16 @@ static int ozone_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_act
|
||||
ozone_handle_t *ozone = (ozone_handle_t*) userdata;
|
||||
unsigned horizontal_list_size = 0;
|
||||
|
||||
if (!ozone)
|
||||
{
|
||||
return generic_menu_iterate(menu, userdata, action);
|
||||
}
|
||||
|
||||
if (ozone->horizontal_list)
|
||||
horizontal_list_size = ozone->horizontal_list->size;
|
||||
|
||||
ozone->messagebox_state = false || menu_input_dialog_get_display_kb();
|
||||
|
||||
if (!ozone)
|
||||
return generic_menu_iterate(menu, userdata, action);
|
||||
|
||||
selection_buf = menu_entries_get_selection_buf_ptr(0);
|
||||
tag = (uintptr_t)selection_buf;
|
||||
new_action = action;
|
||||
@ -1518,7 +1545,6 @@ static int ozone_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_act
|
||||
new_action = MENU_ACTION_NOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case MENU_ACTION_CANCEL:
|
||||
if (ozone->cursor_in_sidebar)
|
||||
@ -1822,6 +1848,28 @@ static int ozone_list_bind_init(menu_file_list_cbs_t *cbs,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
static bool ozone_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
|
||||
{
|
||||
ozone_handle_t *ozone = (ozone_handle_t*) userdata;
|
||||
|
||||
if (ozone->categories_selection_ptr > ozone->system_tab_end)
|
||||
{
|
||||
ozone_node_t *node = file_list_get_userdata_at_offset(ozone->horizontal_list, ozone->categories_selection_ptr - ozone->system_tab_end-1);
|
||||
|
||||
*icon = node->icon;
|
||||
*playlist_name = node->console_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
*icon = ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_QUICKMENU];
|
||||
*playlist_name = "RetroArch";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
menu_ctx_driver_t menu_ctx_ozone = {
|
||||
NULL, /* set_texture */
|
||||
ozone_messagebox,
|
||||
@ -1863,5 +1911,10 @@ menu_ctx_driver_t menu_ctx_ozone = {
|
||||
NULL, /* set_thumbnail_content */
|
||||
menu_display_osk_ptr_at_pos,
|
||||
NULL, /* update_savestate_thumbnail_path */
|
||||
NULL /* update_savestate_thumbnail_image */
|
||||
NULL, /* update_savestate_thumbnail_image */
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
ozone_get_load_content_animation_data
|
||||
#endif
|
||||
};
|
||||
|
@ -33,9 +33,9 @@ typedef struct ozone_handle ozone_handle_t;
|
||||
#define FONT_SIZE_ENTRIES_SUBLABEL 18
|
||||
#define FONT_SIZE_SIDEBAR 24
|
||||
|
||||
#define ANIMATION_PUSH_ENTRY_DURATION 10
|
||||
#define ANIMATION_CURSOR_DURATION 8
|
||||
#define ANIMATION_CURSOR_PULSE 30
|
||||
#define ANIMATION_PUSH_ENTRY_DURATION 166
|
||||
#define ANIMATION_CURSOR_DURATION 133
|
||||
#define ANIMATION_CURSOR_PULSE 500
|
||||
|
||||
#define ENTRIES_START_Y 127
|
||||
|
||||
@ -205,6 +205,6 @@ size_t ozone_list_get_size(void *data, enum menu_list_type type);
|
||||
|
||||
void ozone_free_list_nodes(file_list_t *list, bool actiondata);
|
||||
|
||||
bool ozone_is_playlist(ozone_handle_t *ozone);
|
||||
bool ozone_is_playlist(ozone_handle_t *ozone, bool depth);
|
||||
|
||||
#endif
|
||||
|
@ -107,9 +107,6 @@ void ozone_draw_text(
|
||||
uint32_t color,
|
||||
bool draw_outside)
|
||||
{
|
||||
if ((color & 0x000000FF) == 0)
|
||||
return;
|
||||
|
||||
menu_display_draw_text(font, str, x, y,
|
||||
width, height, color, text_align, 1.0f,
|
||||
false,
|
||||
|
@ -227,7 +227,7 @@ border_iterate:
|
||||
/* Prepare text */
|
||||
entry_rich_label = menu_entry_get_rich_label(&entry);
|
||||
|
||||
ticker.idx = ozone->frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.s = rich_label;
|
||||
ticker.str = entry_rich_label;
|
||||
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||
@ -295,7 +295,7 @@ border_iterate:
|
||||
ozone_draw_text(video_info, ozone, sublabel_str, x_offset + 470, y + FONT_SIZE_ENTRIES_SUBLABEL + 80 - 20 - 3 + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
||||
|
||||
/* Value */
|
||||
ticker.idx = ozone->frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.s = entry_value_ticker;
|
||||
ticker.str = entry_value;
|
||||
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||
|
@ -206,10 +206,10 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
goto console_iterate;
|
||||
|
||||
/* Icon */
|
||||
ozone_draw_icon(video_info, 40, 40, node->icon, ozone->sidebar_offset + 41 + 10, y - 5 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
ozone_draw_icon(video_info, 46, 46, node->icon, ozone->sidebar_offset + 41 + 10 - 3, y - 5 - 3 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
|
||||
/* Text */
|
||||
ticker.idx = ozone->frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.len = 19;
|
||||
ticker.s = console_title;
|
||||
ticker.selected = selected;
|
||||
@ -224,7 +224,6 @@ console_iterate:
|
||||
}
|
||||
|
||||
menu_display_blend_end(video_info);
|
||||
|
||||
}
|
||||
|
||||
font_driver_flush(video_info->width, video_info->height, ozone->fonts.sidebar, video_info);
|
||||
@ -589,6 +588,9 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||
else
|
||||
chr = title_noext;
|
||||
|
||||
if (node->console_name)
|
||||
free(node->console_name);
|
||||
|
||||
node->console_name = strdup(chr);
|
||||
|
||||
free(sysname);
|
||||
@ -623,7 +625,7 @@ void ozone_context_destroy_horizontal_list(ozone_handle_t *ozone)
|
||||
}
|
||||
}
|
||||
|
||||
bool ozone_is_playlist(ozone_handle_t *ozone)
|
||||
bool ozone_is_playlist(ozone_handle_t *ozone, bool depth)
|
||||
{
|
||||
bool is_playlist;
|
||||
|
||||
@ -651,5 +653,8 @@ bool ozone_is_playlist(ozone_handle_t *ozone)
|
||||
break;
|
||||
}
|
||||
|
||||
return is_playlist && ozone->depth == 1;
|
||||
if (depth)
|
||||
return is_playlist && ozone->depth == 1;
|
||||
|
||||
return is_playlist;
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ bool ozone_reset_theme_textures(ozone_handle_t *ozone)
|
||||
strlcpy(filename, OZONE_THEME_TEXTURES_FILES[i], sizeof(filename));
|
||||
strlcat(filename, ".png", sizeof(filename));
|
||||
|
||||
if (!menu_display_reset_textures_list(filename, theme_path, &theme->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
if (!menu_display_reset_textures_list(filename, theme_path, &theme->textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
@ -20,21 +20,12 @@
|
||||
#include "ozone.h"
|
||||
#include "ozone_texture.h"
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../../widgets/menu_widgets.h"
|
||||
#endif
|
||||
|
||||
#include "../../../retroarch.h"
|
||||
|
||||
#define HEX_R(hex) ((hex >> 16) & 0xFF) * (1.0f / 255.0f)
|
||||
#define HEX_G(hex) ((hex >> 8 ) & 0xFF) * (1.0f / 255.0f)
|
||||
#define HEX_B(hex) ((hex >> 0 ) & 0xFF) * (1.0f / 255.0f)
|
||||
|
||||
#define COLOR_HEX_TO_FLOAT(hex, alpha) { \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha \
|
||||
}
|
||||
|
||||
#define COLOR_TEXT_ALPHA(color, alpha) (color & 0xFFFFFF00) | alpha
|
||||
|
||||
static float ozone_pure_white[16] = {
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
|
@ -1585,7 +1585,7 @@ static void rgui_render(void *data, bool is_idle)
|
||||
/* Format thumbnail title */
|
||||
ticker.s = thumbnail_title_buf;
|
||||
ticker.len = RGUI_TERM_WIDTH(fb_width) - 10;
|
||||
ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = rgui->thumbnail_content;
|
||||
ticker.selected = true;
|
||||
menu_animation_ticker(&ticker);
|
||||
@ -1619,7 +1619,7 @@ static void rgui_render(void *data, bool is_idle)
|
||||
|
||||
ticker.s = title_buf;
|
||||
ticker.len = RGUI_TERM_WIDTH(fb_width) - 10;
|
||||
ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = title;
|
||||
ticker.selected = true;
|
||||
|
||||
@ -1709,7 +1709,7 @@ static void rgui_render(void *data, bool is_idle)
|
||||
|
||||
ticker.s = entry_title_buf;
|
||||
ticker.len = RGUI_TERM_WIDTH(fb_width) - (entry_spacing + 1 + 2);
|
||||
ticker.idx = frame_count / RGUI_TERM_START_X(fb_width);
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = entry_path;
|
||||
ticker.selected = entry_selected;
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
#define STRIPES_RIBBON_VERTICES 2*STRIPES_RIBBON_COLS*STRIPES_RIBBON_ROWS-2*STRIPES_RIBBON_COLS
|
||||
|
||||
#ifndef STRIPES_DELAY
|
||||
#define STRIPES_DELAY 10
|
||||
#define STRIPES_DELAY 166
|
||||
#endif
|
||||
|
||||
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
||||
@ -2450,7 +2450,7 @@ static int stripes_draw_item(
|
||||
|
||||
ticker.s = tmp;
|
||||
ticker.len = ticker_limit;
|
||||
ticker.idx = frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = ticker_str;
|
||||
ticker.selected = (i == current);
|
||||
|
||||
@ -2486,7 +2486,7 @@ static int stripes_draw_item(
|
||||
|
||||
ticker.s = tmp;
|
||||
ticker.len = 35 * stripes_scale_mod[7];
|
||||
ticker.idx = frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.selected = (i == current);
|
||||
|
||||
if (!string_is_empty(entry->value))
|
||||
@ -2654,7 +2654,6 @@ static void stripes_draw_items(
|
||||
static void stripes_render(void *data, bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
menu_animation_ctx_delta_t delta;
|
||||
settings_t *settings = config_get_ptr();
|
||||
stripes_handle_t *stripes = (stripes_handle_t*)data;
|
||||
unsigned end = (unsigned)menu_entries_get_size();
|
||||
@ -2664,11 +2663,6 @@ static void stripes_render(void *data, bool is_idle)
|
||||
if (!stripes)
|
||||
return;
|
||||
|
||||
delta.current = menu_animation_get_delta_time();
|
||||
|
||||
if (menu_animation_get_ideal_delta_time(&delta))
|
||||
menu_animation_update(delta.ideal);
|
||||
|
||||
if (pointer_enable || mouse_enable)
|
||||
{
|
||||
size_t selection = menu_navigation_get_selection();
|
||||
@ -3621,7 +3615,7 @@ static void stripes_context_reset_textures(
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < STRIPES_TEXTURE_LAST; i++)
|
||||
menu_display_reset_textures_list(stripes_texture_path(i), iconpath, &stripes->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR);
|
||||
menu_display_reset_textures_list(stripes_texture_path(i), iconpath, &stripes->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
|
||||
menu_display_allocate_white_texture();
|
||||
|
||||
|
@ -71,7 +71,7 @@
|
||||
#define XMB_RIBBON_VERTICES 2*XMB_RIBBON_COLS*XMB_RIBBON_ROWS-2*XMB_RIBBON_COLS
|
||||
|
||||
#ifndef XMB_DELAY
|
||||
#define XMB_DELAY 10
|
||||
#define XMB_DELAY 166
|
||||
#endif
|
||||
|
||||
#define BATTERY_LEVEL_CHECK_INTERVAL (30 * 1000000)
|
||||
@ -2923,7 +2923,7 @@ static int xmb_draw_item(
|
||||
|
||||
ticker.s = tmp;
|
||||
ticker.len = ticker_limit;
|
||||
ticker.idx = frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = ticker_str;
|
||||
ticker.selected = (i == current);
|
||||
|
||||
@ -2959,7 +2959,7 @@ static int xmb_draw_item(
|
||||
|
||||
ticker.s = tmp;
|
||||
ticker.len = 35 * scale_mod[7];
|
||||
ticker.idx = frame_count / 20;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.selected = (i == current);
|
||||
|
||||
if (!string_is_empty(entry->value))
|
||||
@ -3140,7 +3140,6 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
|
||||
static void xmb_render(void *data, bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
menu_animation_ctx_delta_t delta;
|
||||
settings_t *settings = config_get_ptr();
|
||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||
unsigned end = (unsigned)menu_entries_get_size();
|
||||
@ -3163,11 +3162,6 @@ static void xmb_render(void *data, bool is_idle)
|
||||
|
||||
xmb->previous_scale_factor = scale_factor;
|
||||
|
||||
delta.current = menu_animation_get_delta_time();
|
||||
|
||||
if (menu_animation_get_ideal_delta_time(&delta))
|
||||
menu_animation_update(delta.ideal);
|
||||
|
||||
if (pointer_enable || mouse_enable)
|
||||
{
|
||||
unsigned height;
|
||||
@ -4906,7 +4900,7 @@ static void xmb_context_reset_textures(
|
||||
|
||||
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
||||
{
|
||||
if (!menu_display_reset_textures_list(xmb_texture_path(i), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR))
|
||||
if (!menu_display_reset_textures_list(xmb_texture_path(i), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL))
|
||||
{
|
||||
RARCH_WARN("[XMB] Asset missing: %s%s\n", iconpath, xmb_texture_path(i));
|
||||
/* If the icon is missing return the subsetting (because some themes are incomplete) */
|
||||
@ -4914,11 +4908,11 @@ static void xmb_context_reset_textures(
|
||||
{
|
||||
/* OSD Warning only if subsetting icon is missing */
|
||||
if (
|
||||
!menu_display_reset_textures_list(xmb_texture_path(XMB_TEXTURE_SUBSETTING), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR)
|
||||
!menu_display_reset_textures_list(xmb_texture_path(XMB_TEXTURE_SUBSETTING), iconpath, &xmb->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL)
|
||||
&& !(settings->uints.menu_xmb_theme == XMB_ICON_THEME_CUSTOM)
|
||||
)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_MISSING_ASSETS), 1, 256, false);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_MISSING_ASSETS), 1, 256, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
/* Do not draw icons if subsetting is missing */
|
||||
goto error;
|
||||
}
|
||||
@ -5771,6 +5765,28 @@ static int xmb_pointer_tap(void *userdata,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
static bool xmb_get_load_content_animation_data(void *userdata, menu_texture_item *icon, char **playlist_name)
|
||||
{
|
||||
xmb_handle_t *xmb = (xmb_handle_t*) userdata;
|
||||
|
||||
if (xmb->categories_selection_ptr > xmb->system_tab_end)
|
||||
{
|
||||
xmb_node_t *node = file_list_get_userdata_at_offset(xmb->horizontal_list, xmb->categories_selection_ptr - xmb->system_tab_end-1);
|
||||
|
||||
*icon = node->icon;
|
||||
*playlist_name = xmb->title_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
*icon = xmb->textures.list[XMB_TEXTURE_QUICKMENU];
|
||||
*playlist_name = "RetroArch";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
menu_ctx_driver_t menu_ctx_xmb = {
|
||||
NULL,
|
||||
xmb_messagebox,
|
||||
@ -5812,5 +5828,10 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
||||
xmb_set_thumbnail_content,
|
||||
menu_display_osk_ptr_at_pos,
|
||||
xmb_update_savestate_thumbnail_path,
|
||||
xmb_update_savestate_thumbnail_image
|
||||
xmb_update_savestate_thumbnail_image,
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
xmb_get_load_content_animation_data
|
||||
#endif
|
||||
};
|
||||
|
@ -571,7 +571,7 @@ static void xui_render(void *data, bool is_idle)
|
||||
|
||||
ticker.s = title;
|
||||
ticker.len = RXUI_TERM_WIDTH(fb_width) - 3;
|
||||
ticker.idx = (unsigned int)frame_count / 15;
|
||||
ticker.idx = menu_animation_get_ticker_time();
|
||||
ticker.str = title;
|
||||
ticker.selected = true;
|
||||
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include "../configuration.h"
|
||||
#include "../performance_counters.h"
|
||||
|
||||
#define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0)
|
||||
|
||||
struct tween
|
||||
{
|
||||
float duration;
|
||||
@ -66,6 +64,7 @@ static menu_animation_t anim;
|
||||
static retro_time_t cur_time = 0;
|
||||
static retro_time_t old_time = 0;
|
||||
static float delta_time = 0.0f;
|
||||
static float ticker_time = 0.0f;
|
||||
static bool animation_is_active = false;
|
||||
|
||||
/* from https://github.com/kikito/tween.lua/blob/master/tween.lua */
|
||||
@ -496,17 +495,21 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool menu_animation_update(float anim_delta_time)
|
||||
bool menu_animation_update()
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
menu_animation_update_time(settings->bools.menu_timedate_enable);
|
||||
|
||||
anim.in_update = true;
|
||||
anim.pending_deletes = false;
|
||||
|
||||
for(i = 0; i < da_count(anim.list); i++)
|
||||
{
|
||||
struct tween *tween = da_getptr(anim.list, i);
|
||||
tween->running_since += anim_delta_time;
|
||||
tween->running_since += delta_time;
|
||||
|
||||
*tween->subject = tween->easing(
|
||||
tween->running_since,
|
||||
@ -591,29 +594,17 @@ bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta)
|
||||
{
|
||||
if (!delta)
|
||||
return false;
|
||||
delta->ideal = delta->current / IDEAL_DELTA_TIME;
|
||||
return true;
|
||||
}
|
||||
|
||||
void menu_animation_update_time(bool timedate_enable)
|
||||
{
|
||||
static retro_time_t
|
||||
last_clock_update = 0;
|
||||
|
||||
cur_time = cpu_features_get_time_usec();
|
||||
delta_time = cur_time - old_time;
|
||||
|
||||
if (delta_time >= IDEAL_DELTA_TIME* 4)
|
||||
delta_time = IDEAL_DELTA_TIME * 4;
|
||||
if (delta_time <= IDEAL_DELTA_TIME / 4)
|
||||
delta_time = IDEAL_DELTA_TIME / 4;
|
||||
cur_time = cpu_features_get_time_usec() / 1000.0f;
|
||||
delta_time = old_time == 0 ? 0 : cur_time - old_time;
|
||||
old_time = cur_time;
|
||||
ticker_time = (cur_time / 1000.0f) * 3.0f;
|
||||
|
||||
if (((cur_time - last_clock_update) > 1000000)
|
||||
if (((cur_time - last_clock_update) > 1000)
|
||||
&& timedate_enable)
|
||||
{
|
||||
animation_is_active = true;
|
||||
@ -752,3 +743,8 @@ void menu_timer_kill(menu_timer_t *timer)
|
||||
menu_animation_ctx_tag tag = (uintptr_t) timer;
|
||||
menu_animation_kill_by_tag(&tag);
|
||||
}
|
||||
|
||||
float menu_animation_get_ticker_time()
|
||||
{
|
||||
return ticker_time;
|
||||
}
|
@ -84,12 +84,6 @@ enum menu_animation_easing_type
|
||||
EASING_LAST
|
||||
};
|
||||
|
||||
typedef struct menu_animation_ctx_delta
|
||||
{
|
||||
float current;
|
||||
float ideal;
|
||||
} menu_animation_ctx_delta_t;
|
||||
|
||||
typedef uintptr_t menu_animation_ctx_tag;
|
||||
|
||||
typedef struct menu_animation_ctx_subject
|
||||
@ -141,9 +135,7 @@ void menu_animation_init(void);
|
||||
|
||||
void menu_animation_free(void);
|
||||
|
||||
bool menu_animation_update(float delta_time);
|
||||
|
||||
bool menu_animation_get_ideal_delta_time(menu_animation_ctx_delta_t *delta);
|
||||
bool menu_animation_update();
|
||||
|
||||
bool menu_animation_ticker(const menu_animation_ctx_ticker_t *ticker);
|
||||
|
||||
@ -163,6 +155,8 @@ float menu_animation_get_delta_time(void);
|
||||
|
||||
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
|
||||
|
||||
float menu_animation_get_ticker_time();
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -288,7 +288,7 @@ void menu_cbs_init(void *data,
|
||||
|
||||
int menu_cbs_exit(void);
|
||||
|
||||
void cb_generic_download(void *task_data,
|
||||
void cb_generic_download(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
@ -4138,7 +4138,7 @@ static void menu_displaylist_parse_playlist_generic(
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static void wifi_scan_callback(void *task_data,
|
||||
static void wifi_scan_callback(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
unsigned i;
|
||||
@ -4373,7 +4373,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||
FILE *profile = NULL;
|
||||
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
|
||||
|
||||
runloop_msg_queue_push("Warning : extended overclocking can damage the Switch", 1, 90, true);
|
||||
runloop_msg_queue_push("Warning : extended overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||
|
||||
@ -4425,7 +4425,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||
FILE *profile = NULL;
|
||||
const size_t profiles_count = sizeof(SWITCH_GPU_PROFILES)/sizeof(SWITCH_GPU_PROFILES[1]);
|
||||
|
||||
runloop_msg_queue_push("Warning : extented overclocking can damage the Switch", 1, 90, true);
|
||||
runloop_msg_queue_push("Warning : extented overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
profile = popen("gpu-profile get", "r");
|
||||
fgets(current_profile, PATH_MAX_LENGTH, profile);
|
||||
|
@ -44,6 +44,10 @@
|
||||
|
||||
#include "../gfx/video_driver.h"
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "widgets/menu_widgets.h"
|
||||
#endif
|
||||
|
||||
#include "menu_animation.h"
|
||||
#include "menu_driver.h"
|
||||
#include "menu_cbs.h"
|
||||
@ -464,6 +468,7 @@ font_data_t *menu_display_font(
|
||||
font_data_t *menu_display_font_file(char* fontpath, float menu_font_size, bool is_threaded)
|
||||
{
|
||||
font_data_t *font_data = NULL;
|
||||
|
||||
if (!menu_disp)
|
||||
return NULL;
|
||||
|
||||
@ -1252,7 +1257,7 @@ static bool menu_driver_load_image(menu_ctx_load_image_t *load_image_info)
|
||||
return false;
|
||||
}
|
||||
|
||||
void menu_display_handle_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
menu_ctx_load_image_t load_image_info;
|
||||
@ -1268,7 +1273,7 @@ void menu_display_handle_thumbnail_upload(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
void menu_display_handle_left_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_left_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
menu_ctx_load_image_t load_image_info;
|
||||
@ -1284,7 +1289,7 @@ void menu_display_handle_left_thumbnail_upload(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
void menu_display_handle_savestate_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_savestate_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
menu_ctx_load_image_t load_image_info;
|
||||
@ -1303,7 +1308,7 @@ void menu_display_handle_savestate_thumbnail_upload(void *task_data,
|
||||
/* Function that gets called when we want to load in a
|
||||
* new menu wallpaper.
|
||||
*/
|
||||
void menu_display_handle_wallpaper_upload(void *task_data,
|
||||
void menu_display_handle_wallpaper_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
menu_ctx_load_image_t load_image_info;
|
||||
@ -1574,6 +1579,10 @@ void menu_display_draw_text(
|
||||
{
|
||||
struct font_params params;
|
||||
|
||||
/* Don't draw is alpha is 0 */
|
||||
if ((color & 0x000000FF) == 0)
|
||||
return;
|
||||
|
||||
/* Don't draw outside of the screen */
|
||||
if ( ((x < -64 || x > width + 64)
|
||||
|| (y < -64 || y > height + 64))
|
||||
@ -1603,7 +1612,8 @@ void menu_display_draw_text(
|
||||
|
||||
bool menu_display_reset_textures_list(
|
||||
const char *texture_path, const char *iconpath,
|
||||
uintptr_t *item, enum texture_filter_type filter_type)
|
||||
uintptr_t *item, enum texture_filter_type filter_type,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
struct texture_image ti;
|
||||
char texpath[PATH_MAX_LENGTH] = {0};
|
||||
@ -1622,6 +1632,12 @@ bool menu_display_reset_textures_list(
|
||||
if (!image_texture_load(&ti, texpath))
|
||||
return false;
|
||||
|
||||
if (width)
|
||||
*width = ti.width;
|
||||
|
||||
if (height)
|
||||
*height = ti.height;
|
||||
|
||||
video_driver_texture_load(&ti,
|
||||
filter_type, item);
|
||||
image_texture_free(&ti);
|
||||
@ -1688,7 +1704,7 @@ const char *config_get_menu_driver_options(void)
|
||||
* when we need to extract the APK contents/zip file. This
|
||||
* file contains assets which then get extracted to the
|
||||
* user's asset directories. */
|
||||
static void bundle_decompressed(void *task_data,
|
||||
static void bundle_decompressed(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -1759,7 +1775,7 @@ static bool menu_init(menu_handle_t *menu_data)
|
||||
task_push_decompress(settings->arrays.bundle_assets_src,
|
||||
settings->arrays.bundle_assets_dst,
|
||||
NULL, settings->arrays.bundle_assets_dst_subdir,
|
||||
NULL, bundle_decompressed, NULL);
|
||||
NULL, bundle_decompressed, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1894,6 +1910,14 @@ void menu_driver_frame(video_frame_info_t *video_info)
|
||||
menu_driver_ctx->frame(menu_userdata, video_info);
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name)
|
||||
{
|
||||
return menu_driver_ctx && menu_driver_ctx->get_load_content_animation_data
|
||||
&& menu_driver_ctx->get_load_content_animation_data(menu_userdata, icon, playlist_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool menu_driver_render(bool is_idle, bool rarch_is_inited,
|
||||
bool rarch_is_dummy_core)
|
||||
{
|
||||
@ -1924,9 +1948,6 @@ bool menu_driver_render(bool is_idle, bool rarch_is_inited,
|
||||
|
||||
if (BIT64_GET(menu_driver_data->state, MENU_STATE_BLIT))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_animation_update_time(settings->bools.menu_timedate_enable);
|
||||
|
||||
if (menu_driver_ctx->render)
|
||||
menu_driver_ctx->render(menu_userdata, is_idle);
|
||||
}
|
||||
@ -2283,6 +2304,9 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
case RARCH_MENU_CTL_OWNS_DRIVER:
|
||||
return menu_driver_data_own;
|
||||
case RARCH_MENU_CTL_DEINIT:
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
menu_widgets_context_destroy();
|
||||
#endif
|
||||
if (menu_driver_ctx && menu_driver_ctx->context_destroy)
|
||||
menu_driver_ctx->context_destroy(menu_userdata);
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <boolean.h>
|
||||
#include <retro_common_api.h>
|
||||
#include <gfx/math/matrix_4x4.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include "menu_defines.h"
|
||||
#include "menu_input.h"
|
||||
@ -58,6 +59,19 @@ RETRO_BEGIN_DECLS
|
||||
#define MENU_SETTINGS_CHEEVOS_START 0x40000
|
||||
#define MENU_SETTINGS_NETPLAY_ROOMS_START 0x80000
|
||||
|
||||
#define COLOR_TEXT_ALPHA(color, alpha) (color & 0xFFFFFF00) | alpha
|
||||
|
||||
#define HEX_R(hex) ((hex >> 16) & 0xFF) * (1.0f / 255.0f)
|
||||
#define HEX_G(hex) ((hex >> 8 ) & 0xFF) * (1.0f / 255.0f)
|
||||
#define HEX_B(hex) ((hex >> 0 ) & 0xFF) * (1.0f / 255.0f)
|
||||
|
||||
#define COLOR_HEX_TO_FLOAT(hex, alpha) { \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha, \
|
||||
HEX_R(hex), HEX_G(hex), HEX_B(hex), alpha \
|
||||
}
|
||||
|
||||
extern float osk_dark[16];
|
||||
|
||||
enum menu_settings_type
|
||||
@ -374,6 +388,9 @@ typedef struct menu_ctx_driver
|
||||
int (*pointer_up)(void *data, unsigned x, unsigned y, unsigned ptr,
|
||||
menu_file_list_cbs_t *cbs,
|
||||
menu_entry_t *entry, unsigned action);
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
bool (*get_load_content_animation_data)(void *userdata, menu_texture_item *icon, char **playlist_name);
|
||||
#endif
|
||||
} menu_ctx_driver_t;
|
||||
|
||||
typedef struct menu_ctx_displaylist
|
||||
@ -479,6 +496,8 @@ void menu_driver_set_binding_state(bool on);
|
||||
|
||||
void menu_driver_frame(video_frame_info_t *video_info);
|
||||
|
||||
bool menu_driver_get_load_content_animation_data(menu_texture_item *icon, char **playlist_name);
|
||||
|
||||
/* Is a background texture set for the current menu driver? Should
|
||||
* return true for RGUI, for instance. */
|
||||
bool menu_driver_is_texture_set(void);
|
||||
@ -609,16 +628,16 @@ bool menu_display_get_tex_coords(menu_display_ctx_coord_draw_t *draw);
|
||||
|
||||
void menu_display_timedate(menu_display_ctx_datetime_t *datetime);
|
||||
|
||||
void menu_display_handle_wallpaper_upload(void *task_data,
|
||||
void menu_display_handle_wallpaper_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
void menu_display_handle_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
void menu_display_handle_left_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_left_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
void menu_display_handle_savestate_thumbnail_upload(void *task_data,
|
||||
void menu_display_handle_savestate_thumbnail_upload(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err);
|
||||
|
||||
void menu_display_push_quad(
|
||||
@ -652,10 +671,9 @@ font_data_t *menu_display_font(
|
||||
font_data_t *menu_display_font_file(char* fontpath, float font_size, bool is_threaded);
|
||||
|
||||
bool menu_display_reset_textures_list(
|
||||
const char *texture_path,
|
||||
const char *iconpath,
|
||||
uintptr_t *item,
|
||||
enum texture_filter_type filter_type);
|
||||
const char *texture_path, const char *iconpath,
|
||||
uintptr_t *item, enum texture_filter_type filter_type,
|
||||
unsigned *width, unsigned *height);
|
||||
|
||||
/* Returns the OSK key at a given position */
|
||||
int menu_display_osk_ptr_at_pos(void *data, int x, int y,
|
||||
|
@ -162,7 +162,6 @@ void menu_event_kb_set(bool down, enum retro_key key)
|
||||
*/
|
||||
unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||
{
|
||||
menu_animation_ctx_delta_t delta;
|
||||
/* Used for key repeat */
|
||||
static float delay_timer = 0.0f;
|
||||
static float delay_count = 0.0f;
|
||||
@ -198,7 +197,7 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||
* for old_input_state. */
|
||||
|
||||
first_held = true;
|
||||
delay_timer = initial_held ? 12 : 6;
|
||||
delay_timer = initial_held ? 200 : 100;
|
||||
delay_count = 0;
|
||||
}
|
||||
|
||||
@ -235,10 +234,7 @@ unsigned menu_event(input_bits_t *p_input, input_bits_t *p_trigger_input)
|
||||
menu_driver_ctl(MENU_NAVIGATION_CTL_SET_SCROLL_ACCEL,
|
||||
&new_scroll_accel);
|
||||
|
||||
delta.current = menu_animation_get_delta_time();
|
||||
|
||||
if (menu_animation_get_ideal_delta_time(&delta))
|
||||
delay_count += delta.ideal;
|
||||
delay_count += menu_animation_get_delta_time();
|
||||
|
||||
if (menu_input_dialog_get_display_kb())
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ void print_buf_lines(file_list_t *list, char *buf,
|
||||
* with a newline, just ignore the partial last line. */
|
||||
}
|
||||
|
||||
void cb_net_generic_subdir(void *task_data, void *user_data, const char *err)
|
||||
void cb_net_generic_subdir(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
char subdir_path[PATH_MAX_LENGTH];
|
||||
@ -222,7 +222,7 @@ finish:
|
||||
#endif
|
||||
}
|
||||
|
||||
void cb_net_generic(void *task_data, void *user_data, const char *err)
|
||||
void cb_net_generic(retro_task_t *task, void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
bool refresh = false;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <retro_common_api.h>
|
||||
#include <retro_environment.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include <lists/file_list.h>
|
||||
|
||||
@ -33,10 +34,10 @@ void print_buf_lines(file_list_t *list, char *buf,
|
||||
const char *label, int buf_size,
|
||||
enum msg_file_type type, bool append, bool extended);
|
||||
|
||||
void cb_net_generic_subdir(void *task_data, void *user_data,
|
||||
void cb_net_generic_subdir(retro_task_t *task, void *task_data, void *user_data,
|
||||
const char *err);
|
||||
|
||||
void cb_net_generic(void *task_data, void *user_data, const char *err);
|
||||
void cb_net_generic(retro_task_t *task, void *task_data, void *user_data, const char *err);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
@ -183,10 +183,12 @@ static int setting_action_ok_bind_all_save_autoconfig(rarch_setting_t *setting,
|
||||
|
||||
if(!string_is_empty(name) && config_save_autoconf_profile(name, index_offset))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true);
|
||||
msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_AUTOCONFIG_FILE_ERROR_SAVING), 1, 100, true);
|
||||
msg_hash_to_str(MSG_AUTOCONFIG_FILE_ERROR_SAVING), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
2068
menu/widgets/menu_widgets.c
Normal file
2068
menu/widgets/menu_widgets.c
Normal file
File diff suppressed because it is too large
Load Diff
74
menu/widgets/menu_widgets.h
Normal file
74
menu/widgets/menu_widgets.h
Normal file
@ -0,0 +1,74 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2018 - natinusala
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _MENU_WIDGETS_H
|
||||
#define _MENU_WIDGETS_H
|
||||
|
||||
#include "../../gfx/video_driver.h"
|
||||
|
||||
#include <queues/task_queue.h>
|
||||
#include <queues/message_queue.h>
|
||||
|
||||
#define DEFAULT_BACKDROP 0.75f
|
||||
|
||||
#define MSG_QUEUE_PENDING_MAX 32
|
||||
#define MSG_QUEUE_ONSCREEN_MAX 4
|
||||
|
||||
#define MSG_QUEUE_ANIMATION_DURATION 330
|
||||
#define VOLUME_DURATION 3000
|
||||
#define SCREENSHOT_DURATION_IN 66
|
||||
#define SCREENSHOT_DURATION_OUT SCREENSHOT_DURATION_IN*10
|
||||
#define SCREENSHOT_NOTIFICATION_DURATION 4000
|
||||
#define TASK_FINISHED_DURATION 3000
|
||||
#define HOURGLASS_INTERVAL 5000
|
||||
#define HOURGLASS_DURATION 1000
|
||||
|
||||
void menu_widgets_init(bool video_is_threaded);
|
||||
void menu_widgets_free();
|
||||
bool menu_widgets_ready();
|
||||
|
||||
bool menu_widgets_msg_queue_push(const char *msg,
|
||||
unsigned duration,
|
||||
char *title,
|
||||
enum message_queue_icon icon, enum message_queue_category category);
|
||||
|
||||
bool menu_widgets_volume_update_and_show();
|
||||
|
||||
bool menu_widgets_set_fps_text(char *fps_text);
|
||||
|
||||
void menu_widgets_iterate();
|
||||
|
||||
bool menu_widgets_set_paused(bool is_paused);
|
||||
bool menu_widgets_set_fast_forward(bool is_fast_forward);
|
||||
bool menu_widgets_set_rewind(bool is_rewind);
|
||||
|
||||
bool menu_widgets_task_msg_queue_push(retro_task_t *task);
|
||||
|
||||
void menu_widgets_take_screenshot();
|
||||
|
||||
void menu_widgets_screenshot_taken(const char *shotname, const char *filename);
|
||||
|
||||
void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension);
|
||||
void menu_widgets_cleanup_load_content_animation();
|
||||
|
||||
void menu_widgets_context_reset(bool is_threaded);
|
||||
void menu_widgets_context_destroy();
|
||||
|
||||
/* All the functions below should be called in
|
||||
* the video driver - once they are all added, set
|
||||
* enable_menu_widgets to true for that driver */
|
||||
void menu_widgets_frame(video_frame_info_t *video_info);
|
||||
|
||||
#endif
|
19
movie.c
19
movie.c
@ -293,7 +293,8 @@ bool bsv_movie_init(void)
|
||||
|
||||
bsv_movie_state.movie_playback = true;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK),
|
||||
2, 180, false);
|
||||
2, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s.\n", msg_hash_to_str(MSG_STARTING_MOVIE_PLAYBACK));
|
||||
|
||||
set_granularity = true;
|
||||
@ -312,13 +313,14 @@ bool bsv_movie_init(void)
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD),
|
||||
1, 180, true);
|
||||
1, 180, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s.\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD));
|
||||
return ret;
|
||||
}
|
||||
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
bsv_movie_state.movie_start_path);
|
||||
@ -441,7 +443,8 @@ void bsv_movie_deinit(void)
|
||||
static bool bsv_movie_check_movie_playback(void)
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED), 2, 180, false);
|
||||
msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED), 2, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_PLAYBACK_ENDED));
|
||||
|
||||
command_event(CMD_EVENT_BSV_MOVIE_DEINIT, NULL);
|
||||
@ -459,7 +462,8 @@ static bool runloop_check_movie_record(void)
|
||||
return false;
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED), 2, 180, true);
|
||||
msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED), 2, 180, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED));
|
||||
|
||||
command_event(CMD_EVENT_BSV_MOVIE_DEINIT, NULL);
|
||||
@ -497,13 +501,14 @@ static bool runloop_check_movie_init(void)
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD),
|
||||
2, 180, true);
|
||||
2, 180, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n",
|
||||
msg_hash_to_str(MSG_FAILED_TO_START_MOVIE_RECORD));
|
||||
return false;
|
||||
}
|
||||
|
||||
runloop_msg_queue_push(msg, 2, 180, true);
|
||||
runloop_msg_queue_push(msg, 2, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("%s \"%s\".\n",
|
||||
msg_hash_to_str(MSG_STARTING_MOVIE_RECORD_TO),
|
||||
path);
|
||||
|
@ -345,6 +345,7 @@ enum msg_hash_enums
|
||||
MSG_MOVIE_RECORD_STOPPED,
|
||||
MSG_MOVIE_PLAYBACK_ENDED,
|
||||
MSG_TAKING_SCREENSHOT,
|
||||
MSG_SCREENSHOT_SAVED,
|
||||
MSG_WIFI_SCAN_COMPLETE,
|
||||
MSG_SCANNING_WIRELESS_NETWORKS,
|
||||
MSG_FAILED_TO_TAKE_SCREENSHOT,
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <retro_assert.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <net/net_http.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
#include <discord/discord.h>
|
||||
@ -638,7 +639,7 @@ static int16_t netplay_input_state(netplay_t *netplay,
|
||||
}
|
||||
}
|
||||
|
||||
static void netplay_announce_cb(void *task_data, void *user_data, const char *error)
|
||||
static void netplay_announce_cb(retro_task_t *task, void *task_data, void *user_data, const char *error)
|
||||
{
|
||||
RARCH_LOG("[netplay] announcing netplay game... \n");
|
||||
|
||||
@ -963,7 +964,7 @@ bool netplay_command(netplay_t* netplay, struct netplay_connection *connection,
|
||||
if (!netplay_send_raw_cmd(netplay, connection, cmd, data, sz))
|
||||
return false;
|
||||
|
||||
runloop_msg_queue_push(success_msg, 1, 180, false);
|
||||
runloop_msg_queue_push(success_msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1481,7 +1482,8 @@ bool init_netplay(void *direct_host, const char *server, unsigned port)
|
||||
RARCH_LOG("[netplay] %s\n", msg_hash_to_str(MSG_WAITING_FOR_CLIENT));
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_WAITING_FOR_CLIENT),
|
||||
0, 180, false);
|
||||
0, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
if (settings->bools.netplay_public_announce)
|
||||
netplay_announce();
|
||||
@ -1514,7 +1516,8 @@ bool init_netplay(void *direct_host, const char *server, unsigned port)
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_NETPLAY_FAILED),
|
||||
0, 180, false);
|
||||
0, 180, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ bool netplay_handshake_init(netplay_t *netplay,
|
||||
/* We allow the connection but warn that this could cause issues. */
|
||||
dmsg = msg_hash_to_str(MSG_NETPLAY_DIFFERENT_VERSIONS);
|
||||
RARCH_WARN("%s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
/* We only care about platform magic if our core is quirky */
|
||||
@ -454,7 +454,7 @@ error:
|
||||
if (dmsg)
|
||||
{
|
||||
RARCH_ERR("%s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -488,7 +488,7 @@ static void netplay_handshake_ready(netplay_t *netplay,
|
||||
}
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
/* Unstall if we were waiting for this */
|
||||
if (netplay->stall == NETPLAY_STALL_NO_CONNECTION)
|
||||
@ -706,7 +706,7 @@ bool netplay_handshake_pre_nick(netplay_t *netplay,
|
||||
msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST),
|
||||
sizeof(msg));
|
||||
RARCH_ERR("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -779,7 +779,7 @@ bool netplay_handshake_pre_password(netplay_t *netplay,
|
||||
msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST),
|
||||
sizeof(msg));
|
||||
RARCH_ERR("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -885,7 +885,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
||||
/* Wrong core! */
|
||||
dmsg = msg_hash_to_str(MSG_NETPLAY_DIFFERENT_CORES);
|
||||
RARCH_ERR("%s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
/* FIXME: Should still send INFO, so the other side knows what's what */
|
||||
return false;
|
||||
}
|
||||
@ -894,7 +894,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
||||
{
|
||||
dmsg = msg_hash_to_str(MSG_NETPLAY_DIFFERENT_CORE_VERSIONS);
|
||||
RARCH_WARN("%s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -907,7 +907,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
||||
{
|
||||
dmsg = msg_hash_to_str(MSG_CONTENT_CRC32S_DIFFER);
|
||||
RARCH_WARN("%s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
|
||||
{
|
||||
const char *msg = msg_hash_to_str(MSG_NETPLAY_INCORRECT_PASSWORD);
|
||||
RARCH_ERR("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1069,7 +1069,7 @@ bool netplay_handshake_pre_sync(netplay_t *netplay,
|
||||
snprintf(msg, sizeof(msg),
|
||||
msg_hash_to_str(MSG_NETPLAY_CHANGED_NICK), netplay->nick);
|
||||
RARCH_LOG("%s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
/* Now check the SRAM */
|
||||
|
@ -118,7 +118,7 @@ void netplay_hangup(netplay_t *netplay, struct netplay_connection *connection)
|
||||
netplay->is_connected = false;
|
||||
}
|
||||
RARCH_LOG("[netplay] %s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
socket_close(connection->fd);
|
||||
connection->active = false;
|
||||
@ -636,7 +636,7 @@ static void announce_play_spectate(netplay_t *netplay,
|
||||
if (msg[0])
|
||||
{
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1469,7 +1469,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
||||
if (dmsg)
|
||||
{
|
||||
RARCH_LOG("[netplay] %s\n", dmsg);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false);
|
||||
runloop_msg_queue_push(dmsg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1775,7 +1775,7 @@ static bool netplay_get_cmd(netplay_t *netplay,
|
||||
snprintf(msg, sizeof(msg)-1, msg_hash_to_str(MSG_NETPLAY_PEER_PAUSED), nick);
|
||||
}
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2014,7 +2014,7 @@ void netplay_announce_nat_traversal(netplay_t *netplay)
|
||||
{
|
||||
snprintf(msg, sizeof(msg), "%s\n",
|
||||
msg_hash_to_str(MSG_UPNP_FAILED));
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
return;
|
||||
}
|
||||
@ -2022,7 +2022,7 @@ void netplay_announce_nat_traversal(netplay_t *netplay)
|
||||
snprintf(msg, sizeof(msg), "%s: %s:%s\n",
|
||||
msg_hash_to_str(MSG_PUBLIC_ADDRESS),
|
||||
host, port);
|
||||
runloop_msg_queue_push(msg, 1, 180, false);
|
||||
runloop_msg_queue_push(msg, 1, 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("[netplay] %s\n", msg);
|
||||
#endif
|
||||
}
|
||||
|
@ -496,6 +496,7 @@ if [ "$HAVE_MENU" != 'no' ]; then
|
||||
HAVE_OZONE=no
|
||||
HAVE_XMB=no
|
||||
HAVE_STRIPES=no
|
||||
HAVE_MENU_WIDGETS=no
|
||||
fi
|
||||
die : 'Notice: Hardware rendering context not available.'
|
||||
fi
|
||||
|
@ -9,6 +9,7 @@ HAVE_SIXEL=no # Libsixel support
|
||||
HAVE_DEBUG=no # Enable a debug build
|
||||
HAVE_LIBRETRODB=yes # Libretrodb support
|
||||
HAVE_MENU=yes # Enable menu drivers
|
||||
HAVE_MENU_WIDGETS=no # Enable menu widgets
|
||||
HAVE_RGUI=auto # RGUI menu
|
||||
HAVE_MATERIALUI=auto # MaterialUI menu
|
||||
HAVE_XMB=auto # XMB menu
|
||||
|
@ -280,7 +280,8 @@ void recording_dump_frame(const void *data, unsigned width,
|
||||
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_RECORDING_TERMINATED_DUE_TO_RESIZE),
|
||||
1, 180, true);
|
||||
1, 180, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
||||
return;
|
||||
}
|
||||
|
92
retroarch.c
92
retroarch.c
@ -60,7 +60,11 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "menu/menu_driver.h"
|
||||
#include "menu/menu_animation.h"
|
||||
#include "menu/menu_input.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#include "menu/widgets/menu_dialog.h"
|
||||
#include "menu/widgets/menu_input_dialog.h"
|
||||
#endif
|
||||
@ -1907,7 +1911,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
bool threaded_enable = false;
|
||||
#endif
|
||||
task_queue_deinit();
|
||||
task_queue_init(threaded_enable, runloop_msg_queue_push);
|
||||
task_queue_init(threaded_enable, runloop_task_msg_queue_push);
|
||||
}
|
||||
break;
|
||||
case RARCH_CTL_SET_CORE_SHUTDOWN:
|
||||
@ -2429,12 +2433,30 @@ global_t *global_get_ptr(void)
|
||||
return &g_extern;
|
||||
}
|
||||
|
||||
void runloop_msg_queue_push(const char *msg,
|
||||
void runloop_task_msg_queue_push(retro_task_t *task, const char *msg,
|
||||
unsigned prio, unsigned duration,
|
||||
bool flush)
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_task_msg_queue_push(task))
|
||||
#endif
|
||||
runloop_msg_queue_push(msg, prio, duration, flush, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
void runloop_msg_queue_push(const char *msg,
|
||||
unsigned prio, unsigned duration,
|
||||
bool flush,
|
||||
char *title,
|
||||
enum message_queue_icon icon, enum message_queue_category category)
|
||||
{
|
||||
runloop_ctx_msg_info_t msg_info;
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
/* People have 60FPS in mind when they use runloop_msg_queue_push */
|
||||
if (video_driver_has_widgets() && menu_widgets_msg_queue_push(msg, duration / 60 * 1000, title, icon, category))
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
runloop_msg_queue_lock();
|
||||
#endif
|
||||
@ -2450,7 +2472,8 @@ void runloop_msg_queue_push(const char *msg,
|
||||
if (runloop_msg_queue)
|
||||
{
|
||||
msg_queue_push(runloop_msg_queue, msg_info.msg,
|
||||
msg_info.prio, msg_info.duration);
|
||||
msg_info.prio, msg_info.duration,
|
||||
title, icon, category);
|
||||
|
||||
ui_companion_driver_msg_queue_push(msg_info.msg,
|
||||
msg_info.prio, msg_info.duration, msg_info.flush);
|
||||
@ -2808,7 +2831,13 @@ static enum runloop_state runloop_check_state(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#if defined(HAVE_MENU)
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
menu_widgets_iterate();
|
||||
#endif
|
||||
|
||||
menu_animation_update();
|
||||
|
||||
if (menu_is_alive)
|
||||
{
|
||||
enum menu_action action;
|
||||
@ -3223,8 +3252,17 @@ static enum runloop_state runloop_check_state(
|
||||
|
||||
/* Display the fast forward state to the user, if needed. */
|
||||
if (runloop_fastmotion)
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false);
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets() || !menu_widgets_set_fast_forward(true))
|
||||
#endif
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_FAST_FORWARD), 1, 1, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
else
|
||||
menu_widgets_set_fast_forward(false);
|
||||
#endif
|
||||
|
||||
old_button_state = new_button_state;
|
||||
old_hold_button_state = new_hold_button_state;
|
||||
@ -3266,7 +3304,7 @@ static enum runloop_state runloop_check_state(
|
||||
msg_hash_to_str(MSG_STATE_SLOT),
|
||||
settings->ints.state_slot);
|
||||
|
||||
runloop_msg_queue_push(msg, 2, 180, true);
|
||||
runloop_msg_queue_push(msg, 2, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
@ -3301,7 +3339,7 @@ static enum runloop_state runloop_check_state(
|
||||
if (cheevos_hardcore_active && cheevos_state_loaded_flag)
|
||||
{
|
||||
cheevos_hardcore_paused = true;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_DISABLED), 0, 180, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_DISABLED), 0, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
if (!cheevos_hardcore_active)
|
||||
@ -3309,12 +3347,23 @@ static enum runloop_state runloop_check_state(
|
||||
{
|
||||
char s[128];
|
||||
unsigned t = 0;
|
||||
bool rewinding = state_manager_check_rewind(BIT256_GET(current_input, RARCH_REWIND),
|
||||
settings->uints.rewind_granularity, runloop_paused, s, sizeof(s), &t);
|
||||
|
||||
s[0] = '\0';
|
||||
|
||||
if (state_manager_check_rewind(BIT256_GET(current_input, RARCH_REWIND),
|
||||
settings->uints.rewind_granularity, runloop_is_paused, s, sizeof(s), &t))
|
||||
runloop_msg_queue_push(s, 0, t, true);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets())
|
||||
#endif
|
||||
if (state_manager_check_rewind(BIT256_GET(current_input, RARCH_REWIND),
|
||||
settings->uints.rewind_granularity, runloop_is_paused, s, sizeof(s), &t))
|
||||
runloop_msg_queue_push(s, 0, t, true, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
menu_widgets_set_rewind(rewinding);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Checks if slowmotion toggle/hold was being pressed and/or held. */
|
||||
@ -3352,13 +3401,22 @@ static enum runloop_state runloop_check_state(
|
||||
video_driver_cached_frame();
|
||||
}
|
||||
|
||||
if (state_manager_frame_is_reversed())
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 1, 1, false);
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SLOW_MOTION), 1, 1, false);
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!video_driver_has_widgets())
|
||||
{
|
||||
#endif
|
||||
if (state_manager_frame_is_reversed())
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 1, 1, false, NULL,
|
||||
MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
else
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SLOW_MOTION), 1, 1, false,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
}
|
||||
#endif
|
||||
|
||||
old_slowmotion_button_state = new_slowmotion_button_state;
|
||||
old_slowmotion_hold_button_state = new_slowmotion_hold_button_state;
|
||||
|
14
retroarch.h
14
retroarch.h
@ -24,6 +24,9 @@
|
||||
#include <retro_common_api.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include <queues/task_queue.h>
|
||||
#include <queues/message_queue.h>
|
||||
|
||||
#include "core_type.h"
|
||||
#include "core.h"
|
||||
|
||||
@ -374,8 +377,15 @@ global_t *global_get_ptr(void);
|
||||
**/
|
||||
int runloop_iterate(unsigned *sleep_ms);
|
||||
|
||||
void runloop_msg_queue_push(const char *msg, unsigned prio,
|
||||
unsigned duration, bool flush);
|
||||
void runloop_task_msg_queue_push(retro_task_t *task, const char *msg,
|
||||
unsigned prio, unsigned duration,
|
||||
bool flush);
|
||||
|
||||
void runloop_msg_queue_push(const char *msg,
|
||||
unsigned prio, unsigned duration,
|
||||
bool flush,
|
||||
char *title,
|
||||
enum message_queue_icon icon, enum message_queue_category category);
|
||||
|
||||
bool runloop_msg_queue_pull(const char **ret);
|
||||
|
||||
|
@ -218,7 +218,7 @@ void run_ahead(int runahead_count, bool useSecondary)
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!settings->bools.run_ahead_hide_warnings)
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_CORE_DOES_NOT_SUPPORT_SAVESTATES), 0, 2 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_CORE_DOES_NOT_SUPPORT_SAVESTATES), 0, 2 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
core_run();
|
||||
runahead_force_input_dirty = true;
|
||||
@ -258,7 +258,7 @@ void run_ahead(int runahead_count, bool useSecondary)
|
||||
{
|
||||
if (!runahead_save_state())
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_SAVE_STATE), 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_SAVE_STATE), 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -267,7 +267,7 @@ void run_ahead(int runahead_count, bool useSecondary)
|
||||
{
|
||||
if (!runahead_load_state())
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_LOAD_STATE), 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_LOAD_STATE), 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -279,7 +279,7 @@ void run_ahead(int runahead_count, bool useSecondary)
|
||||
if (!secondary_core_ensure_exists())
|
||||
{
|
||||
runahead_secondary_core_available = false;
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_CREATE_SECONDARY_INSTANCE), 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_CREATE_SECONDARY_INSTANCE), 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
core_run();
|
||||
runahead_force_input_dirty = true;
|
||||
return;
|
||||
@ -296,13 +296,13 @@ void run_ahead(int runahead_count, bool useSecondary)
|
||||
|
||||
if (!runahead_save_state())
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_SAVE_STATE), 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_SAVE_STATE), 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!runahead_load_state_secondary())
|
||||
{
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_LOAD_STATE), 0, 3 * 60, true);
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_FAILED_TO_LOAD_STATE), 0, 3 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <compat/strl.h>
|
||||
#include <string/stdstring.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include "../audio/audio_driver.h"
|
||||
|
||||
@ -74,7 +75,7 @@ static void task_audio_mixer_load_free(retro_task_t *task)
|
||||
}
|
||||
|
||||
if (mixer->cb)
|
||||
mixer->cb(NULL, NULL, NULL);
|
||||
mixer->cb(task, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if (!string_is_empty(nbio->path))
|
||||
@ -104,7 +105,7 @@ static int cb_nbio_audio_mixer_load(void *data, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_ogg(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_ogg(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -134,7 +135,7 @@ static void task_audio_mixer_handle_upload_ogg(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_ogg_and_play(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_ogg_and_play(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -165,7 +166,7 @@ static void task_audio_mixer_handle_upload_ogg_and_play(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_flac(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_flac(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -196,7 +197,7 @@ static void task_audio_mixer_handle_upload_flac(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_flac_and_play(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_flac_and_play(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -227,7 +228,7 @@ static void task_audio_mixer_handle_upload_flac_and_play(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_mp3(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_mp3(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -258,7 +259,7 @@ static void task_audio_mixer_handle_upload_mp3(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_mp3_and_play(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_mp3_and_play(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -289,7 +290,7 @@ static void task_audio_mixer_handle_upload_mp3_and_play(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_mod(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_mod(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -320,7 +321,7 @@ static void task_audio_mixer_handle_upload_mod(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_mod_and_play(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_mod_and_play(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -351,7 +352,7 @@ static void task_audio_mixer_handle_upload_mod_and_play(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_wav(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_wav(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -382,7 +383,7 @@ static void task_audio_mixer_handle_upload_wav(void *task_data,
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void task_audio_mixer_handle_upload_wav_and_play(void *task_data,
|
||||
static void task_audio_mixer_handle_upload_wav_and_play(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *err)
|
||||
{
|
||||
audio_mixer_stream_params_t params;
|
||||
@ -452,7 +453,7 @@ bool task_push_audio_mixer_load_and_play(
|
||||
{
|
||||
nbio_handle_t *nbio = NULL;
|
||||
struct audio_mixer_handle *mixer = NULL;
|
||||
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
retro_task_t *t = task_init();
|
||||
struct audio_mixer_userdata *user = (struct audio_mixer_userdata*)calloc(1, sizeof(*user));
|
||||
|
||||
if (!t || !user)
|
||||
@ -560,7 +561,7 @@ bool task_push_audio_mixer_load(
|
||||
{
|
||||
nbio_handle_t *nbio = NULL;
|
||||
struct audio_mixer_handle *mixer = NULL;
|
||||
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
retro_task_t *t = task_init();
|
||||
struct audio_mixer_userdata *user = (struct audio_mixer_userdata*)calloc(1, sizeof(*user));
|
||||
|
||||
if (!t || !user)
|
||||
|
@ -237,8 +237,12 @@ static void input_autoconfigure_joypad_add(config_file_t *conf,
|
||||
/* This will be the case if input driver is reinitialized.
|
||||
* No reason to spam autoconfigure messages every time. */
|
||||
bool block_osd_spam =
|
||||
#if defined(HAVE_LIBNX) && defined(HAVE_MENU_WIDGETS)
|
||||
true;
|
||||
#else
|
||||
input_autoconfigured[params->idx]
|
||||
&& !string_is_empty(params->name);
|
||||
#endif
|
||||
|
||||
msg[0] = display_name[0] = device_type[0] = '\0';
|
||||
|
||||
@ -651,7 +655,7 @@ found:
|
||||
if (hDeviceHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
RARCH_ERR("[Autoconf]: Can't open device for reading and writing: %d.", GetLastError());
|
||||
runloop_msg_queue_push("Bliss-Box already in use. Please make sure other programs are not using it.", 2, 300, false);
|
||||
runloop_msg_queue_push("Bliss-Box already in use. Please make sure other programs are not using it.", 2, 300, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -910,7 +914,7 @@ static void input_autoconfigure_disconnect_handler(retro_task_t *task)
|
||||
bool input_autoconfigure_disconnect(unsigned i, const char *ident)
|
||||
{
|
||||
char msg[255];
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
autoconfig_disconnect_t *state = (autoconfig_disconnect_t*)calloc(1, sizeof(*state));
|
||||
|
||||
if (!state || !task)
|
||||
@ -987,7 +991,7 @@ bool input_autoconfigure_connect(
|
||||
unsigned pid)
|
||||
{
|
||||
unsigned i;
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
autoconfig_params_t *state = (autoconfig_params_t*)calloc(1, sizeof(*state));
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_autoconf = settings ? settings->paths.directory_autoconfig : NULL;
|
||||
|
@ -65,6 +65,9 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../menu/menu_driver.h"
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
#include "../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../menu/menu_shader.h"
|
||||
@ -159,6 +162,11 @@ static char pending_subsystem_extensions[PATH_MAX_LENGTH];
|
||||
#endif
|
||||
static char *pending_subsystem_roms[RARCH_MAX_SUBSYSTEM_ROMS];
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
static bool pending_load_content_pending = false;
|
||||
static bool pending_load_content_resume = false;
|
||||
#endif
|
||||
|
||||
static int64_t content_file_read(const char *path, void **buf, int64_t *length)
|
||||
{
|
||||
#ifdef HAVE_COMPRESSION
|
||||
@ -1141,7 +1149,7 @@ static bool firmware_update_status(
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_FIRMWARE),
|
||||
100, 500, true);
|
||||
100, 500, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_LOG("Load content blocked. Reason: %s\n",
|
||||
msg_hash_to_str(MSG_FIRMWARE));
|
||||
|
||||
@ -1219,7 +1227,7 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
||||
{
|
||||
if (error_string)
|
||||
{
|
||||
runloop_msg_queue_push(error_string, 2, 90, true);
|
||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
free(error_string);
|
||||
}
|
||||
@ -1240,6 +1248,28 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
bool task_load_content_is_pending()
|
||||
{
|
||||
return pending_load_content_pending;
|
||||
}
|
||||
|
||||
bool task_load_content_should_resume()
|
||||
{
|
||||
/* Avoid having one menu frame before running content
|
||||
once the animation is finished */
|
||||
if (pending_load_content_resume)
|
||||
menu_widgets_cleanup_load_content_animation();
|
||||
|
||||
return pending_load_content_resume;
|
||||
}
|
||||
|
||||
void task_load_content_resume()
|
||||
{
|
||||
pending_load_content_resume = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool task_push_load_content_from_playlist_from_menu(
|
||||
const char *core_path,
|
||||
const char *fullpath,
|
||||
@ -1256,6 +1286,23 @@ bool task_push_load_content_from_playlist_from_menu(
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *sys_info = runloop_get_system_info();
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
|
||||
{
|
||||
pending_load_content_pending = true;
|
||||
|
||||
if (label)
|
||||
menu_widgets_start_load_content_animation(label, false);
|
||||
else
|
||||
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
pending_load_content_resume = false;
|
||||
pending_load_content_pending = false;
|
||||
#endif
|
||||
|
||||
content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
||||
content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL);
|
||||
content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL);
|
||||
@ -1310,7 +1357,7 @@ bool task_push_load_content_from_playlist_from_menu(
|
||||
{
|
||||
if (error_string)
|
||||
{
|
||||
runloop_msg_queue_push(error_string, 2, 90, true);
|
||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
free(error_string);
|
||||
}
|
||||
@ -1410,7 +1457,7 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
||||
{
|
||||
if (error_string)
|
||||
{
|
||||
runloop_msg_queue_push(error_string, 2, 90, true);
|
||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
free(error_string);
|
||||
}
|
||||
@ -1482,6 +1529,18 @@ bool task_push_load_content_with_new_core_from_menu(
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
|
||||
{
|
||||
pending_load_content_pending = true;
|
||||
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
pending_load_content_resume = false;
|
||||
pending_load_content_pending = false;
|
||||
#endif
|
||||
|
||||
content_ctx.check_firmware_before_loading = settings->bools.check_firmware_before_loading;
|
||||
content_ctx.is_ips_pref = rarch_ctl(RARCH_CTL_IS_IPS_PREF, NULL);
|
||||
content_ctx.is_bps_pref = rarch_ctl(RARCH_CTL_IS_BPS_PREF, NULL);
|
||||
@ -1540,7 +1599,7 @@ bool task_push_load_content_with_new_core_from_menu(
|
||||
{
|
||||
if (error_string)
|
||||
{
|
||||
runloop_msg_queue_push(error_string, 2, 90, true);
|
||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
free(error_string);
|
||||
}
|
||||
@ -1669,7 +1728,7 @@ end:
|
||||
{
|
||||
if (error_string)
|
||||
{
|
||||
runloop_msg_queue_push(error_string, 2, 90, true);
|
||||
runloop_msg_queue_push(error_string, 2, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
free(error_string);
|
||||
}
|
||||
@ -1771,6 +1830,18 @@ bool task_push_load_content_with_current_core_from_companion_ui(
|
||||
retro_task_callback_t cb,
|
||||
void *user_data)
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
|
||||
{
|
||||
pending_load_content_pending = true;
|
||||
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
pending_load_content_resume = false;
|
||||
pending_load_content_pending = false;
|
||||
#endif
|
||||
|
||||
/* Set content path */
|
||||
path_set(RARCH_PATH_CONTENT, fullpath);
|
||||
|
||||
@ -1820,6 +1891,17 @@ bool task_push_load_subsystem_with_core_from_menu(
|
||||
retro_task_callback_t cb,
|
||||
void *user_data)
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (video_driver_has_widgets() && menu_widgets_ready() && !pending_load_content_resume)
|
||||
{
|
||||
pending_load_content_pending = true;
|
||||
menu_widgets_start_load_content_animation(path_basename(fullpath), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
pending_load_content_resume = false;
|
||||
pending_load_content_pending = false;
|
||||
#endif
|
||||
|
||||
pending_subsystem_init = true;
|
||||
|
||||
@ -2112,7 +2194,7 @@ bool content_init(void)
|
||||
{
|
||||
RARCH_ERR("%s\n", error_string);
|
||||
}
|
||||
runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, true);
|
||||
runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
free(error_string);
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,10 @@ bool task_push_load_content_with_new_core_from_companion_ui(
|
||||
void *user_data);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
bool task_load_content_is_pending();
|
||||
bool task_load_content_should_resume();
|
||||
void task_load_content_resume();
|
||||
|
||||
bool task_push_load_content_with_new_core_from_menu(
|
||||
const char *core_path,
|
||||
const char *fullpath,
|
||||
|
@ -148,7 +148,7 @@ static int task_database_iterate_start(database_info_handle_t *db,
|
||||
if (!string_is_empty(msg))
|
||||
{
|
||||
#ifdef RARCH_INTERNAL
|
||||
runloop_msg_queue_push(msg, 1, 180, true);
|
||||
runloop_msg_queue_push(msg, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#else
|
||||
fprintf(stderr, "msg: %s\n", msg);
|
||||
#endif
|
||||
@ -1260,7 +1260,7 @@ static void task_database_handler(retro_task_t *task)
|
||||
else
|
||||
msg = msg_hash_to_str(MSG_SCANNING_OF_FILE_FINISHED);
|
||||
#ifdef RARCH_INTERNAL
|
||||
runloop_msg_queue_push(msg, 0, 180, true);
|
||||
runloop_msg_queue_push(msg, 0, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
#else
|
||||
fprintf(stderr, "msg: %s\n", msg);
|
||||
#endif
|
||||
@ -1313,7 +1313,7 @@ bool task_push_dbscan(
|
||||
bool db_dir_show_hidden_files,
|
||||
retro_task_callback_t cb)
|
||||
{
|
||||
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
retro_task_t *t = task_init();
|
||||
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
|
||||
|
||||
if (!t || !db)
|
||||
|
@ -271,7 +271,8 @@ bool task_push_decompress(
|
||||
const char *subdir,
|
||||
const char *valid_ext,
|
||||
retro_task_callback_t cb,
|
||||
void *user_data)
|
||||
void *user_data,
|
||||
void *frontend_userdata)
|
||||
{
|
||||
char tmp[PATH_MAX_LENGTH];
|
||||
const char *ext = NULL;
|
||||
@ -334,11 +335,13 @@ bool task_push_decompress(
|
||||
s->archive.type = ARCHIVE_TRANSFER_INIT;
|
||||
s->userdata = (struct archive_extract_userdata*)calloc(1, sizeof(*s->userdata));
|
||||
|
||||
t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
t = task_init();
|
||||
|
||||
if (!t)
|
||||
goto error;
|
||||
|
||||
t->frontend_userdata = frontend_userdata;
|
||||
|
||||
t->state = s;
|
||||
t->handler = task_decompress_handler;
|
||||
|
||||
|
@ -265,7 +265,7 @@ static void* task_push_http_transfer_generic(
|
||||
/* Concurrent download of the same file is not allowed */
|
||||
if (task_queue_find(&find_data))
|
||||
{
|
||||
RARCH_LOG("[http] '%s'' is already being downloaded.\n", url);
|
||||
RARCH_LOG("[http] '%s' is already being downloaded.\n", url);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ static void* task_push_http_transfer_generic(
|
||||
strlcpy(http->connection.url, url, sizeof(http->connection.url));
|
||||
|
||||
http->status = HTTP_STATUS_CONNECTION_TRANSFER;
|
||||
t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
t = task_init();
|
||||
|
||||
if (!t)
|
||||
goto error;
|
||||
|
@ -291,7 +291,7 @@ bool task_push_image_load(const char *fullpath, retro_task_callback_t cb, void *
|
||||
{
|
||||
nbio_handle_t *nbio = NULL;
|
||||
struct nbio_image_handle *image = NULL;
|
||||
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
retro_task_t *t = task_init();
|
||||
|
||||
if (!t)
|
||||
goto error_msg;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
#include <lists/dir_list.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include "task_content.h"
|
||||
#include "tasks_internal.h"
|
||||
@ -53,7 +54,7 @@ typedef struct
|
||||
struct string_list *lpl_list;
|
||||
} netplay_crc_handle_t;
|
||||
|
||||
static void netplay_crc_scan_callback(void *task_data,
|
||||
static void netplay_crc_scan_callback(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
netplay_crc_handle_t *state = (netplay_crc_handle_t*)task_data;
|
||||
@ -144,7 +145,8 @@ static void netplay_crc_scan_callback(void *task_data,
|
||||
string_is_empty(state->content_path) ? "content file" : "core");
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_LOAD_CONTENT_MANUALLY),
|
||||
1, 480, true);
|
||||
1, 480, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
|
||||
free(state);
|
||||
@ -403,8 +405,7 @@ bool task_push_netplay_crc_scan(uint32_t crc, char* name,
|
||||
struct string_list *lpl_list = NULL;
|
||||
core_info_list_t *info = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
retro_task_t *task = (retro_task_t *)
|
||||
calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
netplay_crc_handle_t *state = (netplay_crc_handle_t*)
|
||||
calloc(1, sizeof(*state));
|
||||
|
||||
|
@ -46,7 +46,7 @@ static void task_netplay_lan_scan_handler(retro_task_t *task)
|
||||
|
||||
bool task_push_netplay_lan_scan(retro_task_callback_t cb)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
|
||||
if (!task)
|
||||
return false;
|
||||
@ -63,7 +63,7 @@ bool task_push_netplay_lan_scan(retro_task_callback_t cb)
|
||||
|
||||
bool task_push_netplay_lan_scan_rooms(retro_task_callback_t cb)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
|
||||
if (!task)
|
||||
return false;
|
||||
|
@ -35,7 +35,7 @@ struct nat_traversal_state_data
|
||||
uint16_t port;
|
||||
};
|
||||
|
||||
static void netplay_nat_traversal_callback(void *task_data,
|
||||
static void netplay_nat_traversal_callback(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
struct nat_traversal_state_data *ntsd =
|
||||
@ -65,7 +65,7 @@ bool task_push_netplay_nat_traversal(void *nat_traversal_state, uint16_t port)
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
struct nat_traversal_state_data *ntsd;
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
|
||||
if (!task)
|
||||
return false;
|
||||
|
@ -775,7 +775,7 @@ bool task_push_overlay_load_default(
|
||||
loader->state = OVERLAY_STATUS_DEFERRED_LOAD;
|
||||
loader->pos_increment = (loader->size / 4) ? (loader->size / 4) : 4;
|
||||
|
||||
t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||
t = task_init();
|
||||
|
||||
if (!t)
|
||||
goto error;
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "../../frontend/frontend_driver.h"
|
||||
#include "tasks_internal.h"
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
static int power_percent = 0;
|
||||
static enum frontend_powerstate state = FRONTEND_POWERSTATE_NONE;
|
||||
@ -38,7 +39,7 @@ enum frontend_powerstate get_last_powerstate(int *percent)
|
||||
return state;
|
||||
}
|
||||
|
||||
static void task_powerstate_cb(void *task_data,
|
||||
static void task_powerstate_cb(retro_task_t* task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
powerstate_t *powerstate = (powerstate_t*)task_data;
|
||||
@ -66,7 +67,7 @@ static void task_powerstate_handler(retro_task_t *task)
|
||||
|
||||
void task_push_get_powerstate(void)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
powerstate_t *state = NULL;
|
||||
|
||||
if (!task)
|
||||
|
@ -507,7 +507,7 @@ bool content_undo_load_state(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void undo_save_state_cb(void *task_data,
|
||||
static void undo_save_state_cb(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
/* Wipe the save file buffer as it's intended to be one use only */
|
||||
@ -691,7 +691,7 @@ static void task_save_handler(retro_task_t *task)
|
||||
**/
|
||||
static bool task_push_undo_save_state(const char *path, void *data, size_t size)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -892,7 +892,7 @@ error:
|
||||
* Load a state from disk to memory.
|
||||
*
|
||||
**/
|
||||
static void content_load_state_cb(void *task_data,
|
||||
static void content_load_state_cb(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
retro_ctx_serialize_info_t serial_info;
|
||||
@ -1041,7 +1041,7 @@ error:
|
||||
*
|
||||
* Called after the save state is done. Takes a screenshot if needed.
|
||||
**/
|
||||
static void save_state_cb(void *task_data,
|
||||
static void save_state_cb(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
save_task_state_t *state = (save_task_state_t*)task_data;
|
||||
@ -1063,7 +1063,7 @@ static void save_state_cb(void *task_data,
|
||||
**/
|
||||
static void task_push_save_state(const char *path, void *data, size_t size, bool autosave)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -1105,7 +1105,7 @@ error:
|
||||
* Load then save a state.
|
||||
*
|
||||
**/
|
||||
static void content_load_and_save_state_cb(void *task_data,
|
||||
static void content_load_and_save_state_cb(retro_task_t *task, void *task_data,
|
||||
void *user_data, const char *error)
|
||||
{
|
||||
load_task_data_t *load_data = (load_task_data_t*)task_data;
|
||||
@ -1114,7 +1114,7 @@ static void content_load_and_save_state_cb(void *task_data,
|
||||
size_t size = load_data->undo_size;
|
||||
bool autosave = load_data->autosave;
|
||||
|
||||
content_load_state_cb(task_data, user_data, error);
|
||||
content_load_state_cb(NULL, task_data, user_data, error);
|
||||
|
||||
task_push_save_state(path, data, size, autosave);
|
||||
|
||||
@ -1134,7 +1134,7 @@ static void content_load_and_save_state_cb(void *task_data,
|
||||
static void task_push_load_and_save_state(const char *path, void *data,
|
||||
size_t size, bool load_to_backup_buffer, bool autosave)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -1279,7 +1279,7 @@ bool content_save_state(const char *path, bool save_to_disk, bool autosave)
|
||||
bool content_load_state(const char *path,
|
||||
bool load_to_backup_buffer, bool autoload)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
#define IMG_EXT "bmp"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
#include "../../menu/widgets/menu_widgets.h"
|
||||
#endif
|
||||
|
||||
#include "../defaults.h"
|
||||
#include "../command.h"
|
||||
#include "../configuration.h"
|
||||
@ -70,6 +74,7 @@ struct screenshot_task_state
|
||||
uint8_t *out_buffer;
|
||||
const void *frame;
|
||||
char filename[PATH_MAX_LENGTH];
|
||||
char shotname[256];
|
||||
void *userbuf;
|
||||
struct scaler_ctx scaler;
|
||||
};
|
||||
@ -124,6 +129,11 @@ static bool screenshot_dump_direct(screenshot_task_state_t *state)
|
||||
bmp_type);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!state->silence)
|
||||
menu_widgets_screenshot_taken(state->shotname, state->filename);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -169,7 +179,7 @@ static void task_screenshot_handler(retro_task_t *task)
|
||||
if (!ret)
|
||||
{
|
||||
char *msg = strdup(msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT));
|
||||
runloop_msg_queue_push(msg, 1, state->is_paused ? 1 : 180, true);
|
||||
runloop_msg_queue_push(msg, 1, state->is_paused ? 1 : 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
free(msg);
|
||||
}
|
||||
}
|
||||
@ -190,14 +200,13 @@ static bool screenshot_dump(
|
||||
char screenshot_path[PATH_MAX_LENGTH];
|
||||
uint8_t *buf = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
screenshot_task_state_t *state = (screenshot_task_state_t*)
|
||||
calloc(1, sizeof(*state));
|
||||
const char *screenshot_dir = settings->paths.directory_screenshot;
|
||||
char shotname[256];
|
||||
struct retro_system_info system_info;
|
||||
|
||||
shotname[0] = '\0';
|
||||
state->shotname[0] = '\0';
|
||||
screenshot_path[0] = '\0';
|
||||
|
||||
if (!core_get_system_info(&system_info))
|
||||
@ -249,15 +258,15 @@ static bool screenshot_dump(
|
||||
else
|
||||
screenshot_name = path_basename(name_base);
|
||||
|
||||
fill_str_dated_filename(shotname, screenshot_name,
|
||||
IMG_EXT, sizeof(shotname));
|
||||
fill_str_dated_filename(state->shotname, screenshot_name,
|
||||
IMG_EXT, sizeof(state->shotname));
|
||||
}
|
||||
else
|
||||
snprintf(shotname, sizeof(shotname),
|
||||
snprintf(state->shotname, sizeof(state->shotname),
|
||||
"%s.png", path_basename(name_base));
|
||||
|
||||
fill_pathname_join(state->filename, screenshot_dir,
|
||||
shotname, sizeof(state->filename));
|
||||
state->shotname, sizeof(state->filename));
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,6 +288,11 @@ static bool screenshot_dump(
|
||||
|
||||
if (use_thread)
|
||||
{
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (video_driver_has_widgets())
|
||||
task_free_title(task);
|
||||
else
|
||||
#endif
|
||||
if (!savestate)
|
||||
task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT));
|
||||
|
||||
@ -415,6 +429,11 @@ bool take_screenshot(const char *name_base, bool silence, bool has_valid_framebu
|
||||
bool is_perfcnt_enable = false;
|
||||
bool ret = false;
|
||||
|
||||
#if defined(HAVE_MENU) && defined(HAVE_MENU_WIDGETS)
|
||||
if (!silence)
|
||||
menu_widgets_take_screenshot();
|
||||
#endif
|
||||
|
||||
runloop_get_status(&is_paused, &is_idle, &is_slowmotion, &is_perfcnt_enable);
|
||||
|
||||
ret = take_screenshot_choice(name_base, silence, is_paused, is_idle,
|
||||
|
@ -38,7 +38,7 @@ static void task_wifi_scan_handler(retro_task_t *task)
|
||||
|
||||
bool task_push_wifi_scan(retro_task_callback_t cb)
|
||||
{
|
||||
retro_task_t *task = (retro_task_t *)calloc(1, sizeof(*task));
|
||||
retro_task_t *task = task_init();
|
||||
|
||||
if (!task)
|
||||
return false;
|
||||
|
@ -84,7 +84,8 @@ bool task_push_decompress(
|
||||
const char *subdir,
|
||||
const char *valid_ext,
|
||||
retro_task_callback_t cb,
|
||||
void *user_data);
|
||||
void *user_data,
|
||||
void *frontend_userdata);
|
||||
|
||||
void task_file_load_handler(retro_task_t *task);
|
||||
|
||||
|
@ -3131,7 +3131,7 @@ int MainWindow::onExtractArchive(QString path, QString extractionDir, QString te
|
||||
|
||||
if (!task_push_decompress(file, dir,
|
||||
NULL, NULL, NULL,
|
||||
cb, this))
|
||||
cb, this, NULL))
|
||||
{
|
||||
m_updateProgressDialog->cancel();
|
||||
return -1;
|
||||
|
@ -62,7 +62,7 @@ static void connmanctl_scan(void)
|
||||
|
||||
pclose(popen("connmanctl scan wifi", "r"));
|
||||
|
||||
runloop_msg_queue_push("Wi-Fi scan complete.", 1, 180, true);
|
||||
runloop_msg_queue_push("Wi-Fi scan complete.", 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
|
||||
serv_file = popen("connmanctl services", "r");
|
||||
while (fgets (line, 512, serv_file) != NULL)
|
||||
@ -214,7 +214,7 @@ static bool connmanctl_connect_ssid(unsigned i, const char* passphrase)
|
||||
|
||||
while (fgets (ln, 512, command_file) != NULL)
|
||||
{
|
||||
runloop_msg_queue_push(ln, 1, 180, true);
|
||||
runloop_msg_queue_push(ln, 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
}
|
||||
pclose(command_file);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user