Merge pull request #2261 from fr500/master

Various changes
This commit is contained in:
Twinaphex 2015-10-20 03:02:38 +02:00
commit 3a8e181210
6 changed files with 86 additions and 107 deletions

View File

@ -549,14 +549,6 @@ static void event_deinit_core(bool reinit)
if (reinit)
event_command(EVENT_CMD_DRIVERS_DEINIT);
/* per-core saves: restore the original path so the config is not affected */
if(settings->sort_savefiles_enable)
strlcpy(global->dir.savefile, orig_savefile_dir,
sizeof(global->dir.savefile));
if(settings->sort_savestates_enable)
strlcpy(global->dir.savestate, orig_savestate_dir,
sizeof(global->dir.savestate));
/* auto overrides: reload the original config */
if(global->overrides_active)
{
@ -727,14 +719,6 @@ static bool event_init_core(void)
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
/* per-core saves: save the original path */
if(orig_savefile_dir[0] == '\0')
strlcpy(orig_savefile_dir, global->dir.savefile,
sizeof(orig_savefile_dir));
if(orig_savestate_dir[0] == '\0')
strlcpy(orig_savestate_dir, global->dir.savestate,
sizeof(orig_savestate_dir));
/* auto overrides: apply overrides */
if(settings->auto_overrides_enable)
{

View File

@ -750,9 +750,9 @@ static char buildbot_server_url[] = "";
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/ios/latest/";
#elif defined(OSX)
#if defined(__x86_64__)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/osx-x86_64/latest/";
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/apple/osx/x86_64/latest/";
#elif defined(__i386__) || defined(__i486__) || defined(__i686__)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/osx-i386/latest/";
static char buildbot_server_url[] = "http://bot.libretro.com/nightly/apple/osx/x86/latest/";
#else
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/osx-ppc/latest/";
#endif
@ -875,4 +875,3 @@ static const struct retro_keybind retro_keybinds_rest[] = {
#endif
#endif

View File

@ -725,10 +725,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
break;
case RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY:
*(const char**)data = *global->dir.savefile ?
global->dir.savefile : NULL;
*(const char**)data = *current_savefile_dir ?
current_savefile_dir : NULL;
RARCH_LOG("Environ SAVE_DIRECTORY: \"%s\".\n",
global->dir.savefile);
current_savefile_dir);
break;
case RETRO_ENVIRONMENT_GET_USERNAME:
@ -1253,4 +1253,3 @@ bool rarch_environment_cb(unsigned cmd, void *data)
return true;
}

View File

@ -41,14 +41,6 @@ void main_exit_save_config(void)
if (settings->config_save_on_exit && *global->path.config)
{
/* restore original paths in case per-core organization is enabled */
if (settings->sort_savefiles_enable && orig_savefile_dir[0] != '\0')
strlcpy(global->dir.savefile, orig_savefile_dir,
sizeof(global->dir.savefile));
if (settings->sort_savestates_enable && orig_savestate_dir[0] != '\0')
strlcpy(global->dir.savestate, orig_savestate_dir,
sizeof(global->dir.savestate));
/* Save last core-specific config to the default config location,
* needed on consoles for core switching and reusing last good
* config for new cores.

View File

@ -54,8 +54,9 @@
#include "menu/menu_hash.h"
#endif
char orig_savestate_dir[PATH_MAX_LENGTH];
char orig_savefile_dir[PATH_MAX_LENGTH];
char current_savestate_dir[PATH_MAX_LENGTH];
char current_savefile_dir[PATH_MAX_LENGTH];
/* Descriptive names for options without short variant. Please keep the name in
sync with the option name. Order does not matter. */
@ -333,62 +334,66 @@ void set_paths_redirect(const char *path)
/* per-core saves: append the library_name to the save location */
if (settings->sort_savefiles_enable && global->dir.savefile[0] != '\0')
{
strlcpy(orig_savefile_dir,global->dir.savefile,
sizeof(orig_savefile_dir));
fill_pathname_dir(
global->dir.savefile,
fill_pathname_join(
current_savefile_dir,
global->dir.savefile,
info->info.library_name,
sizeof(global->dir.savefile));
/* If path doesn't exist, try to create it,
* if everything fails revert to the original path. */
if(!path_is_directory(global->dir.savefile) && global->dir.savefile[0] != '\0')
if(!path_is_directory(current_savefile_dir) && current_savefile_dir[0] != '\0')
{
path_mkdir(global->dir.savefile);
if(!path_is_directory(global->dir.savefile))
path_mkdir(current_savefile_dir);
if(!path_is_directory(current_savefile_dir))
{
RARCH_LOG("Reverting savefile directory to %s\n", orig_savefile_dir);
strlcpy(global->dir.savefile,
orig_savefile_dir,
sizeof(global->dir.savefile));
RARCH_LOG("Reverting savefile directory to %s\n", global->dir.savefile);
strlcpy(current_savefile_dir,
global->dir.savefile,
sizeof(current_savefile_dir));
}
}
}
else
strlcpy(current_savefile_dir,
global->dir.savefile,
sizeof(current_savefile_dir));
/* per-core states: append the library_name to the save location */
if (settings->sort_savestates_enable && global->dir.savestate[0] != '\0')
{
strlcpy(orig_savestate_dir,
global->dir.savestate,
sizeof(orig_savestate_dir));
fill_pathname_dir(global->dir.savestate,
fill_pathname_join(
current_savestate_dir,
global->dir.savestate,
info->info.library_name,
sizeof(global->dir.savestate));
/* If path doesn't exist, try to create it.
* If everything fails, revert to the original path. */
if(!path_is_directory(global->dir.savestate) && global->dir.savestate[0] != '\0')
if(!path_is_directory(current_savestate_dir) && current_savestate_dir[0] != '\0')
{
path_mkdir(global->dir.savestate);
if(!path_is_directory(global->dir.savestate))
path_mkdir(current_savestate_dir);
if(!path_is_directory(current_savestate_dir))
{
RARCH_LOG("Reverting savestate directory to %s\n", orig_savestate_dir);
strlcpy(global->dir.savestate,
orig_savestate_dir,
sizeof(global->dir.savestate));
RARCH_LOG("Reverting savestate directory to %s\n", global->dir.savestate);
strlcpy(current_savestate_dir,
global->dir.savestate,
sizeof(current_savestate_dir));
}
}
}
else
strlcpy(current_savestate_dir,
global->dir.savestate,
sizeof(current_savestate_dir));
}
if(path_is_directory(global->dir.savefile))
strlcpy(global->name.savefile, global->dir.savefile,
if(path_is_directory(current_savefile_dir))
strlcpy(global->name.savefile, current_savefile_dir,
sizeof(global->name.savefile));
if(path_is_directory(global->dir.savestate))
strlcpy(global->name.savestate, global->dir.savestate,
if(path_is_directory(current_savestate_dir))
strlcpy(global->name.savestate, current_savestate_dir,
sizeof(global->name.savestate));
if (path_is_directory(global->name.savefile))

View File

@ -207,8 +207,8 @@ int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t le
enum rarch_content_type rarch_path_is_media_type(const char *path);
extern char orig_savestate_dir[PATH_MAX_LENGTH];
extern char orig_savefile_dir[PATH_MAX_LENGTH];
extern char current_savestate_dir[PATH_MAX_LENGTH];
extern char current_savefile_dir[PATH_MAX_LENGTH];
extern bool orig_system_dir_empty;
#ifdef __cplusplus