diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/SCsub | 28 | ||||
-rw-r--r-- | modules/gdnative/gdnative/node_path.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/node_path.h | 2 |
5 files changed, 24 insertions, 14 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 98ae82bc5f..f5ab8221e3 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -511,12 +511,14 @@ void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) { mode = PhysicsServer::BODY_MODE_RIGID; set_axis_lock(axis_lock); // Reload axis lock _internal_set_mass(0 == mass ? 1 : mass); + scratch_space_override_modificator(); break; } case PhysicsServer::BODY_MODE_CHARACTER: { mode = PhysicsServer::BODY_MODE_CHARACTER; set_axis_lock(axis_lock); // Reload axis lock _internal_set_mass(0 == mass ? 1 : mass); + scratch_space_override_modificator(); break; } } diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 485bf4b9df..54d0672a5b 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -19,19 +19,27 @@ def _spaced(e): return e if e[-1] == '*' else e + ' ' def _build_gdnative_api_struct_header(api): - ext_wrappers = '' + gdnative_api_init_macro = [ + '\textern const godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct;' + ] for name in api['extensions']: - ext_wrappers += ' extern const godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct;' + gdnative_api_init_macro.append( + '\textern const godot_gdnative_ext_{0}_api_struct *_gdnative_wrapper_{0}_api_struct;'.format(name)) - ext_init = 'for (int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { ' - ext_init += 'switch (_gdnative_wrapper_api_struct->extensions[i]->type) {' + gdnative_api_init_macro.append('\t_gdnative_wrapper_api_struct = options->api_struct;') + gdnative_api_init_macro.append('\tfor (int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { ') + gdnative_api_init_macro.append('\t\tswitch (_gdnative_wrapper_api_struct->extensions[i]->type) {') for name in api['extensions']: - ext_init += 'case GDNATIVE_EXT_' + api['extensions'][name]['type'] + ': ' - ext_init += '_gdnative_wrapper_' + name + '_api_struct = (' + 'godot_gdnative_ext_' + name + '_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; break;' - - ext_init += '}' + gdnative_api_init_macro.append( + '\t\t\tcase GDNATIVE_EXT_%s:' % api['extensions'][name]['type']) + gdnative_api_init_macro.append( + '\t\t\t\t_gdnative_wrapper_{0}_api_struct = (godot_gdnative_ext_{0}_api_struct *)' + ' _gdnative_wrapper_api_struct->extensions[i];'.format(name)) + gdnative_api_init_macro.append('\t\t\t\tbreak;') + gdnative_api_init_macro.append('\t\t}') + gdnative_api_init_macro.append('\t}') out = [ '/* THIS FILE IS GENERATED DO NOT EDIT */', @@ -43,7 +51,7 @@ def _build_gdnative_api_struct_header(api): '#include <nativescript/godot_nativescript.h>', '#include <pluginscript/godot_pluginscript.h>', '', - '#define GDNATIVE_API_INIT(options) do { extern const godot_gdnative_api_struct *_gdnative_wrapper_api_struct;' + ext_wrappers + ' _gdnative_wrapper_api_struct = options->api_struct; ' + ext_init + ' } while (0)', + '#define GDNATIVE_API_INIT(options) do { \\\n' + ' \\\n'.join(gdnative_api_init_macro) + ' \\\n } while (0)', '', '#ifdef __cplusplus', 'extern "C" {', @@ -179,7 +187,7 @@ def _build_gdnative_wrapper_code(api): ] for name in api['extensions']: - out.append('godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct;') + out.append('godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct = 0;') out += [''] diff --git a/modules/gdnative/gdnative/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 2bd278e050..8dfe151f91 100644 --- a/modules/gdnative/gdnative/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -91,10 +91,10 @@ godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, co return dest; } -godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self) { +godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self) { godot_string dest; const NodePath *self = (const NodePath *)p_self; - memnew_placement(&dest, String(self->get_property())); + memnew_placement(&dest, String(self->get_concatenated_subnames())); return dest; } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 0438a196cf..488ed93206 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -2918,7 +2918,7 @@ ] }, { - "name": "godot_node_path_get_property", + "name": "godot_node_path_get_concatenated_subnames", "return_type": "godot_string", "arguments": [ ["const godot_node_path *", "p_self"] diff --git a/modules/gdnative/include/gdnative/node_path.h b/modules/gdnative/include/gdnative/node_path.h index 42446175d8..b5a59fd325 100644 --- a/modules/gdnative/include/gdnative/node_path.h +++ b/modules/gdnative/include/gdnative/node_path.h @@ -73,7 +73,7 @@ godot_int GDAPI godot_node_path_get_subname_count(const godot_node_path *p_self) godot_string GDAPI godot_node_path_get_subname(const godot_node_path *p_self, const godot_int p_idx); -godot_string GDAPI godot_node_path_get_property(const godot_node_path *p_self); +godot_string GDAPI godot_node_path_get_concatenated_subnames(const godot_node_path *p_self); godot_bool GDAPI godot_node_path_is_empty(const godot_node_path *p_self); |