mirror of
https://github.com/libretro/RetroArch
synced 2025-03-26 11:37:30 +00:00
Create retroarch_set_pathnames
This commit is contained in:
parent
030513bcee
commit
7ebfe1b66d
@ -870,7 +870,7 @@ static bool command_event_disk_control_append_image(const char *path)
|
|||||||
* If we actually use append_image, we assume that we
|
* If we actually use append_image, we assume that we
|
||||||
* 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);
|
retroarch_set_pathnames(path);
|
||||||
retroarch_fill_pathnames();
|
retroarch_fill_pathnames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
34
retroarch.c
34
retroarch.c
@ -1040,7 +1040,7 @@ static void retroarch_parse_input(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
/* We requested explicit ROM, so use PLAIN core type. */
|
/* We requested explicit ROM, so use PLAIN core type. */
|
||||||
current_core_type = CORE_TYPE_PLAIN;
|
current_core_type = CORE_TYPE_PLAIN;
|
||||||
rarch_ctl(RARCH_CTL_SET_PATHS, (void*)argv[optind]);
|
retroarch_set_pathnames((const char*)argv[optind]);
|
||||||
}
|
}
|
||||||
else if (*global->subsystem && optind < argc)
|
else if (*global->subsystem && optind < argc)
|
||||||
{
|
{
|
||||||
@ -1340,20 +1340,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
|
|
||||||
switch(state)
|
switch(state)
|
||||||
{
|
{
|
||||||
case RARCH_CTL_SET_PATHS:
|
|
||||||
retroarch_set_basename((const char*)data);
|
|
||||||
|
|
||||||
if (!global->has_set.save_path)
|
|
||||||
fill_pathname_noext(global->name.savefile, global->name.base,
|
|
||||||
".srm", sizeof(global->name.savefile));
|
|
||||||
if (!global->has_set.state_path)
|
|
||||||
fill_pathname_noext(global->name.savestate, global->name.base,
|
|
||||||
".state", sizeof(global->name.savestate));
|
|
||||||
fill_pathname_noext(global->name.cheatfile, global->name.base,
|
|
||||||
".cht", sizeof(global->name.cheatfile));
|
|
||||||
|
|
||||||
retroarch_set_paths_redirect((const char*)data);
|
|
||||||
break;
|
|
||||||
case RARCH_CTL_IS_PLAIN_CORE:
|
case RARCH_CTL_IS_PLAIN_CORE:
|
||||||
return (current_core_type == CORE_TYPE_PLAIN);
|
return (current_core_type == CORE_TYPE_PLAIN);
|
||||||
case RARCH_CTL_IS_DUMMY_CORE:
|
case RARCH_CTL_IS_DUMMY_CORE:
|
||||||
@ -1556,6 +1542,24 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void retroarch_set_pathnames(const char *path)
|
||||||
|
{
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
retroarch_set_basename(path);
|
||||||
|
|
||||||
|
if (!global->has_set.save_path)
|
||||||
|
fill_pathname_noext(global->name.savefile, global->name.base,
|
||||||
|
".srm", sizeof(global->name.savefile));
|
||||||
|
if (!global->has_set.state_path)
|
||||||
|
fill_pathname_noext(global->name.savestate, global->name.base,
|
||||||
|
".state", sizeof(global->name.savestate));
|
||||||
|
fill_pathname_noext(global->name.cheatfile, global->name.base,
|
||||||
|
".cht", sizeof(global->name.cheatfile));
|
||||||
|
|
||||||
|
retroarch_set_paths_redirect(path);
|
||||||
|
}
|
||||||
|
|
||||||
void retroarch_fill_pathnames(void)
|
void retroarch_fill_pathnames(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
@ -101,8 +101,6 @@ enum rarch_ctl_state
|
|||||||
|
|
||||||
RARCH_CTL_SET_SRAM_ENABLE,
|
RARCH_CTL_SET_SRAM_ENABLE,
|
||||||
|
|
||||||
RARCH_CTL_SET_PATHS,
|
|
||||||
|
|
||||||
RARCH_CTL_SET_FORCE_FULLSCREEN,
|
RARCH_CTL_SET_FORCE_FULLSCREEN,
|
||||||
|
|
||||||
RARCH_CTL_UNSET_FORCE_FULLSCREEN,
|
RARCH_CTL_UNSET_FORCE_FULLSCREEN,
|
||||||
@ -169,6 +167,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_set_pathnames(const char *path);
|
||||||
|
|
||||||
void retroarch_fill_pathnames(void);
|
void retroarch_fill_pathnames(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user