mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
Pass content_ctx_info_t pointer to rarch_task_push_content
This commit is contained in:
parent
81f669ca61
commit
f70dc77a61
@ -459,6 +459,7 @@ static int file_load_with_detect_core_wrapper(size_t idx, size_t entry_idx,
|
||||
{
|
||||
menu_content_ctx_defer_info_t def_info;
|
||||
char menu_path_new[PATH_MAX_LENGTH];
|
||||
content_ctx_info_t content_info = {0};
|
||||
int ret = 0;
|
||||
const char *menu_path = NULL;
|
||||
const char *menu_label = NULL;
|
||||
@ -509,7 +510,7 @@ static int file_load_with_detect_core_wrapper(size_t idx, size_t entry_idx,
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
|
||||
rarch_task_push_content_load_default(NULL, NULL,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false, &content_info, CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
return 0;
|
||||
@ -555,8 +556,9 @@ static int action_ok_file_load_with_detect_core(const char *path,
|
||||
static int action_ok_file_load_detect_core(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
rarch_task_push_content_load_default(path, detect_content_path,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false, &content_info, CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
|
||||
@ -750,7 +752,7 @@ static int generic_action_ok(const char *path,
|
||||
flush_type = 49;
|
||||
if (path_file_exists(action_path))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
strlcpy(settings->path.menu_wallpaper,
|
||||
action_path, sizeof(settings->path.menu_wallpaper));
|
||||
@ -1129,13 +1131,15 @@ static int action_ok_core_deferred_set(const char *path,
|
||||
static int action_ok_core_load_deferred(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_handle_t *menu = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
menu_handle_t *menu = NULL;
|
||||
|
||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||
return menu_cbs_exit();
|
||||
|
||||
rarch_task_push_content_load_default(path, menu->deferred_path,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
@ -1155,6 +1159,7 @@ static int generic_action_ok_file_load(const char *path,
|
||||
enum rarch_core_type action_type, unsigned id)
|
||||
{
|
||||
char new_path[PATH_MAX_LENGTH];
|
||||
content_ctx_info_t content_info = {0};
|
||||
const char *menu_path = NULL;
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||
|
||||
@ -1167,13 +1172,17 @@ static int generic_action_ok_file_load(const char *path,
|
||||
{
|
||||
case ACTION_OK_FFMPEG:
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, new_path, true, action_type,
|
||||
NULL, new_path, true,
|
||||
&content_info,
|
||||
action_type,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
break;
|
||||
case ACTION_OK_IMAGEVIEWER:
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, new_path, true, action_type,
|
||||
NULL, new_path, true,
|
||||
&content_info,
|
||||
action_type,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
break;
|
||||
@ -1209,6 +1218,7 @@ static int action_ok_file_load(const char *path,
|
||||
const char *menu_path = NULL;
|
||||
rarch_setting_t *setting = NULL;
|
||||
menu_handle_t *menu = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||
|
||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||
@ -1243,7 +1253,9 @@ static int action_ok_file_load(const char *path,
|
||||
|
||||
rarch_task_push_content_load_default(NULL,
|
||||
full_path_new,
|
||||
true, CORE_TYPE_PLAIN,
|
||||
true,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
|
||||
@ -2048,8 +2060,9 @@ static int action_ok_start_core(const char *path,
|
||||
/* No content needed for this core, load core immediately. */
|
||||
if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL))
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
rarch_task_push_content_load_default(NULL, NULL,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false, &content_info, CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
}
|
||||
@ -2116,9 +2129,10 @@ static int action_ok_open_archive(const char *path,
|
||||
static int action_ok_load_archive(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_handle_t *menu = NULL;
|
||||
const char *menu_path = NULL;
|
||||
const char *content_path = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
menu_handle_t *menu = NULL;
|
||||
const char *menu_path = NULL;
|
||||
const char *content_path = NULL;
|
||||
|
||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||
return menu_cbs_exit();
|
||||
@ -2131,7 +2145,8 @@ static int action_ok_load_archive(const char *path,
|
||||
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, detect_content_path, false, CORE_TYPE_PLAIN,
|
||||
NULL, detect_content_path, false,
|
||||
&content_info, CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
|
||||
@ -2142,6 +2157,7 @@ static int action_ok_load_archive_detect_core(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_content_ctx_defer_info_t def_info;
|
||||
content_ctx_info_t content_info = {0};
|
||||
int ret = 0;
|
||||
core_info_list_t *list = NULL;
|
||||
menu_handle_t *menu = NULL;
|
||||
@ -2177,7 +2193,9 @@ static int action_ok_load_archive_detect_core(const char *path,
|
||||
case -1:
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
rarch_task_push_content_load_default(NULL, NULL,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
return 0;
|
||||
|
@ -796,8 +796,12 @@ static int zarch_zui_render_sidebar(zui_t *zui)
|
||||
|
||||
static int zarch_zui_load_content(zui_t *zui, unsigned i)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
|
||||
rarch_task_push_content_load_default(zui->pick_cores[i].path,
|
||||
zui->pick_content, false, CORE_TYPE_PLAIN,
|
||||
zui->pick_content, false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU,
|
||||
NULL, NULL);
|
||||
|
||||
|
@ -51,6 +51,7 @@ static bool menu_content_load_from_playlist(void *data)
|
||||
playlist_t *playlist = NULL;
|
||||
const char *core_path = NULL;
|
||||
const char *path = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
menu_content_ctx_playlist_info_t *info =
|
||||
(menu_content_ctx_playlist_info_t *)data;
|
||||
|
||||
@ -99,6 +100,7 @@ static bool menu_content_load_from_playlist(void *data)
|
||||
core_path,
|
||||
path,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU,
|
||||
NULL,
|
||||
|
@ -738,6 +738,7 @@ static bool runloop_is_frame_count_end(void)
|
||||
|
||||
bool runloop_prepare_dummy(void)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
memset(&runloop_frame_time, 0, sizeof(struct retro_frame_time_callback));
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT, NULL);
|
||||
@ -748,7 +749,9 @@ bool runloop_prepare_dummy(void)
|
||||
|
||||
return rarch_task_push_content_load_default(
|
||||
NULL, NULL,
|
||||
true, CORE_TYPE_DUMMY,
|
||||
true,
|
||||
&content_info,
|
||||
CORE_TYPE_DUMMY,
|
||||
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
@ -84,9 +84,8 @@ static void menu_content_environment_get(int *argc, char *argv[],
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
|
||||
static bool menu_content_load(void)
|
||||
static bool menu_content_load(content_ctx_info_t *content_info)
|
||||
{
|
||||
content_ctx_info_t content_info;
|
||||
char name[PATH_MAX_LENGTH];
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
char *fullpath = NULL;
|
||||
@ -96,14 +95,10 @@ static bool menu_content_load(void)
|
||||
menu_display_set_msg_force(true);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_RENDER, NULL);
|
||||
|
||||
content_info.argc = 0;
|
||||
content_info.argv = NULL;
|
||||
content_info.args = NULL;
|
||||
content_info.environ_get = menu_content_environment_get;
|
||||
|
||||
fill_pathname_base(name, fullpath, sizeof(name));
|
||||
|
||||
if (!content_load(&content_info))
|
||||
if (!content_load(content_info))
|
||||
goto error;
|
||||
|
||||
/** Show loading OSD message */
|
||||
@ -136,8 +131,14 @@ error:
|
||||
|
||||
static bool command_event_cmd_exec(void *data)
|
||||
{
|
||||
content_ctx_info_t content_info;
|
||||
char *fullpath = NULL;
|
||||
|
||||
content_info.argc = 0;
|
||||
content_info.argv = NULL;
|
||||
content_info.args = NULL;
|
||||
content_info.environ_get = menu_content_environment_get;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
|
||||
|
||||
if (fullpath != data)
|
||||
@ -149,7 +150,7 @@ static bool command_event_cmd_exec(void *data)
|
||||
|
||||
#if defined(HAVE_DYNAMIC)
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(&content_info))
|
||||
{
|
||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||
return false;
|
||||
@ -166,6 +167,7 @@ bool rarch_task_push_content_load_default(
|
||||
const char *core_path,
|
||||
const char *fullpath,
|
||||
bool persist,
|
||||
content_ctx_info_t *content_info,
|
||||
enum rarch_core_type type,
|
||||
enum content_mode_load mode,
|
||||
retro_task_callback_t cb,
|
||||
@ -180,7 +182,7 @@ bool rarch_task_push_content_load_default(
|
||||
case CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU:
|
||||
runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL);
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
@ -192,7 +194,7 @@ bool rarch_task_push_content_load_default(
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
@ -201,11 +203,11 @@ bool rarch_task_push_content_load_default(
|
||||
runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)fullpath);
|
||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
@ -217,7 +219,7 @@ bool rarch_task_push_content_load_default(
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
@ -229,7 +231,7 @@ bool rarch_task_push_content_load_default(
|
||||
#endif
|
||||
runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)fullpath);
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
break;
|
||||
@ -239,7 +241,7 @@ bool rarch_task_push_content_load_default(
|
||||
#ifdef HAVE_DYNAMIC
|
||||
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
||||
#ifdef HAVE_MENU
|
||||
if (!menu_content_load())
|
||||
if (!menu_content_load(content_info))
|
||||
goto error;
|
||||
#endif
|
||||
#else
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <queues/message_queue.h>
|
||||
#include <queues/task_queue.h>
|
||||
|
||||
#include "../content.h"
|
||||
#include "../core_type.h"
|
||||
#include "../runloop.h"
|
||||
|
||||
@ -128,6 +129,7 @@ bool rarch_task_push_content_load_default(
|
||||
const char *core_path,
|
||||
const char *fullpath,
|
||||
bool persist,
|
||||
content_ctx_info_t *content_info,
|
||||
enum rarch_core_type type,
|
||||
enum content_mode_load mode,
|
||||
retro_task_callback_t cb,
|
||||
|
@ -279,10 +279,13 @@ static void poll_iteration(void)
|
||||
|
||||
if (core_name)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
rarch_task_push_content_load_default(
|
||||
NULL,
|
||||
__core.UTF8String,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
|
||||
NULL, NULL);
|
||||
}
|
||||
@ -318,9 +321,12 @@ static void open_core_handler(NSOpenPanel *panel, NSInteger result)
|
||||
if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL)
|
||||
&& settings->set_supports_no_game_enable)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL);
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, NULL, false, CORE_TYPE_PLAIN,
|
||||
NULL, NULL, false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
|
||||
NULL, NULL);
|
||||
}
|
||||
@ -352,9 +358,12 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result)
|
||||
|
||||
if (core_name)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, NULL,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
@ -564,6 +564,8 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
||||
if (win32_browser(owner, win32_file,
|
||||
extensions, title, initial_dir))
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case ID_M_LOAD_CORE:
|
||||
@ -576,8 +578,10 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
||||
do_wm_close = true;
|
||||
rarch_task_push_content_load_default(
|
||||
NULL, NULL,
|
||||
false, CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
|
||||
false,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI,
|
||||
NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user