mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
config_load_remap - cleanups
This commit is contained in:
parent
2314cc65c2
commit
01d0ed5c3e
3 changed files with 5 additions and 8 deletions
|
@ -3389,7 +3389,7 @@ bool config_unload_override(void)
|
||||||
*
|
*
|
||||||
* Returns: false if there was an error or no action was performed.
|
* Returns: false if there was an error or no action was performed.
|
||||||
*/
|
*/
|
||||||
bool config_load_remap(void)
|
bool config_load_remap(const char *directory_input_remapping)
|
||||||
{
|
{
|
||||||
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
||||||
config_file_t *new_conf = NULL;
|
config_file_t *new_conf = NULL;
|
||||||
|
@ -3397,7 +3397,6 @@ bool config_load_remap(void)
|
||||||
char *core_path = NULL;
|
char *core_path = NULL;
|
||||||
char *game_path = NULL;
|
char *game_path = NULL;
|
||||||
char *content_path = NULL;
|
char *content_path = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
rarch_system_info_t *system = runloop_get_system_info();
|
rarch_system_info_t *system = runloop_get_system_info();
|
||||||
const char *core_name = system ? system->info.library_name : NULL;
|
const char *core_name = system ? system->info.library_name : NULL;
|
||||||
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME);
|
||||||
|
@ -3409,7 +3408,7 @@ bool config_load_remap(void)
|
||||||
|
|
||||||
/* Remap directory: remap_directory.
|
/* Remap directory: remap_directory.
|
||||||
* Try remap directory setting, no fallbacks defined */
|
* Try remap directory setting, no fallbacks defined */
|
||||||
if (string_is_empty(settings->paths.directory_input_remapping))
|
if (string_is_empty(directory_input_remapping))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!string_is_empty(rarch_path_basename))
|
if (!string_is_empty(rarch_path_basename))
|
||||||
|
@ -3430,9 +3429,7 @@ bool config_load_remap(void)
|
||||||
malloc(PATH_MAX_LENGTH * sizeof(char));
|
malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||||
remap_directory[0] = core_path[0] = game_path[0] = '\0';
|
remap_directory[0] = core_path[0] = game_path[0] = '\0';
|
||||||
|
|
||||||
strlcpy(remap_directory,
|
strlcpy(remap_directory, directory_input_remapping, path_size);
|
||||||
settings->paths.directory_input_remapping,
|
|
||||||
path_size);
|
|
||||||
RARCH_LOG("[Remaps]: remap directory: %s\n", remap_directory);
|
RARCH_LOG("[Remaps]: remap directory: %s\n", remap_directory);
|
||||||
|
|
||||||
/* Concatenate strings into full paths for core_path, game_path */
|
/* Concatenate strings into full paths for core_path, game_path */
|
||||||
|
|
|
@ -786,7 +786,7 @@ bool config_unload_override(void);
|
||||||
* Returns: false if there was an error or no action was performed.
|
* Returns: false if there was an error or no action was performed.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool config_load_remap(void);
|
bool config_load_remap(const char *directory_input_remapping);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* config_save_autoconf_profile:
|
* config_save_autoconf_profile:
|
||||||
|
|
|
@ -3185,7 +3185,7 @@ static bool command_event_init_core(enum rarch_core_type *data)
|
||||||
|
|
||||||
/* Auto-remap: apply remap files */
|
/* Auto-remap: apply remap files */
|
||||||
if(settings->bools.auto_remaps_enable)
|
if(settings->bools.auto_remaps_enable)
|
||||||
config_load_remap();
|
config_load_remap(settings->paths.directory_input_remapping);
|
||||||
|
|
||||||
/* Per-core saves: reset redirection paths */
|
/* Per-core saves: reset redirection paths */
|
||||||
path_set_redirect();
|
path_set_redirect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue