diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/space_bullet.cpp | 4 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXDocumentUtil.cpp | 2 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXProperties.cpp | 5 | ||||
-rw-r--r-- | modules/fbx/fbx_parser/FBXProperties.h | 1 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 60 | ||||
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 2 |
6 files changed, 45 insertions, 29 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index ceae3be8bc..bdaec4a09e 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -1235,6 +1235,10 @@ bool SpaceBullet::recover_from_penetration(RigidBodyBullet *p_body, const btTran continue; } + if (kin_shape.shape->getShapeType() == EMPTY_SHAPE_PROXYTYPE) { + continue; + } + btTransform shape_transform = p_body_position * kin_shape.transform; shape_transform.getOrigin() += r_delta_recover_movement; diff --git a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp index 835b66ab23..df50a32c39 100644 --- a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp +++ b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp @@ -160,7 +160,7 @@ const PropertyTable *GetPropertyTable(const Document &doc, DOMWarning("property table (Properties70) not found", element); } if (templateProps) { - return templateProps; + return new const PropertyTable(templateProps); } else { return new const PropertyTable(); } diff --git a/modules/fbx/fbx_parser/FBXProperties.cpp b/modules/fbx/fbx_parser/FBXProperties.cpp index ea023b2629..84e71512d6 100644 --- a/modules/fbx/fbx_parser/FBXProperties.cpp +++ b/modules/fbx/fbx_parser/FBXProperties.cpp @@ -149,6 +149,11 @@ PropertyTable::PropertyTable() { } // ------------------------------------------------------------------------------------------------ +PropertyTable::PropertyTable(const PropertyTable *templateProps) : + templateProps(templateProps), element() { +} + +// ------------------------------------------------------------------------------------------------ PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *templateProps) : templateProps(templateProps), element(element) { const ScopePtr scope = GetRequiredScope(element); diff --git a/modules/fbx/fbx_parser/FBXProperties.h b/modules/fbx/fbx_parser/FBXProperties.h index 27cacfaf76..0595b25fa7 100644 --- a/modules/fbx/fbx_parser/FBXProperties.h +++ b/modules/fbx/fbx_parser/FBXProperties.h @@ -137,6 +137,7 @@ class PropertyTable { public: // in-memory property table with no source element PropertyTable(); + PropertyTable(const PropertyTable *templateProps); PropertyTable(const ElementPtr element, const PropertyTable *templateProps); ~PropertyTable(); diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 2a3202c0b8..f795bef59f 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1727,44 +1727,48 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) { if (S->get().size() == 0) { library_script_users.erase(S); - Map<String, Map<StringName, NativeScriptDesc>>::Element *L = library_classes.find(script->lib_path); - if (L) { - Map<StringName, NativeScriptDesc> classes = L->get(); - - for (Map<StringName, NativeScriptDesc>::Element *C = classes.front(); C; C = C->next()) { - // free property stuff first - for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = C->get().properties.front(); P; P = P.next()) { - if (P.get().getter.free_func) { - P.get().getter.free_func(P.get().getter.method_data); + Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path); + if (G && G->get()->get_library()->is_reloadable()) { + // ONLY if the library is marked as reloadable, and no more instances of its scripts exist do we unload the library + + // First remove meta data related to the library + Map<String, Map<StringName, NativeScriptDesc>>::Element *L = library_classes.find(script->lib_path); + if (L) { + Map<StringName, NativeScriptDesc> classes = L->get(); + + for (Map<StringName, NativeScriptDesc>::Element *C = classes.front(); C; C = C->next()) { + // free property stuff first + for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = C->get().properties.front(); P; P = P.next()) { + if (P.get().getter.free_func) { + P.get().getter.free_func(P.get().getter.method_data); + } + + if (P.get().setter.free_func) { + P.get().setter.free_func(P.get().setter.method_data); + } } - if (P.get().setter.free_func) { - P.get().setter.free_func(P.get().setter.method_data); + // free method stuff + for (Map<StringName, NativeScriptDesc::Method>::Element *M = C->get().methods.front(); M; M = M->next()) { + if (M->get().method.free_func) { + M->get().method.free_func(M->get().method.method_data); + } } - } - // free method stuff - for (Map<StringName, NativeScriptDesc::Method>::Element *M = C->get().methods.front(); M; M = M->next()) { - if (M->get().method.free_func) { - M->get().method.free_func(M->get().method.method_data); + // free constructor/destructor + if (C->get().create_func.free_func) { + C->get().create_func.free_func(C->get().create_func.method_data); } - } - // free constructor/destructor - if (C->get().create_func.free_func) { - C->get().create_func.free_func(C->get().create_func.method_data); + if (C->get().destroy_func.free_func) { + C->get().destroy_func.free_func(C->get().destroy_func.method_data); + } } - if (C->get().destroy_func.free_func) { - C->get().destroy_func.free_func(C->get().destroy_func.method_data); - } + library_classes.erase(script->lib_path); } - library_classes.erase(script->lib_path); - } - - Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path); - if (G && G->get()->get_library()->is_reloadable()) { + // now unload the library G->get()->terminate(); library_gdnatives.erase(G); } diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 1c7a168eba..6a91148575 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2014,6 +2014,8 @@ Error GDScriptCompiler::_parse_setter_getter(GDScript *p_script, const GDScriptP func_name = "@" + p_variable->identifier->name + "_getter"; } + codegen.function_name = func_name; + GDScriptDataType return_type; if (p_is_setter) { return_type.has_type = true; |