summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/export/export.cpp25
-rw-r--r--platform/osx/os_osx.mm6
2 files changed, 27 insertions, 4 deletions
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 657a899367..23ca1e3fb9 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -541,7 +541,9 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
} else {
String pack_path = EditorSettings::get_singleton()->get_cache_dir().plus_file(pkg_name + ".pck");
- Error err = save_pack(p_preset, pack_path);
+
+ Vector<SharedObject> shared_objects;
+ Error err = save_pack(p_preset, pack_path, &shared_objects);
if (err == OK) {
zipOpenNewFileInZip(dst_pkg_zip,
@@ -567,11 +569,32 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
break;
zipWriteInFileInZip(dst_pkg_zip, buf, r);
}
+
zipCloseFileInZip(dst_pkg_zip);
memdelete(pf);
} else {
err = ERR_CANT_OPEN;
}
+
+ //add shared objects
+ for (int i = 0; i < shared_objects.size(); i++) {
+ Vector<uint8_t> file = FileAccess::get_file_as_array(shared_objects[i].path);
+ ERR_CONTINUE(file.empty());
+
+ zipOpenNewFileInZip(dst_pkg_zip,
+ (pkg_name + ".app/Contents/MacOS/").plus_file(shared_objects[i].path.get_file()).utf8().get_data(),
+ NULL,
+ NULL,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ Z_DEFLATED,
+ Z_DEFAULT_COMPRESSION);
+
+ zipWriteInFileInZip(dst_pkg_zip, file.ptr(), file.size());
+ zipCloseFileInZip(dst_pkg_zip);
+ }
}
}
}
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index a16391c30f..d8dd2eb1db 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1013,7 +1013,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
backing:NSBackingStoreBuffered
defer:NO];
- ERR_FAIL_COND(window_object == nil, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(window_object == nil, ERR_UNAVAILABLE);
window_view = [[GodotContentView alloc] init];
@@ -1100,11 +1100,11 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
#undef ADD_ATTR2
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
- ERR_FAIL_COND(pixelFormat == nil, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(pixelFormat == nil, ERR_UNAVAILABLE);
context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
- ERR_FAIL_COND(context == nil, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(context == nil, ERR_UNAVAILABLE);
[context setView:window_view];