From 611c4998e8ffcc891d562f18428b5c8d9211751e Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 5 Dec 2020 00:37:41 +0100 Subject: [HTML5] EditorRunNative works with GDNative. This "breaks" our loading bar logic (libraries are not counted). Fixing it is non trivial and probably deserves investigating a different strategy. --- platform/javascript/os_javascript.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'platform/javascript/os_javascript.cpp') diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 80723d54fc..b3ef3fe573 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -43,6 +43,7 @@ #include "modules/websocket/remote_debugger_peer_websocket.h" #endif +#include #include #include @@ -187,6 +188,13 @@ bool OS_JavaScript::is_userfs_persistent() const { return idb_available; } +Error OS_JavaScript::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { + String path = p_path.get_file(); + p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ". Error: " + dlerror()); + return OK; +} + OS_JavaScript *OS_JavaScript::get_singleton() { return static_cast(OS::get_singleton()); } -- cgit v1.2.3 From dd9503dc1937e1469b2a6f8e145e80acbf2c7cbb Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 3 Dec 2020 17:15:14 +0100 Subject: [HTML5] Make GDNative support feature-based. This is suboptimal as it requires adding an extra compile flag, but rewriting how feature tags work is beyond the scope of this work. --- platform/javascript/os_javascript.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'platform/javascript/os_javascript.cpp') diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index b3ef3fe573..ebfcd7293e 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -128,12 +128,24 @@ int OS_JavaScript::get_process_id() const { } bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) { - if (p_feature == "HTML5" || p_feature == "web") + if (p_feature == "HTML5" || p_feature == "web") { return true; + } #ifdef JAVASCRIPT_EVAL_ENABLED - if (p_feature == "JavaScript") + if (p_feature == "JavaScript") { + return true; + } +#endif +#ifndef NO_THREADS + if (p_feature == "threads") { return true; + } +#endif +#if WASM_GDNATIVE + if (p_feature == "wasm32") { + return true; + } #endif return false; -- cgit v1.2.3