(XDK) Make initial 'default paths' creation of dirs work

on XDK
This commit is contained in:
twinaphex 2013-05-06 00:30:45 +02:00
parent fd27c1b7ca
commit af867b008d
5 changed files with 45 additions and 21 deletions

View File

@ -76,15 +76,17 @@ static bool libretro_install_core(const char *path_prefix,
return true;
}
#define MAKE_DIR(x) {\
if (!path_is_directory((x)))\
{\
RARCH_WARN("Directory \"%s\" does not exists, creating\n", (x));\
if (mkdir((x), 0777) != 0)\
{\
RARCH_ERR("Could not create directory \"%s\"\n", (x));\
}\
}\
#define MAKE_DIR(x, name) { \
RARCH_LOG("Checking directory name %s [%s]\n", name, x); \
if (strlen(x) > 0) \
if (!path_is_directory((x)) )\
{ \
RARCH_WARN("Directory \"%s\" does not exists, creating\n", (x)); \
if (mkdir((x), 0777) != 0) \
{ \
RARCH_ERR("Could not create directory \"%s\"\n", (x)); \
} \
} \
}
int rarch_main(int argc, char *argv[])
@ -104,11 +106,11 @@ int rarch_main(int argc, char *argv[])
get_environment_settings(argc, argv);
MAKE_DIR(default_paths.port_dir);
MAKE_DIR(default_paths.system_dir);
MAKE_DIR(default_paths.savestate_dir);
MAKE_DIR(default_paths.sram_dir);
MAKE_DIR(default_paths.input_presets_dir);
MAKE_DIR(default_paths.port_dir, "port_dir");
MAKE_DIR(default_paths.system_dir, "system_dir");
MAKE_DIR(default_paths.savestate_dir, "savestate_dir");
MAKE_DIR(default_paths.sram_dir, "sram_dir");
MAKE_DIR(default_paths.input_presets_dir, "input_presets_dir");
config_load();
@ -134,7 +136,7 @@ int rarch_main(int argc, char *argv[])
// Save new libretro core path to config file and exit
if (path_file_exists(core_exe_path))
if (libretro_install_core(path_prefix, core_exe_path))
#ifdef _XBOX1
#ifdef _XBOX
g_extern.system.shutdown = g_extern.system.shutdown;
#else
g_extern.system.shutdown = true;

View File

@ -225,7 +225,7 @@ static void get_environment_settings(int argc, char *argv[])
strlcpy(g_extern.config_path, "D:\\retroarch.cfg", sizeof(g_extern.config_path));
#endif
strlcpy(default_paths.savestate_dir, "D:\\savestates", sizeof(default_paths.savestate_dir));
strlcpy(default_paths.sram_dir, "D:\\sram", sizeof(default_paths.sram_dir));
strlcpy(default_paths.sram_dir, "D:\\savefiles", sizeof(default_paths.sram_dir));
strlcpy(default_paths.system_dir, "D:\\system", sizeof(default_paths.system_dir));
strlcpy(default_paths.filesystem_root_dir, "D:", sizeof(default_paths.filesystem_root_dir));
strlcpy(default_paths.filebrowser_startup_dir, "D:", sizeof(default_paths.filebrowser_startup_dir));
@ -243,7 +243,7 @@ static void get_environment_settings(int argc, char *argv[])
strlcpy(g_extern.config_path, "game:\\retroarch.cfg", sizeof(g_extern.config_path));
#endif
strlcpy(default_paths.savestate_dir, "game:\\savestates", sizeof(default_paths.savestate_dir));
strlcpy(default_paths.sram_dir, "game:\\sram", sizeof(default_paths.sram_dir));
strlcpy(default_paths.sram_dir, "game:\\savefiles", sizeof(default_paths.sram_dir));
strlcpy(default_paths.system_dir, "game:\\system", sizeof(default_paths.system_dir));
strlcpy(default_paths.filebrowser_startup_dir, "game:", sizeof(default_paths.filebrowser_startup_dir));
#endif

View File

@ -36,8 +36,6 @@ Info messages:
Debug info messages:
Gamma Correction:
Hardware filtering shader #1:
SRAM Path Enable:
Savestate Path Enable:
</ItemsText>
</Properties>
<XuiListItem>
@ -292,6 +290,18 @@ Savestate Path Enable:
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -36,8 +36,6 @@ Info messages:
Debug info messages:
Gamma Correction:
Hardware filtering shader #1:
SRAM Path Enable:
Savestate Path Enable:
</ItemsText>
</Properties>
<XuiListItem>
@ -268,6 +266,18 @@ Savestate Path Enable:
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -19,6 +19,7 @@
#ifdef _MSC_VER
#undef UNICODE // Do not bother with UNICODE at this time.
#include <direct.h>
#include <stddef.h>
#include <math.h>
@ -31,6 +32,7 @@ typedef int ssize_t;
#endif
#endif
#define mkdir(dirname, unused) _mkdir(dirname)
#define snprintf _snprintf
#define strtoull _strtoui64
#undef strcasecmp