summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/haiku/os_haiku.cpp2
-rw-r--r--platform/javascript/export/export.cpp2
-rw-r--r--platform/javascript/os_javascript.cpp2
-rw-r--r--platform/osx/export/export.cpp25
-rw-r--r--platform/osx/os_osx.mm6
-rw-r--r--platform/server/os_server.cpp3
-rw-r--r--platform/windows/os_windows.cpp11
7 files changed, 41 insertions, 10 deletions
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index 2d1d976399..1ebadd337e 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -114,7 +114,7 @@ Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p
visual_server = memnew(VisualServerRaster(rasterizer));
- ERR_FAIL_COND(!visual_server, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);
// TODO: enable multithreaded VS
/*
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index ab7aa96372..a3514df05c 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -277,7 +277,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
splash.instance();
Error err = splash->load(splash_path);
if (err) {
- EditorNode::get_singleton()->show_warning(TTR("Could not read boot splash image file:") + "\n" + splash_path + "\n" + TTR("Using default boot splash image.");
+ EditorNode::get_singleton()->show_warning(TTR("Could not read boot splash image file:") + "\n" + splash_path + "\n" + TTR("Using default boot splash image."));
splash.unref();
}
}
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 665280df96..26fb380aed 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -429,7 +429,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
attributes.antialias = false;
attributes.majorVersion = 2;
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(NULL, &attributes);
- ERR_FAIL_COND(emscripten_webgl_make_context_current(ctx) != EMSCRIPTEN_RESULT_SUCCESS, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(emscripten_webgl_make_context_current(ctx) != EMSCRIPTEN_RESULT_SUCCESS, ERR_UNAVAILABLE);
video_mode = p_desired;
// can't fulfil fullscreen request due to browser security
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];
diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp
index e8d076322c..410fea153a 100644
--- a/platform/server/os_server.cpp
+++ b/platform/server/os_server.cpp
@@ -67,7 +67,7 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
spatial_sound_2d_server = memnew(SpatialSound2DServerSW);
spatial_sound_2d_server->init();
- ERR_FAIL_COND(!visual_server, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);
visual_server->init();
@@ -77,6 +77,7 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
return OK;
}
+
void OS_Server::finalize() {
if (main_loop)
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index a48ae8cc8c..22294005f6 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1633,6 +1633,13 @@ void OS_Windows::_update_window_style(bool repaint) {
Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
+ String path = p_path;
+
+ if (!FileAccess::exists(path)) {
+ //this code exists so gdnative can load .dll files from within the executable path
+ path = get_executable_path().get_base_dir().plus_file(p_path.get_file());
+ }
+
typedef DLL_DIRECTORY_COOKIE(WINAPI * PAddDllDirectory)(PCWSTR);
typedef BOOL(WINAPI * PRemoveDllDirectory)(DLL_DIRECTORY_COOKIE);
@@ -1643,10 +1650,10 @@ Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_han
DLL_DIRECTORY_COOKIE cookie;
if (p_also_set_library_path && has_dll_directory_api) {
- cookie = add_dll_directory(p_path.get_base_dir().c_str());
+ cookie = add_dll_directory(path.get_base_dir().c_str());
}
- p_library_handle = (void *)LoadLibraryExW(p_path.c_str(), NULL, (p_also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0);
+ p_library_handle = (void *)LoadLibraryExW(path.c_str(), NULL, (p_also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0);
if (p_also_set_library_path && has_dll_directory_api) {
remove_dll_directory(cookie);