mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 20:54:10 +00:00
Create more dirs functions
This commit is contained in:
parent
4d317ba5d7
commit
017d05fd36
@ -637,9 +637,9 @@ static int populate_settings_path(settings_t *settings, struct config_path_setti
|
||||
SETTING_PATH("audio_filter_dir",
|
||||
settings->directory.audio_filter, true, NULL, true);
|
||||
SETTING_PATH("savefile_directory",
|
||||
global->dir.savefile, true, NULL, false);
|
||||
dir_get_savefile_ptr(), true, NULL, false);
|
||||
SETTING_PATH("savestate_directory",
|
||||
global->dir.savestate, true, NULL, false);
|
||||
dir_get_savestate_ptr(), true, NULL, false);
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_PATH("rgui_browser_directory",
|
||||
settings->directory.menu_content, true, NULL, true);
|
||||
@ -1119,9 +1119,9 @@ static void config_set_defaults(void)
|
||||
/* Make sure settings from other configs carry over into defaults
|
||||
* for another config. */
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH))
|
||||
*global->dir.savefile = '\0';
|
||||
dir_clear_savefile();
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_STATE_PATH))
|
||||
*global->dir.savestate = '\0';
|
||||
dir_clear_savestate();
|
||||
|
||||
*settings->path.libretro_info = '\0';
|
||||
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY))
|
||||
|
52
dirs.c
52
dirs.c
@ -29,6 +29,58 @@
|
||||
|
||||
#include "runloop.h"
|
||||
|
||||
void dir_clear_savefile(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (global)
|
||||
*global->dir.savefile = '\0';
|
||||
}
|
||||
|
||||
void dir_clear_savestate(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (global)
|
||||
*global->dir.savestate = '\0';
|
||||
}
|
||||
|
||||
char *dir_get_savefile_ptr(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
return NULL;
|
||||
return global->dir.savefile;
|
||||
}
|
||||
|
||||
const char *dir_get_savefile(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
return NULL;
|
||||
return global->dir.savefile;
|
||||
}
|
||||
|
||||
char *dir_get_savestate_ptr(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
return NULL;
|
||||
return global->dir.savestate;
|
||||
}
|
||||
|
||||
const char *dir_get_savestate(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (!global)
|
||||
return NULL;
|
||||
return global->dir.savestate;
|
||||
}
|
||||
|
||||
void dir_set_savestate(const char *path)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
12
dirs.h
12
dirs.h
@ -21,6 +21,18 @@
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
void dir_clear_savefile(void);
|
||||
|
||||
void dir_clear_savestate(void);
|
||||
|
||||
char *dir_get_savefile_ptr(void);
|
||||
|
||||
const char *dir_get_savefile(void);
|
||||
|
||||
char *dir_get_savestate_ptr(void);
|
||||
|
||||
const char *dir_get_savestate(void);
|
||||
|
||||
void dir_set_savefile(const char *path);
|
||||
|
||||
void dir_set_savestate(const char *path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user