1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Creat APPLICATION_SPECIAL_DIRECTORY_CONFIG

This commit is contained in:
twinaphex 2016-06-11 21:55:55 +02:00
parent 7c904d47c2
commit 6f8b6a22b7
3 changed files with 17 additions and 11 deletions

View File

@ -44,6 +44,7 @@
#include "configuration.h"
#include "file_path_special.h"
#include "runloop.h"
#include "verbosity.h"
void fill_pathname_expand_special(char *out_path,
@ -279,6 +280,18 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe
len);
}
break;
case APPLICATION_SPECIAL_DIRECTORY_CONFIG:
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
/* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->directory.menu_config))
strlcpy(s, settings->directory.menu_config, len);
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(s, global->path.config, len);
}
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS:
#ifdef HAVE_ZARCH
{

View File

@ -26,6 +26,7 @@ enum application_special_type
{
APPLICATION_SPECIAL_NONE = 0,
APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG,
APPLICATION_SPECIAL_DIRECTORY_CONFIG,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS,

View File

@ -51,6 +51,7 @@
#include "dynamic.h"
#include "msg_hash.h"
#include "movie.h"
#include "file_path_special.h"
#include "verbosity.h"
#include "frontend/frontend_driver.h"
@ -1195,17 +1196,8 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
/* Config directory: config_directory.
* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->directory.menu_config))
strlcpy(config_directory,
settings->directory.menu_config, sizeof(config_directory));
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(config_directory,
global->path.config, sizeof(config_directory));
else
return false;
fill_pathname_application_special(config_directory, sizeof(config_directory),
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
/* Concatenate strings into full paths for game_path */
fill_pathname_join(s,