58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
diff -Naur blender-4.5.2/intern/ghost/intern/GHOST_SystemPathsWin32.cc blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemPathsWin32.cc
|
|
--- blender-4.5.2/intern/ghost/intern/GHOST_SystemPathsWin32.cc 2025-08-26 12:22:19.943652700 +0300
|
|
+++ blender-4.5.2-patched/intern/ghost/intern/GHOST_SystemPathsWin32.cc 2025-08-26 12:23:14.601345800 +0300
|
|
@@ -19,6 +19,44 @@
|
|
|
|
GHOST_SystemPathsWin32::~GHOST_SystemPathsWin32() {}
|
|
|
|
+#if defined(__MINGW32__)
|
|
+
|
|
+const char *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
|
|
+{
|
|
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
|
|
+
|
|
+ char temppath[MAX_PATH + 1];
|
|
+ char temppath2[MAX_PATH + 1];
|
|
+ const char *binary_dir = getBinaryDir();
|
|
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
|
|
+ char* lastslash = strrchr(temppath2, '\\');
|
|
+ if (lastslash != NULL) {
|
|
+ *lastslash = '\0';
|
|
+ }
|
|
+ snprintf(temppath, sizeof(temppath), "%s\\..\\share\\blender\\%s", temppath2, versionstr);
|
|
+ temppath[MAX_PATH] = '\0';
|
|
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
|
|
+ return (char*)knownpath;
|
|
+}
|
|
+
|
|
+const char *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
|
|
+{
|
|
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
|
|
+
|
|
+ char temppath[MAX_PATH + 1];
|
|
+ char temppath2[MAX_PATH + 1];
|
|
+ const char *binary_dir = getBinaryDir();
|
|
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
|
|
+ char* lastslash = strrchr(temppath2, '\\');
|
|
+ if (lastslash != NULL) {
|
|
+ *lastslash = '\0';
|
|
+ }
|
|
+ snprintf(temppath, sizeof(temppath), "%s\\..\\..\\home\\%s\\.blender\\%s", temppath2, getenv("USERNAME") ?: "unknown", versionstr);
|
|
+ temppath[MAX_PATH] = '\0';
|
|
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
|
|
+ return (char*)knownpath;
|
|
+}
|
|
+#else
|
|
const char *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
|
|
{
|
|
const char *system_dir = nullptr;
|
|
@@ -62,6 +100,8 @@
|
|
return user_dir;
|
|
}
|
|
|
|
+#endif
|
|
+
|
|
const char *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const
|
|
{
|
|
const char *special_dir = nullptr;
|