mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(360/PS3) Use rarch_create_default_config_file
This commit is contained in:
parent
c9ce831e22
commit
15b7e0fafc
13
360/main.c
13
360/main.c
@ -190,12 +190,7 @@ static void init_settings (bool load_libretro_path)
|
||||
char fname_tmp[MAX_PATH_LENGTH];
|
||||
|
||||
if(!path_file_exists(SYS_CONFIG_FILE))
|
||||
{
|
||||
FILE * f;
|
||||
RARCH_ERR("Config file \"%s\" doesn't exist. Creating...\n", SYS_CONFIG_FILE);
|
||||
f = fopen(SYS_CONFIG_FILE, "w");
|
||||
fclose(f);
|
||||
}
|
||||
rarch_create_default_config_file(SYS_CONFIG_FILE);
|
||||
|
||||
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
||||
|
||||
@ -281,11 +276,7 @@ static void init_settings (bool load_libretro_path)
|
||||
static void save_settings (void)
|
||||
{
|
||||
if(!path_file_exists(SYS_CONFIG_FILE))
|
||||
{
|
||||
FILE * f;
|
||||
f = fopen(SYS_CONFIG_FILE, "w");
|
||||
fclose(f);
|
||||
}
|
||||
rarch_create_default_config_file(SYS_CONFIG_FILE);
|
||||
|
||||
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
||||
|
||||
|
@ -789,3 +789,15 @@ const char * rarch_convert_wchar_to_const_char(const wchar_t * wstr)
|
||||
wcstombs(str, wstr, sizeof(str));
|
||||
return str;
|
||||
}
|
||||
|
||||
/*============================================================
|
||||
CONFIG
|
||||
============================================================ */
|
||||
|
||||
void rarch_create_default_config_file(const char * conf_name)
|
||||
{
|
||||
FILE * f;
|
||||
RARCH_WARN("Config file \"%s\" doesn't exist. Creating...\n", conf_name);
|
||||
f = fopen(conf_name, "w");
|
||||
fclose(f);
|
||||
}
|
||||
|
@ -138,5 +138,6 @@ wchar_t * rarch_convert_char_to_wchar(const char * str);
|
||||
|
||||
const char * rarch_convert_wchar_to_const_char(const wchar_t * wstr);
|
||||
|
||||
void rarch_create_default_config_file(const char * conf_name);
|
||||
|
||||
#endif
|
||||
|
14
ps3/main.c
14
ps3/main.c
@ -158,12 +158,7 @@ static void set_default_settings(void)
|
||||
static void init_settings(bool load_libretro_path)
|
||||
{
|
||||
if(!path_file_exists(SYS_CONFIG_FILE))
|
||||
{
|
||||
RARCH_ERR("Config file \"%s\" doesn't exist. Creating...\n", SYS_CONFIG_FILE);
|
||||
FILE * f;
|
||||
f = fopen(SYS_CONFIG_FILE, "w");
|
||||
fclose(f);
|
||||
}
|
||||
rarch_create_default_config_file(SYS_CONFIG_FILE);
|
||||
else
|
||||
{
|
||||
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
||||
@ -251,12 +246,7 @@ static void init_settings(bool load_libretro_path)
|
||||
static void save_settings(void)
|
||||
{
|
||||
if(!path_file_exists(SYS_CONFIG_FILE))
|
||||
{
|
||||
RARCH_ERR("Config file \"%s\" doesn't exist. Creating...\n", SYS_CONFIG_FILE);
|
||||
FILE * f;
|
||||
f = fopen(SYS_CONFIG_FILE, "w");
|
||||
fclose(f);
|
||||
}
|
||||
rarch_create_default_config_file(SYS_CONFIG_FILE);
|
||||
else
|
||||
{
|
||||
config_file_t * conf = config_file_new(SYS_CONFIG_FILE);
|
||||
|
Loading…
Reference in New Issue
Block a user