Fix initial write directory set on windows;
@@ -127,7 +127,7 @@ const char* lovrFilesystemGetSaveDirectory() {
int lovrFilesystemGetSize(const char* path) {
PHYSFS_file* handle = PHYSFS_openRead(path);
if (!handle) {
- return 1;
+ return -1;
}
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);
PHYSFS_setWriteDir(state.savePathFull);
- snprintf(state.savePathRelative, LOVR_PATH_MAX, "LOVR%s%s", sep, identity);
- snprintf(state.savePathFull, LOVR_PATH_MAX, "%s%s%s", state.savePathFull, sep, state.savePathRelative);
+ snprintf(state.savePathRelative, LOVR_PATH_MAX, "LOVR/%s", identity);
+ snprintf(state.savePathFull, LOVR_PATH_MAX, "%s/%s", state.savePathFull, state.savePathRelative);
PHYSFS_mkdir(state.savePathRelative);
if (!PHYSFS_setWriteDir(state.savePathFull)) {
error("Could not set write directory");
