Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2014-12-25 17:12:56 +0300
committerJens Verwiebe <info@jensverwiebe.de>2014-12-25 17:12:56 +0300
commitc1f54bcdcca40ef74fac2fa269824f612b4ed8d8 (patch)
tree7de2a04db49f8f5b22301b7d57bbea08cafb1f4e /source
parent3e034831de809cf0d65aec9f4d5b445f875dcff2 (diff)
OSX: revive GHOST_HACK_getFirstFile cause it breaks things on older OSX versions.
Dunno exactly why this was done earlier, but propose not to remove code not understood.
Diffstat (limited to 'source')
-rw-r--r--source/creator/creator.c17
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp10
2 files changed, 26 insertions, 1 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index efef3093730..cc804946f6b 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1001,7 +1001,7 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d
BLI_end_threaded_malloc();
}
else {
- printf("\nError: no blend loaded. cannot use '-a'.\n");
+ printf("\nError: no blend loaded. GPG_ghost.cpp use '-a'.\n");
}
return 0;
}
@@ -1551,7 +1551,22 @@ int main(
#endif
setCallbacks();
+
+#if defined(__APPLE__) && !defined(WITH_PYTHON_MODULE)
+/* patch to ignore argument finder gives us (pid?) */
+ if (argc == 2 && strncmp(argv[1], "-psn_", 5) == 0) {
+ extern int GHOST_HACK_getFirstFile(char buf[]);
+ static char firstfilebuf[512];
+
+ argc = 1;
+ if (GHOST_HACK_getFirstFile(firstfilebuf)) {
+ argc = 2;
+ argv[1] = firstfilebuf;
+ }
+ }
+#endif
+
#ifdef __FreeBSD__
fpsetmask(0);
#endif
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 3e87b4a06d5..915fe614957 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -80,6 +80,10 @@ extern "C"
#include "IMB_imbuf.h"
#include "IMB_moviecache.h"
+#ifdef __APPLE__
+ int GHOST_HACK_getFirstFile(char buf[]);
+#endif
+
// For BLF
#include "BLF_api.h"
#include "BLF_translation.h"
@@ -297,6 +301,12 @@ static void get_filename(int argc, char **argv, char *filename)
if (BLI_exists(argv[argc-1])) {
BLI_strncpy(filename, argv[argc-1], FILE_MAX);
}
+ if (::strncmp(argv[argc-1], "-psn_", 5)==0) {
+ static char firstfilebuf[512];
+ if (GHOST_HACK_getFirstFile(firstfilebuf)) {
+ BLI_strncpy(filename, firstfilebuf, FILE_MAX);
+ }
+ }
}
srclen -= ::strlen("MacOS/blenderplayer");