Browse Source

Don't use glfwGetOpenedFilename() when launched via command line on Mac.

tags/v1.1.6
Andrew Belt 5 years ago
parent
commit
3dbd084b33
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/main.cpp

+ 9
- 3
src/main.cpp View File

@@ -161,10 +161,16 @@ int main(int argc, char* argv[]) {
INFO("Initializing app");
appInit();

const char* openedFilename = glfwGetOpenedFilename();
if (openedFilename) {
patchPath = openedFilename;
// On Mac, use a hacked-in GLFW addition to get the launched path.
#if defined ARCH_MAC
// For some reason, launching from the command line sets glfwGetOpenedFilename(), so make sure we're running the app bundle.
if (asset::bundlePath != "") {
const char* openedFilename = glfwGetOpenedFilename();
if (openedFilename) {
patchPath = openedFilename;
}
}
#endif

if (!settings::headless) {
APP->patch->init(patchPath);


Loading…
Cancel
Save