mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-02 15:05:09 +00:00
Move retroarch_set_pathnames/retroarch_fill_pathnames
This commit is contained in:
parent
d8b5e3c1ec
commit
1dd28bdf9f
@ -74,6 +74,7 @@
|
||||
#include "dynamic.h"
|
||||
#include "content.h"
|
||||
#include "movie.h"
|
||||
#include "paths.h"
|
||||
#include "msg_hash.h"
|
||||
#include "retroarch.h"
|
||||
#include "managers/cheat_manager.h"
|
||||
@ -989,8 +990,8 @@ static bool command_event_disk_control_append_image(const char *path)
|
||||
* If we actually use append_image, we assume that we
|
||||
* started out in a single disk case, and that this way
|
||||
* of doing it makes the most sense. */
|
||||
retroarch_set_pathnames(path);
|
||||
retroarch_fill_pathnames();
|
||||
path_set_names(path);
|
||||
path_fill_names();
|
||||
}
|
||||
|
||||
command_event(CMD_EVENT_AUTOSAVE_INIT, NULL);
|
||||
@ -1327,7 +1328,7 @@ static bool event_init_content(void)
|
||||
return true;
|
||||
|
||||
if (!content_does_not_need_content())
|
||||
retroarch_fill_pathnames();
|
||||
path_fill_names();
|
||||
|
||||
if (!content_init())
|
||||
return false;
|
||||
|
46
paths.c
46
paths.c
@ -365,3 +365,49 @@ void path_init_savefile(void)
|
||||
string_list_append(global->savefiles, savefile_name_rtc, attr);
|
||||
}
|
||||
}
|
||||
|
||||
void path_set_names(const char *path)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
path_set_basename(path);
|
||||
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH))
|
||||
fill_pathname_noext(global->name.savefile, global->name.base,
|
||||
file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(global->name.savefile));
|
||||
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH))
|
||||
fill_pathname_noext(global->name.savestate, global->name.base,
|
||||
file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(global->name.savestate));
|
||||
|
||||
fill_pathname_noext(global->name.cheatfile, global->name.base,
|
||||
file_path_str(FILE_PATH_CHT_EXTENSION), sizeof(global->name.cheatfile));
|
||||
|
||||
path_set_redirect();
|
||||
}
|
||||
|
||||
void path_fill_names(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
path_init_savefile();
|
||||
bsv_movie_set_path(global->name.savefile);
|
||||
|
||||
if (string_is_empty(global->name.base))
|
||||
return;
|
||||
|
||||
if (string_is_empty(global->name.ups))
|
||||
fill_pathname_noext(global->name.ups, global->name.base,
|
||||
file_path_str(FILE_PATH_UPS_EXTENSION),
|
||||
sizeof(global->name.ups));
|
||||
|
||||
if (string_is_empty(global->name.bps))
|
||||
fill_pathname_noext(global->name.bps, global->name.base,
|
||||
file_path_str(FILE_PATH_BPS_EXTENSION),
|
||||
sizeof(global->name.bps));
|
||||
|
||||
if (string_is_empty(global->name.ips))
|
||||
fill_pathname_noext(global->name.ips, global->name.base,
|
||||
file_path_str(FILE_PATH_IPS_EXTENSION),
|
||||
sizeof(global->name.ips));
|
||||
}
|
||||
|
4
paths.h
4
paths.h
@ -23,6 +23,10 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
void path_init_savefile(void);
|
||||
|
||||
void path_set_names(const char *path);
|
||||
|
||||
void path_fill_names(void);
|
||||
|
||||
void path_set_redirect(void);
|
||||
|
||||
void path_set_special(char **argv, unsigned num_content);
|
||||
|
48
retroarch.c
48
retroarch.c
@ -867,7 +867,7 @@ static void retroarch_parse_input(int argc, char *argv[])
|
||||
{
|
||||
/* We requested explicit ROM, so use PLAIN core type. */
|
||||
retroarch_set_current_core_type(CORE_TYPE_PLAIN, false);
|
||||
retroarch_set_pathnames((const char*)argv[optind]);
|
||||
path_set_names((const char*)argv[optind]);
|
||||
}
|
||||
else if (!string_is_empty(global->subsystem) && optind < argc)
|
||||
{
|
||||
@ -1273,52 +1273,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
void retroarch_set_pathnames(const char *path)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
path_set_basename(path);
|
||||
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH))
|
||||
fill_pathname_noext(global->name.savefile, global->name.base,
|
||||
file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(global->name.savefile));
|
||||
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH))
|
||||
fill_pathname_noext(global->name.savestate, global->name.base,
|
||||
file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(global->name.savestate));
|
||||
|
||||
fill_pathname_noext(global->name.cheatfile, global->name.base,
|
||||
file_path_str(FILE_PATH_CHT_EXTENSION), sizeof(global->name.cheatfile));
|
||||
|
||||
path_set_redirect();
|
||||
}
|
||||
|
||||
void retroarch_fill_pathnames(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
path_init_savefile();
|
||||
bsv_movie_set_path(global->name.savefile);
|
||||
|
||||
if (string_is_empty(global->name.base))
|
||||
return;
|
||||
|
||||
if (string_is_empty(global->name.ups))
|
||||
fill_pathname_noext(global->name.ups, global->name.base,
|
||||
file_path_str(FILE_PATH_UPS_EXTENSION),
|
||||
sizeof(global->name.ups));
|
||||
|
||||
if (string_is_empty(global->name.bps))
|
||||
fill_pathname_noext(global->name.bps, global->name.base,
|
||||
file_path_str(FILE_PATH_BPS_EXTENSION),
|
||||
sizeof(global->name.bps));
|
||||
|
||||
if (string_is_empty(global->name.ips))
|
||||
fill_pathname_noext(global->name.ips, global->name.base,
|
||||
file_path_str(FILE_PATH_IPS_EXTENSION),
|
||||
sizeof(global->name.ips));
|
||||
}
|
||||
|
||||
static bool has_set_verbosity = false;
|
||||
static bool has_set_libretro = false;
|
||||
static bool has_set_libretro_directory = false;
|
||||
|
@ -152,10 +152,6 @@ const char *retroarch_get_current_savefile_dir(void);
|
||||
|
||||
bool retroarch_validate_game_options(char *s, size_t len, bool mkdir);
|
||||
|
||||
void retroarch_set_pathnames(const char *path);
|
||||
|
||||
void retroarch_fill_pathnames(void);
|
||||
|
||||
void retroarch_set_current_core_type(enum rarch_core_type type, bool explicitly_set);
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user