mirror of https://github.com/bjornbytes/lovr.git
Fix initial write directory set on windows;
This commit is contained in:
parent
f9e2b1441e
commit
331c5efa49
|
@ -127,7 +127,7 @@ const char* lovrFilesystemGetSaveDirectory() {
|
||||||
int lovrFilesystemGetSize(const char* path) {
|
int lovrFilesystemGetSize(const char* path) {
|
||||||
PHYSFS_file* handle = PHYSFS_openRead(path);
|
PHYSFS_file* handle = PHYSFS_openRead(path);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int length = PHYSFS_fileLength(handle);
|
int length = PHYSFS_fileLength(handle);
|
||||||
|
@ -210,12 +210,10 @@ int lovrFilesystemSetIdentity(const char* identity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* sep = PHYSFS_getDirSeparator();
|
|
||||||
|
|
||||||
lovrFilesystemGetAppdataDirectory(state.savePathFull, LOVR_PATH_MAX);
|
lovrFilesystemGetAppdataDirectory(state.savePathFull, LOVR_PATH_MAX);
|
||||||
PHYSFS_setWriteDir(state.savePathFull);
|
PHYSFS_setWriteDir(state.savePathFull);
|
||||||
snprintf(state.savePathRelative, LOVR_PATH_MAX, "LOVR%s%s", sep, identity);
|
snprintf(state.savePathRelative, LOVR_PATH_MAX, "LOVR/%s", identity);
|
||||||
snprintf(state.savePathFull, LOVR_PATH_MAX, "%s%s%s", state.savePathFull, sep, state.savePathRelative);
|
snprintf(state.savePathFull, LOVR_PATH_MAX, "%s/%s", state.savePathFull, state.savePathRelative);
|
||||||
PHYSFS_mkdir(state.savePathRelative);
|
PHYSFS_mkdir(state.savePathRelative);
|
||||||
if (!PHYSFS_setWriteDir(state.savePathFull)) {
|
if (!PHYSFS_setWriteDir(state.savePathFull)) {
|
||||||
error("Could not set write directory");
|
error("Could not set write directory");
|
||||||
|
|
Loading…
Reference in New Issue