From a687c47f7eae7e54a64cedfd260ec78a348f5821 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 16 May 2016 14:58:08 +0200 Subject: [PATCH] Move command_event_cmd_exec to tasks/task_content.c --- command.c | 30 ------------------------------ command.h | 3 +-- tasks/task_content.c | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/command.c b/command.c index 09ac663228d..6a2a598c159 100644 --- a/command.c +++ b/command.c @@ -1548,34 +1548,6 @@ static void command_event_main_state(unsigned cmd) RARCH_LOG("%s\n", msg); } -static bool command_event_cmd_exec(void *data) -{ - char *fullpath = NULL; - - runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); - - if (fullpath != data) - { - runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); - if (data) - runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, data); - } - -#if defined(HAVE_DYNAMIC) -#ifdef HAVE_MENU - if (!menu_content_ctl(MENU_CONTENT_CTL_LOAD, NULL)) - { - rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL); - return false; - } -#endif -#else - frontend_driver_set_fork(FRONTEND_FORK_CORE_WITH_ARGS); -#endif - - return true; -} - /** * command_event: * @cmd : Event command index. @@ -2331,8 +2303,6 @@ bool command_event(enum event_command cmd, void *data) case CMD_EVENT_SET_FRAME_LIMIT: runloop_ctl(RUNLOOP_CTL_SET_FRAME_LIMIT, NULL); break; - case CMD_EVENT_EXEC: - return command_event_cmd_exec(data); case CMD_EVENT_NONE: default: return false; diff --git a/command.h b/command.h index 85ae12056b6..271bb780aad 100644 --- a/command.h +++ b/command.h @@ -208,8 +208,7 @@ enum event_command CMD_EVENT_FULLSCREEN_TOGGLE, CMD_EVENT_PERFCNT_REPORT_FRONTEND_LOG, CMD_EVENT_VOLUME_UP, - CMD_EVENT_VOLUME_DOWN, - CMD_EVENT_EXEC + CMD_EVENT_VOLUME_DOWN }; #ifdef HAVE_COMMAND diff --git a/tasks/task_content.c b/tasks/task_content.c index 983fee8574c..a079d3f5193 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -28,6 +28,34 @@ /* TODO/FIXME - turn this into actual task */ +static bool command_event_cmd_exec(void *data) +{ + char *fullpath = NULL; + + runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); + + if (fullpath != data) + { + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + if (data) + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, data); + } + +#if defined(HAVE_DYNAMIC) +#ifdef HAVE_MENU + if (!menu_content_ctl(MENU_CONTENT_CTL_LOAD, NULL)) + { + rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL); + return false; + } +#endif +#else + frontend_driver_set_fork(FRONTEND_FORK_CORE_WITH_ARGS); +#endif + + return true; +} + bool rarch_task_push_content_load_default( const char *core_path, const char *fullpath, @@ -113,7 +141,7 @@ bool rarch_task_push_content_load_default( char *fullpath = NULL; runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); - command_event(CMD_EVENT_EXEC, (void*)fullpath); + command_event_cmd_exec((void*)fullpath); command_event(CMD_EVENT_QUIT, NULL); } #endif @@ -126,7 +154,7 @@ bool rarch_task_push_content_load_default( else menu_driver_ctl(RARCH_MENU_CTL_SET_LOAD_NO_CONTENT, NULL); - if (!command_event(CMD_EVENT_EXEC, (void*)fullpath)) + if (!command_event_cmd_exec((void*)fullpath)) return false; command_event(CMD_EVENT_LOAD_CORE, NULL);