Save input map files to /config/inputs/
* Save input map files to /config/inputs/ (old folder is still compatible, will revert if file not found) * Reverted label to "undefine"
This commit is contained in:
18
file_io.cpp
18
file_io.cpp
@@ -543,6 +543,14 @@ int FileSaveConfig(const char *name, void *pBuffer, int size)
|
||||
return FileSave(path, pBuffer, size);
|
||||
}
|
||||
|
||||
int FileSaveJoymap(const char *name, void *pBuffer, int size)
|
||||
{
|
||||
char path[256] = { CONFIG_DIR"/inputs/" };
|
||||
FileCreatePath(path);
|
||||
strcat(path, name);
|
||||
return FileSave(path, pBuffer, size);
|
||||
}
|
||||
|
||||
int FileLoad(const char *name, void *pBuffer, int size)
|
||||
{
|
||||
if (name[0] != '/') sprintf(full_path, "%s/%s", getRootDir(), name);
|
||||
@@ -589,6 +597,16 @@ int FileLoadConfig(const char *name, void *pBuffer, int size)
|
||||
return FileLoad(path, pBuffer, size);
|
||||
}
|
||||
|
||||
int FileLoadJoymap(const char *name, void *pBuffer, int size)
|
||||
{
|
||||
char path[256] = { CONFIG_DIR"/inputs/" };
|
||||
strcat(path, name);
|
||||
int ret = FileLoad(path, pBuffer, size);
|
||||
if (!ret)
|
||||
return FileLoadConfig(name, pBuffer, size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int FileExists(const char *name)
|
||||
{
|
||||
return isPathRegularFile(name);
|
||||
|
||||
Reference in New Issue
Block a user