Create retroarch_fill_pathnames

This commit is contained in:
twinaphex 2016-05-11 04:29:01 +02:00
parent 95a6428915
commit 030513bcee
3 changed files with 25 additions and 21 deletions

View File

@ -871,7 +871,7 @@ static bool command_event_disk_control_append_image(const char *path)
* started out in a single disk case, and that this way
* of doing it makes the most sense. */
rarch_ctl(RARCH_CTL_SET_PATHS, (void*)path);
rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
retroarch_fill_pathnames();
}
command_event(CMD_EVENT_AUTOSAVE_INIT, NULL);
@ -1205,7 +1205,7 @@ static bool event_init_content(void)
return true;
if (!content_does_not_need_content())
rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
retroarch_fill_pathnames();
if (!content_init())
return false;

View File

@ -1548,23 +1548,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
#endif
}
break;
case RARCH_CTL_FILL_PATHNAMES:
retroarch_init_savefile_paths();
bsv_movie_set_path(global->name.savefile);
if (!*global->name.base)
return false;
if (!*global->name.ups)
fill_pathname_noext(global->name.ups, global->name.base, ".ups",
sizeof(global->name.ups));
if (!*global->name.bps)
fill_pathname_noext(global->name.bps, global->name.base, ".bps",
sizeof(global->name.bps));
if (!*global->name.ips)
fill_pathname_noext(global->name.ips, global->name.base, ".ips",
sizeof(global->name.ips));
break;
case RARCH_CTL_NONE:
default:
return false;
@ -1573,6 +1556,27 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
return true;
}
void retroarch_fill_pathnames(void)
{
global_t *global = global_get_ptr();
retroarch_init_savefile_paths();
bsv_movie_set_path(global->name.savefile);
if (!*global->name.base)
return;
if (!*global->name.ups)
fill_pathname_noext(global->name.ups, global->name.base, ".ups",
sizeof(global->name.ups));
if (!*global->name.bps)
fill_pathname_noext(global->name.bps, global->name.base, ".bps",
sizeof(global->name.bps));
if (!*global->name.ips)
fill_pathname_noext(global->name.ips, global->name.base, ".ips",
sizeof(global->name.ips));
}
int retroarch_get_capabilities(enum rarch_capabilities type,
char *s, size_t len)
{

View File

@ -97,8 +97,6 @@ enum rarch_ctl_state
* but this will do for now. */
RARCH_CTL_VALIDATE_CPU_FEATURES,
RARCH_CTL_FILL_PATHNAMES,
RARCH_CTL_SET_PATHS_REDIRECT,
RARCH_CTL_SET_SRAM_ENABLE,
@ -171,6 +169,8 @@ const char *retroarch_get_current_savefile_dir(void);
bool retroarch_validate_game_options(char *s, size_t len, bool mkdir);
void retroarch_fill_pathnames(void);
/**
* retroarch_fail:
* @error_code : Error code.