mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-26 00:33:45 +02:00
44 lines
1.1 KiB
Diff
44 lines
1.1 KiB
Diff
# Stops PhysFS from trying to get the base directory and user directory because it fails on Emscripten and on game consoles. Instead, we use sane defaults.
|
|
|
|
--- a/src/physfs.c
|
|
+++ b/src/physfs.c
|
|
@@ -1226,10 +1226,10 @@ int PHYSFS_init(const char *argv0)
|
|
|
|
if (!initializeMutexes()) goto initFailed;
|
|
|
|
- baseDir = calculateBaseDir(argv0);
|
|
+ baseDir = "/";
|
|
if (!baseDir) goto initFailed;
|
|
|
|
- userDir = __PHYSFS_platformCalcUserDir();
|
|
+ userDir = "/";
|
|
if (!userDir) goto initFailed;
|
|
|
|
/* Platform layer is required to append a dirsep. */
|
|
@@ -1367,13 +1367,11 @@ static int doDeinit(void)
|
|
|
|
if (baseDir != NULL)
|
|
{
|
|
- allocator.Free(baseDir);
|
|
baseDir = NULL;
|
|
} /* if */
|
|
|
|
if (userDir != NULL)
|
|
{
|
|
- allocator.Free(userDir);
|
|
userDir = NULL;
|
|
} /* if */
|
|
|
|
--- a/src/physfs_platform_posix.c
|
|
+++ b/src/physfs_platform_posix.c
|
|
@@ -109,8 +109,8 @@ char *__PHYSFS_platformCalcUserDir(void)
|
|
} /* if */
|
|
} /* if */
|
|
|
|
- if (retval == NULL)
|
|
- retval = getUserDirByUID();
|
|
+
|
|
+
|
|
|
|
return retval;
|
|
} /* __PHYSFS_platformCalcUserDir */
|