Simplify call to main_load_content

This commit is contained in:
twinaphex 2015-12-05 08:10:01 +01:00
parent 26cd1a3702
commit 5ed7c3abed
5 changed files with 16 additions and 12 deletions

View File

@ -179,7 +179,6 @@ static void history_playlist_push(content_playlist_t *playlist,
* @argv : Argument variable list.
* @args : Arguments passed from callee.
* @environ_get : Function passed for environment_get function.
* @process_args : Function passed for process_args function.
*
* Loads content file and starts up RetroArch.
* If no content file can be loaded, will start up RetroArch
@ -188,8 +187,7 @@ static void history_playlist_push(content_playlist_t *playlist,
* Returns: false (0) if rarch_main_init failed, otherwise true (1).
**/
bool main_load_content(int argc, char **argv, void *args,
environment_get_t environ_get,
process_args_t process_args)
environment_get_t environ_get)
{
unsigned i;
bool retval = true;
@ -235,8 +233,7 @@ bool main_load_content(int argc, char **argv, void *args,
check_defaults_dirs();
if (process_args)
process_args(rarch_argc_ptr, rarch_argv_ptr);
frontend_driver_process_args(rarch_argc_ptr, rarch_argv_ptr);
error:
for (i = 0; i < ARRAY_SIZE(argv_copy); i++)
@ -289,8 +286,7 @@ int rarch_main(int argc, char *argv[], void *data)
if (driver->frontend_ctx)
{
if (!(ret = (main_load_content(argc, argv, args,
driver->frontend_ctx->environment_get,
driver->frontend_ctx->process_args))))
driver->frontend_ctx->environment_get))))
return ret;
}

View File

@ -56,7 +56,6 @@ int rarch_main(int argc, char *argv[], void *data);
* @argv : Argument variable list.
* @args : Arguments passed from callee.
* @environ_get : Function passed for environment_get function.
* @process_args : Function passed for process_args function.
*
* Loads content file and starts up RetroArch.
* If no content file can be loaded, will start up RetroArch
@ -65,8 +64,7 @@ int rarch_main(int argc, char *argv[], void *data);
* Returns: false (0) if rarch_main_init failed, otherwise true (1).
**/
bool main_load_content(int argc, char **argv,
void *args, environment_get_t environ_get,
process_args_t process_args);
void *args, environment_get_t environ_get);
#ifdef __cplusplus
}

View File

@ -137,4 +137,13 @@ void frontend_driver_set_fork(bool a, bool b)
return;
frontend->set_fork(a, b);
}
void frontend_driver_process_args(int *argc, char *argv[])
{
frontend_ctx_driver_t *frontend = frontend_get_ptr();
if (!frontend || !frontend->process_args)
return;
frontend->process_args(argc, argv);
}
#endif

View File

@ -116,6 +116,8 @@ void frontend_driver_content_loaded(void);
void frontend_driver_set_fork(bool a, bool b);
void frontend_driver_process_args(int *argc, char *argv[]);
#ifdef __cplusplus
}
#endif

View File

@ -105,8 +105,7 @@ bool menu_load_content(enum rarch_core_type type)
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
menu_iterate_render();
if (!(main_load_content(0, NULL, NULL, menu_environment_get,
driver->frontend_ctx->process_args)))
if (!(main_load_content(0, NULL, NULL, menu_environment_get)))
{
char name[PATH_MAX_LENGTH] = {0};
char msg[PATH_MAX_LENGTH] = {0};