mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
deploy-stub: chdir to Resources dir in GUI macOS app bundle
This prevents a common error of trying to load non-Panda3D assets without specifying $MAIN_DIR. We aren't currently making any guarantees about the cwd (which may in fact be / when launching from Finder), so I think this is safe.
This commit is contained in:
parent
b05ae1f762
commit
fc71fef27d
@ -522,6 +522,10 @@ int Py_FrozenMain(int argc, char **argv)
|
|||||||
// for ConfigPageManager to read out and assign to MAIN_DIR.
|
// for ConfigPageManager to read out and assign to MAIN_DIR.
|
||||||
sprintf(buffer, "%s/../Resources", dir);
|
sprintf(buffer, "%s/../Resources", dir);
|
||||||
set_main_dir(buffer);
|
set_main_dir(buffer);
|
||||||
|
|
||||||
|
// Finally, chdir to it, so that regular Python files are read from the
|
||||||
|
// right location.
|
||||||
|
chdir(buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
n = PyImport_ImportFrozenModule("__main__");
|
n = PyImport_ImportFrozenModule("__main__");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user