Update path_get

This commit is contained in:
twinaphex 2016-09-29 08:46:41 +02:00
parent ed2b89db27
commit 3d098839ca
7 changed files with 15 additions and 19 deletions

View File

@ -2118,7 +2118,7 @@ static bool config_load_file(const char *path, bool set_defaults,
strlcpy(global->name.savefile, tmp_str,
sizeof(global->name.savefile));
fill_pathname_dir(global->name.savefile,
path_get_basename(),
path_get(RARCH_PATH_BASENAME),
file_path_str(FILE_PATH_SRM_EXTENSION),
sizeof(global->name.savefile));
}
@ -2138,7 +2138,7 @@ static bool config_load_file(const char *path, bool set_defaults,
strlcpy(global->name.savestate, tmp_str,
sizeof(global->name.savestate));
fill_pathname_dir(global->name.savestate,
path_get_basename(),
path_get(RARCH_PATH_BASENAME),
file_path_str(FILE_PATH_STATE_EXTENSION),
sizeof(global->name.savestate));
}
@ -2204,7 +2204,7 @@ bool config_load_override(void)
if (system)
core_name = system->info.library_name;
game_name = path_basename(path_get_basename());
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
@ -2365,7 +2365,7 @@ bool config_load_remap(void)
if (system)
core_name = system->info.library_name;
game_name = path_basename(path_get_basename());
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
@ -2487,7 +2487,7 @@ bool config_load_shader_preset(void)
if (system)
core_name = system->info.library_name;
game_name = path_basename(path_get_basename());
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
@ -3085,7 +3085,7 @@ bool config_save_overrides(int override_type)
if (system)
core_name = system->info.library_name;
game_name = path_basename(path_get_basename());
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;

View File

@ -1351,8 +1351,8 @@ static void menu_action_setting_disp_set_label_core_option_create(
strlcpy(s, "", len);
if (!string_is_empty(path_get_basename()))
strlcpy(s, path_basename(path_get_basename()), len);
if (!string_is_empty(path_get(RARCH_PATH_BASENAME)))
strlcpy(s, path_basename(path_get(RARCH_PATH_BASENAME)), len);
strlcpy(s2, path, len2);
}

View File

@ -1606,7 +1606,7 @@ static int generic_action_ok_shader_preset_save(const char *path,
break;
case ACTION_OK_SHADER_PRESET_SAVE_GAME:
{
const char *game_name = path_basename(path_get_basename());
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
fill_pathname_join(file, directory, game_name, sizeof(file));
}
break;
@ -1713,7 +1713,7 @@ static int generic_action_ok_remap_file_save(const char *path,
case ACTION_OK_REMAP_FILE_SAVE_GAME:
if (core_name)
fill_pathname_join(file, core_name,
path_basename(path_get_basename()), sizeof(file));
path_basename(path_get(RARCH_PATH_BASENAME)), sizeof(file));
break;
}

View File

@ -468,11 +468,6 @@ void path_fill_names(void)
/* Core file path */
const char *path_get_basename(void)
{
return path_main_basename;
}
char *path_get_core_ptr(void)
{
return path_libretro;
@ -482,6 +477,8 @@ const char *path_get(enum rarch_path_type type)
{
switch (type)
{
case RARCH_PATH_BASENAME:
return path_main_basename;
case RARCH_PATH_CORE_OPTIONS:
if (!path_is_core_options_empty())
return path_core_options_file;

View File

@ -40,6 +40,7 @@ enum rarch_path_type
RARCH_PATH_CONFIG_APPEND,
RARCH_PATH_CORE_OPTIONS,
RARCH_PATH_DEFAULT_SHADER_PRESET,
RARCH_PATH_BASENAME,
RARCH_PATH_SUBSYSTEM
};
@ -86,8 +87,6 @@ bool path_get_content(char **fullpath);
const char *path_get_current_savefile_dir(void);
const char *path_get_basename(void);
bool path_get_default_shader_preset(char **preset);
/* clear functions */

View File

@ -887,7 +887,7 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
if (system)
core_name = system->info.library_name;
game_name = path_basename(path_get_basename());
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;

View File

@ -283,7 +283,7 @@ static bool take_screenshot_choice(const char *name_base)
**/
bool take_screenshot(void)
{
char *name_base = strdup(path_get_basename());
char *name_base = strdup(path_get(RARCH_PATH_BASENAME));
bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
bool ret = take_screenshot_choice(name_base);
const char *msg_screenshot = ret