diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 08:45:41 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 08:45:41 +0100 |
commit | 394bb0ee2bcd863aed75e1c6799c4c8138dbf269 (patch) | |
tree | 05e28b1b54da3ac7939fc3529191390a8f7e66a2 | |
parent | e101305950883661f9c47d8e6c552355f5e1fc2e (diff) |
Fix various typos with codespell
Finally do the childs -> children rename too.
-rw-r--r-- | core/input/input.cpp | 2 | ||||
-rw-r--r-- | core/math/dynamic_bvh.cpp | 68 | ||||
-rw-r--r-- | core/math/dynamic_bvh.h | 28 | ||||
-rw-r--r-- | core/variant/array.cpp | 2 | ||||
-rw-r--r-- | doc/classes/RenderingServer.xml | 8 | ||||
-rwxr-xr-x | misc/scripts/codespell.sh | 7 | ||||
-rw-r--r-- | scene/main/canvas_item.cpp | 4 |
7 files changed, 61 insertions, 58 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index aa89facdd7..2e886f9093 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -904,7 +904,7 @@ void Input::parse_input_event(const Ref<InputEvent> &p_event) { // - If platform doesn't use buffering and event accumulation is disabled. // - If platform doesn't use buffering and the event type is not accumulable. // However, it wouldn't be reasonable to ask users to remember the full ruleset and be aware at all times - // of the possibilites of the target platform, project settings and engine internals, which may change + // of the possibilities of the target platform, project settings and engine internals, which may change // without prior notice. // Therefore, the guideline is, "don't send the same event object more than once per frame". WARN_PRINT_ONCE( diff --git a/core/math/dynamic_bvh.cpp b/core/math/dynamic_bvh.cpp index 4452445241..e1315d1c64 100644 --- a/core/math/dynamic_bvh.cpp +++ b/core/math/dynamic_bvh.cpp @@ -36,8 +36,8 @@ void DynamicBVH::_delete_node(Node *p_node) { void DynamicBVH::_recurse_delete_node(Node *p_node) { if (!p_node->is_leaf()) { - _recurse_delete_node(p_node->childs[0]); - _recurse_delete_node(p_node->childs[1]); + _recurse_delete_node(p_node->children[0]); + _recurse_delete_node(p_node->children[1]); } if (p_node == bvh_root) { bvh_root = nullptr; @@ -65,31 +65,31 @@ void DynamicBVH::_insert_leaf(Node *p_root, Node *p_leaf) { } else { if (!p_root->is_leaf()) { do { - p_root = p_root->childs[p_leaf->volume.select_by_proximity( - p_root->childs[0]->volume, - p_root->childs[1]->volume)]; + p_root = p_root->children[p_leaf->volume.select_by_proximity( + p_root->children[0]->volume, + p_root->children[1]->volume)]; } while (!p_root->is_leaf()); } Node *prev = p_root->parent; Node *node = _create_node_with_volume(prev, p_leaf->volume.merge(p_root->volume), nullptr); if (prev) { - prev->childs[p_root->get_index_in_parent()] = node; - node->childs[0] = p_root; + prev->children[p_root->get_index_in_parent()] = node; + node->children[0] = p_root; p_root->parent = node; - node->childs[1] = p_leaf; + node->children[1] = p_leaf; p_leaf->parent = node; do { if (!prev->volume.contains(node->volume)) { - prev->volume = prev->childs[0]->volume.merge(prev->childs[1]->volume); + prev->volume = prev->children[0]->volume.merge(prev->children[1]->volume); } else { break; } node = prev; } while (nullptr != (prev = node->parent)); } else { - node->childs[0] = p_root; + node->children[0] = p_root; p_root->parent = node; - node->childs[1] = p_leaf; + node->children[1] = p_leaf; p_leaf->parent = node; bvh_root = node; } @@ -103,14 +103,14 @@ DynamicBVH::Node *DynamicBVH::_remove_leaf(Node *leaf) { } else { Node *parent = leaf->parent; Node *prev = parent->parent; - Node *sibling = parent->childs[1 - leaf->get_index_in_parent()]; + Node *sibling = parent->children[1 - leaf->get_index_in_parent()]; if (prev) { - prev->childs[parent->get_index_in_parent()] = sibling; + prev->children[parent->get_index_in_parent()] = sibling; sibling->parent = prev; _delete_node(parent); while (prev) { const Volume pb = prev->volume; - prev->volume = prev->childs[0]->volume.merge(prev->childs[1]->volume); + prev->volume = prev->children[0]->volume.merge(prev->children[1]->volume); if (pb.is_not_equal_to(prev->volume)) { prev = prev->parent; } else { @@ -129,8 +129,8 @@ DynamicBVH::Node *DynamicBVH::_remove_leaf(Node *leaf) { void DynamicBVH::_fetch_leaves(Node *p_root, LocalVector<Node *> &r_leaves, int p_depth) { if (p_root->is_internal() && p_depth) { - _fetch_leaves(p_root->childs[0], r_leaves, p_depth - 1); - _fetch_leaves(p_root->childs[1], r_leaves, p_depth - 1); + _fetch_leaves(p_root->children[0], r_leaves, p_depth - 1); + _fetch_leaves(p_root->children[1], r_leaves, p_depth - 1); _delete_node(p_root); } else { r_leaves.push_back(p_root); @@ -195,8 +195,8 @@ void DynamicBVH::_bottom_up(Node **leaves, int p_count) { } Node *n[] = { leaves[minidx[0]], leaves[minidx[1]] }; Node *p = _create_node_with_volume(nullptr, n[0]->volume.merge(n[1]->volume), nullptr); - p->childs[0] = n[0]; - p->childs[1] = n[1]; + p->children[0] = n[0]; + p->children[1] = n[1]; n[0]->parent = p; n[1]->parent = p; leaves[minidx[0]] = p; @@ -241,10 +241,10 @@ DynamicBVH::Node *DynamicBVH::_top_down(Node **leaves, int p_count, int p_bu_thr } Node *node = _create_node_with_volume(nullptr, vol, nullptr); - node->childs[0] = _top_down(&leaves[0], partition, p_bu_threshold); - node->childs[1] = _top_down(&leaves[partition], p_count - partition, p_bu_threshold); - node->childs[0]->parent = node; - node->childs[1]->parent = node; + node->children[0] = _top_down(&leaves[0], partition, p_bu_threshold); + node->children[1] = _top_down(&leaves[partition], p_count - partition, p_bu_threshold); + node->children[0]->parent = node; + node->children[1]->parent = node; return (node); } else { _bottom_up(leaves, p_count); @@ -260,23 +260,23 @@ DynamicBVH::Node *DynamicBVH::_node_sort(Node *n, Node *&r) { if (p > n) { const int i = n->get_index_in_parent(); const int j = 1 - i; - Node *s = p->childs[j]; + Node *s = p->children[j]; Node *q = p->parent; - ERR_FAIL_COND_V(n != p->childs[i], nullptr); + ERR_FAIL_COND_V(n != p->children[i], nullptr); if (q) { - q->childs[p->get_index_in_parent()] = n; + q->children[p->get_index_in_parent()] = n; } else { r = n; } s->parent = n; p->parent = n; n->parent = q; - p->childs[0] = n->childs[0]; - p->childs[1] = n->childs[1]; - n->childs[0]->parent = p; - n->childs[1]->parent = p; - n->childs[i] = p; - n->childs[j] = s; + p->children[0] = n->children[0]; + p->children[1] = n->children[1]; + n->children[0]->parent = p; + n->children[1]->parent = p; + n->children[i] = p; + n->children[j] = s; SWAP(p->volume, n->volume); return (p); } @@ -320,7 +320,7 @@ void DynamicBVH::optimize_incremental(int passes) { Node *node = bvh_root; unsigned bit = 0; while (node->is_internal()) { - node = _node_sort(node, bvh_root)->childs[(opath >> bit) & 1]; + node = _node_sort(node, bvh_root)->children[(opath >> bit) & 1]; bit = (bit + 1) & (sizeof(unsigned) * 8 - 1); } _update(node); @@ -396,8 +396,8 @@ void DynamicBVH::remove(const ID &p_id) { void DynamicBVH::_extract_leaves(Node *p_node, List<ID> *r_elements) { if (p_node->is_internal()) { - _extract_leaves(p_node->childs[0], r_elements); - _extract_leaves(p_node->childs[1], r_elements); + _extract_leaves(p_node->children[0], r_elements); + _extract_leaves(p_node->children[1], r_elements); } else { ID id; id.node = p_node; diff --git a/core/math/dynamic_bvh.h b/core/math/dynamic_bvh.h index 46bf56ae58..21b5340aaa 100644 --- a/core/math/dynamic_bvh.h +++ b/core/math/dynamic_bvh.h @@ -182,21 +182,21 @@ private: Volume volume; Node *parent = nullptr; union { - Node *childs[2]; + Node *children[2]; void *data; }; - _FORCE_INLINE_ bool is_leaf() const { return childs[1] == nullptr; } + _FORCE_INLINE_ bool is_leaf() const { return children[1] == nullptr; } _FORCE_INLINE_ bool is_internal() const { return (!is_leaf()); } _FORCE_INLINE_ int get_index_in_parent() const { ERR_FAIL_COND_V(!parent, 0); - return (parent->childs[1] == this) ? 1 : 0; + return (parent->children[1] == this) ? 1 : 0; } void get_max_depth(int depth, int &maxdepth) { if (is_internal()) { - childs[0]->get_max_depth(depth + 1, maxdepth); - childs[1]->get_max_depth(depth + 1, maxdepth); + children[0]->get_max_depth(depth + 1, maxdepth); + children[1]->get_max_depth(depth + 1, maxdepth); } else { maxdepth = MAX(maxdepth, depth); } @@ -205,7 +205,7 @@ private: // int count_leaves() const { if (is_internal()) { - return childs[0]->count_leaves() + childs[1]->count_leaves(); + return children[0]->count_leaves() + children[1]->count_leaves(); } else { return (1); } @@ -216,8 +216,8 @@ private: } Node() { - childs[0] = nullptr; - childs[1] = nullptr; + children[0] = nullptr; + children[1] = nullptr; } }; @@ -350,8 +350,8 @@ void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) { stack = aux_stack.ptr(); threshold = aux_stack.size() - 2; } - stack[depth++] = n->childs[0]; - stack[depth++] = n->childs[1]; + stack[depth++] = n->children[0]; + stack[depth++] = n->children[1]; } else { if (r_result(n->data)) { return; @@ -406,8 +406,8 @@ void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Ve stack = aux_stack.ptr(); threshold = aux_stack.size() - 2; } - stack[depth++] = n->childs[0]; - stack[depth++] = n->childs[1]; + stack[depth++] = n->children[0]; + stack[depth++] = n->children[1]; } else { if (r_result(n->data)) { return; @@ -463,8 +463,8 @@ void DynamicBVH::ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResu stack = aux_stack.ptr(); threshold = aux_stack.size() - 2; } - stack[depth++] = node->childs[0]; - stack[depth++] = node->childs[1]; + stack[depth++] = node->children[0]; + stack[depth++] = node->children[1]; } else { if (r_result(node->data)) { return; diff --git a/core/variant/array.cpp b/core/variant/array.cpp index d3c5ca801f..2d7dff0b27 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -246,7 +246,7 @@ void Array::assign(const Array &p_array) { ERR_FAIL_COND_MSG(ce.error, vformat(R"(Unable to convert array index %i from "%s" to "%s".)", i, Variant::get_type_name(value->get_type()), Variant::get_type_name(typed.type))); } } else if (Variant::can_convert_strict(source_typed.type, typed.type)) { - // from primitives to different convertable primitives + // from primitives to different convertible primitives for (int i = 0; i < size; i++) { const Variant *value = source + i; Callable::CallError ce; diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index f92ea255cc..4e3a1bc0ef 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -58,14 +58,14 @@ <param index="6" name="near_transition" type="float" /> <param index="7" name="amount" type="float" /> <description> - Sets the parameters to use with the dof blur effect. These parameters take on the same meaning as their counterparts in [CameraAttributesPractical]. + Sets the parameters to use with the DOF blur effect. These parameters take on the same meaning as their counterparts in [CameraAttributesPractical]. </description> </method> <method name="camera_attributes_set_dof_blur_bokeh_shape"> <return type="void" /> <param index="0" name="shape" type="int" enum="RenderingServer.DOFBokehShape" /> <description> - Sets the shape of the dof bokeh pattern. Different shapes may be used to acheive artistic effect, or to meet performance targets. For more detail on available options see [enum DOFBokehShape]. + Sets the shape of the DOF bokeh pattern. Different shapes may be used to achieve artistic effect, or to meet performance targets. For more detail on available options see [enum DOFBokehShape]. </description> </method> <method name="camera_attributes_set_dof_blur_quality"> @@ -73,7 +73,7 @@ <param index="0" name="quality" type="int" enum="RenderingServer.DOFBlurQuality" /> <param index="1" name="use_jitter" type="bool" /> <description> - Sets the quality level of the dof blur effect to one of the options in [enum DOFBlurQuality]. [param use_jitter] can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy. + Sets the quality level of the DOF blur effect to one of the options in [enum DOFBlurQuality]. [param use_jitter] can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy. </description> </method> <method name="camera_attributes_set_exposure"> @@ -3272,7 +3272,7 @@ <param index="0" name="viewport" type="RID" /> <param index="1" name="mode" type="int" enum="RenderingServer.ViewportEnvironmentMode" /> <description> - Sets the viewport's environment mode which allows enabling or disabling rendering of 3D environment over 2D canvas. When disabled, 2D will not be affected by the environment. When enabled, 2D will be affected by the environment if the environment background mode is [constant ENV_BG_CANVAS]. The default behaviour is to inherit the setting from the viewport's parent. If the topmost parent is also set to [constant VIEWPORT_ENVIRONMENT_INHERIT], then the behavior will be the same as if it was set to [constant VIEWPORT_ENVIRONMENT_ENABLED]. + Sets the viewport's environment mode which allows enabling or disabling rendering of 3D environment over 2D canvas. When disabled, 2D will not be affected by the environment. When enabled, 2D will be affected by the environment if the environment background mode is [constant ENV_BG_CANVAS]. The default behavior is to inherit the setting from the viewport's parent. If the topmost parent is also set to [constant VIEWPORT_ENVIRONMENT_INHERIT], then the behavior will be the same as if it was set to [constant VIEWPORT_ENVIRONMENT_ENABLED]. </description> </method> <method name="viewport_set_fsr_sharpness"> diff --git a/misc/scripts/codespell.sh b/misc/scripts/codespell.sh index 44084b3348..0551492420 100755 --- a/misc/scripts/codespell.sh +++ b/misc/scripts/codespell.sh @@ -1,5 +1,8 @@ #!/bin/sh -SKIP_LIST="./.*,./bin,./editor/project_converter_3_to_4.cpp,./platform/web/node_modules,./platform/android/java/lib/src/com,./thirdparty,*.gen.*,*.po,*.pot,*.rc,package-lock.json,./core/string/locales.h,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md,./misc/dist/linux/org.godotengine.Godot.desktop,./misc/scripts/codespell.sh" -IGNORE_LIST="alo,ba,childs,complies,curvelinear,doubleclick,expct,fave,findn,gird,gud,inout,lod,nd,numer,ois,readded,ro,sav,statics,te,varius,varn,wan" +SKIP_LIST="./.*,./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md," +SKIP_LIST+="./core/string/locales.h,./editor/project_converter_3_to_4.cpp,./misc/scripts/codespell.sh," +SKIP_LIST+="./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json," + +IGNORE_LIST="alo,ba,complies,curvelinear,doubleclick,expct,fave,findn,gird,gud,inout,lod,nd,numer,ois,readded,ro,sav,statics,te,varius,varn,wan" codespell -w -q 3 -S "${SKIP_LIST}" -L "${IGNORE_LIST}" --builtin "clear,rare,en-GB_to_en-US" diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index cde3503bdf..541c7a0587 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -408,8 +408,8 @@ void CanvasItem::set_as_top_level(bool p_top_level) { void CanvasItem::_toplevel_changed() { // Inform children that toplevel status has changed on a parent. - int childs = get_child_count(); - for (int i = 0; i < childs; i++) { + int children = get_child_count(); + for (int i = 0; i < children; i++) { CanvasItem *child = Object::cast_to<CanvasItem>(get_child(i)); if (child) { child->_toplevel_changed_on_parent(); |