diff options
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/doc_classes/GDNative.xml | 2 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/GDNativeLibrary.xml | 2 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/NativeScript.xml | 2 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/PluginScript.xml | 2 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/VideoStreamGDNative.xml | 2 | ||||
-rw-r--r-- | modules/gdnative/gdnative/aabb.cpp | 1 | ||||
-rw-r--r-- | modules/gdnative/gdnative/plane.cpp | 1 | ||||
-rw-r--r-- | modules/gdnative/gdnative/vector3.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.h | 15 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_singleton_editor.cpp | 11 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 21 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.h | 2 | ||||
-rw-r--r-- | modules/gdnative/register_types.cpp | 2 |
14 files changed, 44 insertions, 31 deletions
diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index 4bc149b119..405365ad68 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNative" inherits="RefCounted" version="4.0"> +<class name="GDNative" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 21df640ebc..66811467fc 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNativeLibrary" inherits="Resource" version="4.0"> +<class name="GDNativeLibrary" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> An external library containing functions or script classes to use in Godot. </brief_description> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index 221374a7a4..b752b66f7e 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NativeScript" inherits="Script" version="4.0"> +<class name="NativeScript" inherits="Script" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/doc_classes/PluginScript.xml b/modules/gdnative/doc_classes/PluginScript.xml index ec80ade394..1fe6d95d3b 100644 --- a/modules/gdnative/doc_classes/PluginScript.xml +++ b/modules/gdnative/doc_classes/PluginScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PluginScript" inherits="Script" version="4.0"> +<class name="PluginScript" inherits="Script" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/doc_classes/VideoStreamGDNative.xml b/modules/gdnative/doc_classes/VideoStreamGDNative.xml index dc64e8fc18..2b27556fab 100644 --- a/modules/gdnative/doc_classes/VideoStreamGDNative.xml +++ b/modules/gdnative/doc_classes/VideoStreamGDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoStreamGDNative" inherits="VideoStream" version="4.0"> +<class name="VideoStreamGDNative" inherits="VideoStream" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> <brief_description> [VideoStream] resource for for video formats implemented via GDNative. </brief_description> diff --git a/modules/gdnative/gdnative/aabb.cpp b/modules/gdnative/gdnative/aabb.cpp index 82aa7215b2..b8909433cc 100644 --- a/modules/gdnative/gdnative/aabb.cpp +++ b/modules/gdnative/gdnative/aabb.cpp @@ -31,6 +31,7 @@ #include "gdnative/aabb.h" #include "core/math/aabb.h" +#include "core/os/memory.h" static_assert(sizeof(godot_aabb) == sizeof(AABB), "AABB size mismatch"); diff --git a/modules/gdnative/gdnative/plane.cpp b/modules/gdnative/gdnative/plane.cpp index 9ac5cfb3b7..41fa0da5db 100644 --- a/modules/gdnative/gdnative/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -31,6 +31,7 @@ #include "gdnative/plane.h" #include "core/math/plane.h" +#include "core/os/memory.h" static_assert(sizeof(godot_plane) == sizeof(Plane), "Plane size mismatch"); diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 26e94d7e5c..37c88c3cca 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -31,6 +31,8 @@ #include "gdnative/vector3.h" #include "core/math/vector3.h" +#include "core/math/vector3i.h" +#include "core/os/memory.h" static_assert(sizeof(godot_vector3) == sizeof(Vector3), "Vector3 size mismatch"); static_assert(sizeof(godot_vector3i) == sizeof(Vector3i), "Vector3i size mismatch"); diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index f94464826e..66c8ab7b37 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -29,10 +29,13 @@ /*************************************************************************/ #ifdef TOOLS_ENABLED + #include "gdnative_library_editor_plugin.h" -#include "gdnative.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_node.h" #include "editor/editor_scale.h" +#include "gdnative.h" void GDNativeLibraryEditor::edit(Ref<GDNativeLibrary> p_library) { library = p_library; @@ -315,7 +318,6 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { NativePlatformConfig platform_ios; platform_ios.name = "iOS"; - platform_ios.entries.push_back("armv7"); platform_ios.entries.push_back("arm64"); platform_ios.entries.push_back("x86_64"); // iOS can use both Static and Dynamic libraries. @@ -408,10 +410,10 @@ void GDNativeLibraryEditorPlugin::make_visible(bool p_visible) { } } -GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin(EditorNode *p_node) { +GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin() { library_editor = memnew(GDNativeLibraryEditor); library_editor->set_custom_minimum_size(Size2(0, 250 * EDSCALE)); - button = p_node->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor); + button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor); button->hide(); } diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h index 27848893fa..797695366c 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.h +++ b/modules/gdnative/gdnative_library_editor_plugin.h @@ -32,8 +32,14 @@ #define GDNATIVE_LIBRARY_EDITOR_PLUGIN_H #ifdef TOOLS_ENABLED -#include "editor/editor_node.h" + +#include "editor/editor_plugin.h" #include "gdnative.h" +#include "scene/gui/control.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/tree.h" + +class EditorFileDialog; class GDNativeLibraryEditor : public Control { GDCLASS(GDNativeLibraryEditor, Control); @@ -96,7 +102,6 @@ class GDNativeLibraryEditorPlugin : public EditorPlugin { GDCLASS(GDNativeLibraryEditorPlugin, EditorPlugin); GDNativeLibraryEditor *library_editor = nullptr; - EditorNode *editor = nullptr; Button *button = nullptr; public: @@ -106,7 +111,9 @@ public: virtual bool handles(Object *p_node) const override; virtual void make_visible(bool p_visible) override; - GDNativeLibraryEditorPlugin(EditorNode *p_node); + GDNativeLibraryEditorPlugin(); }; -#endif + +#endif // TOOLS_ENABLED + #endif // GDNATIVE_LIBRARY_EDITOR_PLUGIN_H diff --git a/modules/gdnative/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp index 6eb412eccb..ce1f41bdf1 100644 --- a/modules/gdnative/gdnative_library_singleton_editor.cpp +++ b/modules/gdnative/gdnative_library_singleton_editor.cpp @@ -32,6 +32,7 @@ #include "gdnative_library_singleton_editor.h" #include "gdnative.h" +#include "core/config/project_settings.h" #include "editor/editor_node.h" Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFileSystemDirectory *p_dir) { @@ -182,10 +183,12 @@ void GDNativeLibrarySingletonEditor::_item_edited() { } void GDNativeLibrarySingletonEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible_in_tree()) { - _update_libraries(); - } + switch (p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: { + if (is_visible_in_tree()) { + _update_libraries(); + } + } break; } } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 5d5414c694..95976a8827 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -763,17 +763,19 @@ Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p return Variant(); } -void NativeScriptInstance::notification(int p_notification) { +void NativeScriptInstance::notification(int p_what) { #ifdef DEBUG_ENABLED - if (p_notification == MainLoop::NOTIFICATION_CRASH) { - if (current_method_call != StringName()) { - ERR_PRINT("NativeScriptInstance detected crash on method: " + current_method_call); - current_method_call = ""; - } + switch (p_what) { + case MainLoop::NOTIFICATION_CRASH: { + if (current_method_call != StringName()) { + ERR_PRINT("NativeScriptInstance detected crash on method: " + current_method_call); + current_method_call = ""; + } + } break; } #endif - Variant value = p_notification; + Variant value = p_what; const Variant *args[1] = { &value }; Callable::CallError error; call("_notification", args, 1, error); @@ -1639,7 +1641,6 @@ void NativeReloadNode::_bind_methods() { void NativeReloadNode::_notification(int p_what) { #ifdef TOOLS_ENABLED - switch (p_what) { case NOTIFICATION_APPLICATION_FOCUS_OUT: { if (unloaded) { @@ -1672,7 +1673,6 @@ void NativeReloadNode::_notification(int p_what) { } unloaded = true; - } break; case NOTIFICATION_APPLICATION_FOCUS_IN: { @@ -1736,10 +1736,7 @@ void NativeReloadNode::_notification(int p_what) { for (Set<StringName>::Element *R = libs_to_remove.front(); R; R = R->next()) { NSL->library_gdnatives.erase(R->get()); } - } break; - default: { - }; } #endif } diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 6c47d35abc..2d01de5832 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -209,7 +209,7 @@ public: virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); - virtual void notification(int p_notification); + virtual void notification(int p_what); String to_string(bool *r_valid); virtual Ref<Script> get_script() const; diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index fb682beccc..1121fd0e03 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -226,7 +226,7 @@ static void editor_init_callback() { EditorExport::get_singleton()->add_export_plugin(export_plugin); - EditorNode::get_singleton()->add_editor_plugin(memnew(GDNativeLibraryEditorPlugin(EditorNode::get_singleton()))); + EditorNode::get_singleton()->add_editor_plugin(memnew(GDNativeLibraryEditorPlugin)); } #endif |