diff options
Diffstat (limited to 'platform/osx/godot_main_osx.mm')
-rw-r--r-- | platform/osx/godot_main_osx.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm index 9d1a5566c9..6ccbaf896b 100644 --- a/platform/osx/godot_main_osx.mm +++ b/platform/osx/godot_main_osx.mm @@ -82,8 +82,17 @@ int main(int argc, char **argv) { #endif OS_OSX os; + Error err; + + if (os.open_with_filename != "") { + char *argv_c = (char *)malloc(os.open_with_filename.utf8().size()); + memcpy(argv_c, os.open_with_filename.utf8().get_data(), os.open_with_filename.utf8().size()); + err = Main::setup(argv[0], 1, &argv_c); + free(argv_c); + } else { + err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]); + } - Error err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]); if (err != OK) return 255; |