diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 21d578d48f..5977ad0b8f 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -334,11 +334,9 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) const core_info_t *info = (const core_info_t*)&core_info[0]; if (info) - task_push_content_load_default( + task_push_content_load_content_with_new_core_from_companion_ui( info->path, NULL, &content_info, - CORE_TYPE_PLAIN, - CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI, NULL, NULL); } else diff --git a/tasks/task_content.c b/tasks/task_content.c index a90d229313..00521a2702 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1462,6 +1462,34 @@ static bool task_loading_from_menu(enum content_mode_load mode) return false; } +bool task_push_content_load_content_with_new_core_from_companion_ui( + const char *core_path, + const char *fullpath, + content_ctx_info_t *content_info, + retro_task_callback_t cb, + void *user_data) +{ + /* Set content path */ + path_set(RARCH_PATH_CONTENT, fullpath); + + /* Set libretro core path */ + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); +#ifdef HAVE_DYNAMIC + command_event(CMD_EVENT_LOAD_CORE, NULL); +#endif + + /* Load content */ + if (!task_load_content_callback(content_info, true, false)) + return false; + + /* Push quick menu onto menu stack */ +#ifdef HAVE_MENU + menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL); +#endif + + return true; +} + bool task_push_content_load_default( const char *core_path, const char *fullpath, @@ -1490,7 +1518,6 @@ bool task_push_content_load_default( { case CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI: - case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI: case CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU: path_set(RARCH_PATH_CONTENT, fullpath); @@ -1499,19 +1526,6 @@ bool task_push_content_load_default( break; } - /* Set libretro core path */ - switch (mode) - { - case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI: - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); -#ifdef HAVE_DYNAMIC - command_event(CMD_EVENT_LOAD_CORE, NULL); -#endif - break; - default: - break; - } - /* Preliminary stuff that has to be done before we * load the actual content. Can differ per mode. */ switch (mode) @@ -1544,7 +1558,6 @@ bool task_push_content_load_default( #endif case CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI: - case CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI: case CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU: if (!task_load_content_callback(content_info, true, loading_from_cli)) diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 17e71b6a98..bbd5b9acd6 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -44,8 +44,7 @@ enum content_mode_load CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU, CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU, CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU, - CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, - CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_COMPANION_UI + CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI }; enum nbio_status_enum @@ -151,6 +150,15 @@ bool task_push_content_load_nothing_with_current_core_from_menu(content_ctx_info bool task_push_content_load_nothing_with_dummy_core(content_ctx_info_t *content_info); +bool task_push_content_load_content_with_new_core_from_companion_ui( + const char *core_path, + const char *fullpath, + content_ctx_info_t *content_info, + enum rarch_core_type type, + enum content_mode_load mode, + retro_task_callback_t cb, + void *user_data); + bool task_push_content_load_content_with_new_core_from_menu( const char *core_path, const char *fullpath,