diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/basis_universal/SCsub | 1 | ||||
-rw-r--r-- | modules/csg/csg.cpp | 6 | ||||
-rw-r--r-- | modules/enet/doc_classes/NetworkedMultiplayerENet.xml | 2 | ||||
-rw-r--r-- | modules/gdnavigation/gd_navigation_server.cpp | 2 | ||||
-rw-r--r-- | modules/gdnavigation/nav_map.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gdscript.cpp | 102 | ||||
-rw-r--r-- | modules/gdscript/gdscript.h | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 2 |
10 files changed, 66 insertions, 60 deletions
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub index d7342358d7..63324e920b 100644 --- a/modules/basis_universal/SCsub +++ b/modules/basis_universal/SCsub @@ -22,7 +22,6 @@ tool_sources = [ "basisu_resample_filters.cpp", "basisu_resampler.cpp", "basisu_ssim.cpp", - "basisu_tool.cpp", "lodepng.cpp", ] tool_sources = [thirdparty_dir + file for file in tool_sources] diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index e9ca1d3e5b..4e39cce4a5 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -88,7 +88,7 @@ static inline bool ray_intersects_triangle(const Vector3 &p_from, const Vector3 Vector3 edge2 = p_vertices[2] - p_vertices[0]; Vector3 h = p_dir.cross(edge2); real_t a = edge1.dot(h); - // Check if ray is parrallel to triangle. + // Check if ray is parallel to triangle. if (Math::is_zero_approx(a)) return false; real_t f = 1.0 / a; @@ -818,7 +818,7 @@ void CSGBrushOperation::Build2DFaces::_add_vertex_idx_sorted(Vector<int> &r_vert int axis = 0; if (Math::abs(new_point.x - first_point.x) < Math::abs(new_point.y - first_point.y)) axis = 1; - // Add it to the beginnig or the end appropriately. + // Add it to the beginning or the end appropriately. if (new_point[axis] < first_point[axis]) r_vertex_indices.insert(0, p_new_vertex_index); else @@ -868,7 +868,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_ inner_idx = p_segment_indices[segments + segments / 2 - sorted_idx]; } - // Find the mergable faces. + // Find the mergeable faces. Vector<int> merge_faces_idx; Vector<Face2D> merge_faces; Vector<int> merge_faces_inner_vertex_idx; diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 456bf649d2..860da32a22 100644 --- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -134,7 +134,7 @@ The compression method used for network packets. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all. </member> <member name="dtls_verify" type="bool" setter="set_dtls_verify_enabled" getter="is_dtls_verify_enabled" default="true"> - Enable or disable certiticate verification when [member use_dtls] [code]true[/code]. + Enable or disable certificate verification when [member use_dtls] [code]true[/code]. </member> <member name="refuse_new_connections" type="bool" setter="set_refuse_new_connections" getter="is_refusing_new_connections" override="true" default="false" /> <member name="server_relay" type="bool" setter="set_server_relay_enabled" getter="is_server_relay_enabled" default="true"> diff --git a/modules/gdnavigation/gd_navigation_server.cpp b/modules/gdnavigation/gd_navigation_server.cpp index 4db10cda78..a1f6ddfedc 100644 --- a/modules/gdnavigation/gd_navigation_server.cpp +++ b/modules/gdnavigation/gd_navigation_server.cpp @@ -41,7 +41,7 @@ */ /// Creates a struct for each function and a function that once called creates -/// an instance of that struct with the submited parameters. +/// an instance of that struct with the submitted parameters. /// Then, that struct is stored in an array; the `sync` function consume that array. #define COMMAND_1(F_NAME, T_0, D_0) \ diff --git a/modules/gdnavigation/nav_map.cpp b/modules/gdnavigation/nav_map.cpp index 00a1901c48..338e49eb9f 100644 --- a/modules/gdnavigation/nav_map.cpp +++ b/modules/gdnavigation/nav_map.cpp @@ -691,7 +691,7 @@ void NavMap::sync() { const float ecm_squared(edge_connection_margin * edge_connection_margin); #define LEN_TOLLERANCE 0.1 #define DIR_TOLLERANCE 0.9 - // In front of tollerance + // In front of tolerance #define IFO_TOLLERANCE 0.5 // Find the compatible near edges. @@ -715,7 +715,7 @@ void NavMap::sync() { Vector3 rel_centers = other_edge.edge_center - edge.edge_center; if (ecm_squared > rel_centers.length_squared() // Are enough closer? && ABS(edge.edge_len_squared - other_edge.edge_len_squared) < LEN_TOLLERANCE // Are the same length? - && ABS(edge.edge_dir.dot(other_edge.edge_dir)) > DIR_TOLLERANCE // Are alligned? + && ABS(edge.edge_dir.dot(other_edge.edge_dir)) > DIR_TOLLERANCE // Are aligned? && ABS(rel_centers.normalized().dot(edge.edge_dir)) < IFO_TOLLERANCE // Are one in front the other? ) { // The edges can be connected diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index d31823d632..2882567b0a 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -597,52 +597,7 @@ Error GDScript::reload(bool p_keep_state) { _set_subclass_path(E->get(), path); } - // Copy the base rpc methods so we don't mask their IDs. - rpc_functions.clear(); - rpc_variables.clear(); - if (base.is_valid()) { - rpc_functions = base->rpc_functions; - rpc_variables = base->rpc_variables; - } - - GDScript *cscript = this; - Map<StringName, Ref<GDScript> >::Element *sub_E = subclasses.front(); - while (cscript) { - // RPC Methods - for (Map<StringName, GDScriptFunction *>::Element *E = cscript->member_functions.front(); E; E = E->next()) { - if (E->get()->get_rpc_mode() != MultiplayerAPI::RPC_MODE_DISABLED) { - ScriptNetData nd; - nd.name = E->key(); - nd.mode = E->get()->get_rpc_mode(); - if (-1 == rpc_functions.find(nd)) { - rpc_functions.push_back(nd); - } - } - } - // RSet - for (Map<StringName, MemberInfo>::Element *E = cscript->member_indices.front(); E; E = E->next()) { - if (E->get().rpc_mode != MultiplayerAPI::RPC_MODE_DISABLED) { - ScriptNetData nd; - nd.name = E->key(); - nd.mode = E->get().rpc_mode; - if (-1 == rpc_variables.find(nd)) { - rpc_variables.push_back(nd); - } - } - } - - if (cscript != this) - sub_E = sub_E->next(); - - if (sub_E) - cscript = sub_E->get().ptr(); - else - cscript = NULL; - } - - // Sort so we are 100% that they are always the same. - rpc_functions.sort_custom<SortNetData>(); - rpc_variables.sort_custom<SortNetData>(); + _init_rpc_methods_properties(); return OK; } @@ -715,8 +670,8 @@ StringName GDScript::get_rset_property(const uint16_t p_rset_member_id) const { } MultiplayerAPI::RPCMode GDScript::get_rset_mode_by_id(const uint16_t p_rset_member_id) const { - ERR_FAIL_COND_V(p_rset_member_id >= rpc_functions.size(), MultiplayerAPI::RPC_MODE_DISABLED); - return rpc_functions[p_rset_member_id].mode; + ERR_FAIL_COND_V(p_rset_member_id >= rpc_variables.size(), MultiplayerAPI::RPC_MODE_DISABLED); + return rpc_variables[p_rset_member_id].mode; } MultiplayerAPI::RPCMode GDScript::get_rset_mode(const StringName &p_variable) const { @@ -881,6 +836,8 @@ Error GDScript::load_byte_code(const String &p_path) { _set_subclass_path(E->get(), path); } + _init_rpc_methods_properties(); + return OK; } @@ -1030,6 +987,55 @@ void GDScript::_save_orphaned_subclasses() { } } +void GDScript::_init_rpc_methods_properties() { + // Copy the base rpc methods so we don't mask their IDs. + rpc_functions.clear(); + rpc_variables.clear(); + if (base.is_valid()) { + rpc_functions = base->rpc_functions; + rpc_variables = base->rpc_variables; + } + + GDScript *cscript = this; + Map<StringName, Ref<GDScript> >::Element *sub_E = subclasses.front(); + while (cscript) { + // RPC Methods + for (Map<StringName, GDScriptFunction *>::Element *E = cscript->member_functions.front(); E; E = E->next()) { + if (E->get()->get_rpc_mode() != MultiplayerAPI::RPC_MODE_DISABLED) { + ScriptNetData nd; + nd.name = E->key(); + nd.mode = E->get()->get_rpc_mode(); + if (-1 == rpc_functions.find(nd)) { + rpc_functions.push_back(nd); + } + } + } + // RSet + for (Map<StringName, MemberInfo>::Element *E = cscript->member_indices.front(); E; E = E->next()) { + if (E->get().rpc_mode != MultiplayerAPI::RPC_MODE_DISABLED) { + ScriptNetData nd; + nd.name = E->key(); + nd.mode = E->get().rpc_mode; + if (-1 == rpc_variables.find(nd)) { + rpc_variables.push_back(nd); + } + } + } + + if (cscript != this) + sub_E = sub_E->next(); + + if (sub_E) + cscript = sub_E->get().ptr(); + else + cscript = NULL; + } + + // Sort so we are 100% that they are always the same. + rpc_functions.sort_custom<SortNetData>(); + rpc_variables.sort_custom<SortNetData>(); +} + GDScript::~GDScript() { for (Map<StringName, GDScriptFunction *>::Element *E = member_functions.front(); E; E = E->next()) { memdelete(E->get()); diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 456cd88fe6..2b8158fe55 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -136,6 +136,7 @@ class GDScript : public Script { bool _update_exports(); void _save_orphaned_subclasses(); + void _init_rpc_methods_properties(); protected: bool _get(const StringName &p_name, Variant &r_ret) const; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 353c79d6bb..b42fcba7d3 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1517,7 +1517,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s } } - //consecutively do unary opeators + //consecutively do unary operators for (int i = expr_pos - 1; i >= next_op; i--) { OperatorNode *op = alloc_node<OperatorNode>(); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 050fdbcb07..1f3ba2f20b 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1148,8 +1148,8 @@ StringName VisualScript::get_rset_property(const uint16_t p_rset_property_id) co } MultiplayerAPI::RPCMode VisualScript::get_rset_mode_by_id(const uint16_t p_rset_variable_id) const { - ERR_FAIL_COND_V(p_rset_variable_id >= rpc_functions.size(), MultiplayerAPI::RPC_MODE_DISABLED); - return rpc_functions[p_rset_variable_id].mode; + ERR_FAIL_COND_V(p_rset_variable_id >= rpc_variables.size(), MultiplayerAPI::RPC_MODE_DISABLED); + return rpc_variables[p_rset_variable_id].mode; } MultiplayerAPI::RPCMode VisualScript::get_rset_mode(const StringName &p_variable) const { diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 23d1c8ccc0..c52315a477 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1141,7 +1141,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { } } - //consecutively do unary opeators + //consecutively do unary operators for (int i = expr_pos - 1; i >= next_op; i--) { OperatorNode *op = alloc_node<OperatorNode>(); |