Move rarch_main_init_wrap to retroarch.c

This commit is contained in:
twinaphex 2015-01-09 18:44:57 +01:00
parent 76c392718f
commit 1ddf138860
4 changed files with 60 additions and 60 deletions

View File

@ -39,61 +39,6 @@ void rarch_playlist_load_content(content_playlist_t *playlist,
rarch_main_command(RARCH_CMD_LOAD_CORE);
}
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv)
{
*argc = 0;
argv[(*argc)++] = strdup("retroarch");
if (!args->no_content)
{
if (args->content_path)
{
RARCH_LOG("Using content: %s.\n", args->content_path);
argv[(*argc)++] = strdup(args->content_path);
}
else
{
RARCH_LOG("No content, starting dummy core.\n");
argv[(*argc)++] = strdup("--menu");
}
}
if (args->sram_path)
{
argv[(*argc)++] = strdup("-s");
argv[(*argc)++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[(*argc)++] = strdup("-S");
argv[(*argc)++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[(*argc)++] = strdup("-c");
argv[(*argc)++] = strdup(args->config_path);
}
#ifdef HAVE_DYNAMIC
if (args->libretro_path)
{
argv[(*argc)++] = strdup("-L");
argv[(*argc)++] = strdup(args->libretro_path);
}
#endif
if (args->verbose)
argv[(*argc)++] = strdup("-v");
#ifdef HAVE_FILE_LOGGER
for (i = 0; i < *argc; i++)
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
#endif
}
/* When selection is presented back, returns 0.
* If it can make a decision right now, returns -1. */

View File

@ -841,11 +841,6 @@ int rarch_main(int argc, char *argv[]);
bool rarch_replace_config(const char *path);
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv);
int rarch_main_init(int argc, char *argv[]);
void rarch_playlist_load_content(content_playlist_t *playlist,
unsigned index);

View File

@ -1996,6 +1996,61 @@ error:
return 1;
}
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv)
{
*argc = 0;
argv[(*argc)++] = strdup("retroarch");
if (!args->no_content)
{
if (args->content_path)
{
RARCH_LOG("Using content: %s.\n", args->content_path);
argv[(*argc)++] = strdup(args->content_path);
}
else
{
RARCH_LOG("No content, starting dummy core.\n");
argv[(*argc)++] = strdup("--menu");
}
}
if (args->sram_path)
{
argv[(*argc)++] = strdup("-s");
argv[(*argc)++] = strdup(args->sram_path);
}
if (args->state_path)
{
argv[(*argc)++] = strdup("-S");
argv[(*argc)++] = strdup(args->state_path);
}
if (args->config_path)
{
argv[(*argc)++] = strdup("-c");
argv[(*argc)++] = strdup(args->config_path);
}
#ifdef HAVE_DYNAMIC
if (args->libretro_path)
{
argv[(*argc)++] = strdup("-L");
argv[(*argc)++] = strdup(args->libretro_path);
}
#endif
if (args->verbose)
argv[(*argc)++] = strdup("-v");
#ifdef HAVE_FILE_LOGGER
for (i = 0; i < *argc; i++)
RARCH_LOG("arg #%d: %s\n", i, argv[i]);
#endif
}
void rarch_main_set_state(unsigned cmd)
{
switch (cmd)

View File

@ -29,6 +29,11 @@ void rarch_main_set_state(unsigned action);
bool rarch_main_command(unsigned action);
int rarch_main_init(int argc, char *argv[]);
void rarch_main_init_wrap(const struct rarch_main_wrap *args,
int *argc, char **argv);
void rarch_main_deinit(void);
void rarch_render_cached_frame(void);