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

View File

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

View File

@ -97,8 +97,6 @@ enum rarch_ctl_state
* but this will do for now. */ * but this will do for now. */
RARCH_CTL_VALIDATE_CPU_FEATURES, RARCH_CTL_VALIDATE_CPU_FEATURES,
RARCH_CTL_FILL_PATHNAMES,
RARCH_CTL_SET_PATHS_REDIRECT, RARCH_CTL_SET_PATHS_REDIRECT,
RARCH_CTL_SET_SRAM_ENABLE, 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); bool retroarch_validate_game_options(char *s, size_t len, bool mkdir);
void retroarch_fill_pathnames(void);
/** /**
* retroarch_fail: * retroarch_fail:
* @error_code : Error code. * @error_code : Error code.