From 64c85771b2f4cae8aac2093a5d52ee13482b2824 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 28 Jun 2016 01:10:58 +0200 Subject: [PATCH] Create FILE_PATH_STR extensions --- file_path_special.h | 3 +++ file_path_str.c | 6 ++++++ retroarch.c | 11 ++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/file_path_special.h b/file_path_special.h index 5c06df712e..d5518e7cd1 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -45,6 +45,9 @@ enum file_path_enum FILE_PATH_INDEX_URL, FILE_PATH_INDEX_EXTENDED_URL, FILE_PATH_SRM_EXTENSION, + FILE_PATH_UPS_EXTENSION, + FILE_PATH_IPS_EXTENSION, + FILE_PATH_BPS_EXTENSION, FILE_PATH_STATE_EXTENSION, FILE_PATH_RTC_EXTENSION, FILE_PATH_CHT_EXTENSION, diff --git a/file_path_str.c b/file_path_str.c index 21f95f18ec..e54760b8da 100644 --- a/file_path_str.c +++ b/file_path_str.c @@ -39,6 +39,12 @@ const char *file_path_str(enum file_path_enum enum_idx) return ".state"; case FILE_PATH_LPL_EXTENSION: return ".lpl"; + case FILE_PATH_UPS_EXTENSION: + return ".ups"; + case FILE_PATH_IPS_EXTENSION: + return ".ips"; + case FILE_PATH_BPS_EXTENSION: + return ".bps"; case FILE_PATH_INDEX_URL: return ".index"; case FILE_PATH_INDEX_DIRS_URL: diff --git a/retroarch.c b/retroarch.c index babf573259..eb47f70716 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1541,9 +1541,11 @@ void retroarch_set_pathnames(const char *path) if (!global->has_set.save_path) fill_pathname_noext(global->name.savefile, global->name.base, file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(global->name.savefile)); + if (!global->has_set.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)); @@ -1561,15 +1563,18 @@ void retroarch_fill_pathnames(void) return; if (string_is_empty(global->name.ups)) - fill_pathname_noext(global->name.ups, global->name.base, ".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, ".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, ".ips", + fill_pathname_noext(global->name.ips, global->name.base, + file_path_str(FILE_PATH_IPS_EXTENSION), sizeof(global->name.ips)); }