| diff -Naur blender-2.77a-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp blender-2.77a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp |
| --- blender-2.77a-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2016-03-16 15:57:57.000000000 +0300 |
| +++ blender-2.77a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2016-07-12 13:40:38.182595000 +0300 |
| @@ -69,6 +69,44 @@ |
| { |
| } |
| |
| +#if defined(__MINGW32__) |
| + |
| +const GHOST_TUns8 *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 GHOST_TUns8 *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 (GHOST_TUns8*)knownpath; |
| +} |
| + |
| +const GHOST_TUns8 *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 GHOST_TUns8 *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 (GHOST_TUns8*)knownpath; |
| +} |
| +#else |
| const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const |
| { |
| static char knownpath[MAX_PATH * 3 + 128] = {0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/ |
| @@ -105,6 +143,8 @@ |
| return NULL; |
| } |
| |
| +#endif |
| + |
| const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const |
| { |
| GUID folderid; |