From 80e1585a6e9af686ebc1ad3cd04e1a558a75f418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 7 Jun 2021 10:17:32 +0200 Subject: [PATCH] Style: Cleanup uses of double spaces between words Or after punctuation. Tried to leave third-party stuff alone, unless it has been heavily modified for Godot. (cherry picked from commit c1c76850cb47c0f8451fce6353958006e95b2cda) --- core/math/quick_hull.cpp | 2 +- doc/classes/Control.xml | 4 +- doc/classes/PrimitiveMesh.xml | 2 +- editor/spatial_editor_gizmos.cpp | 51 ------------------- misc/hooks/canonicalize_filename.sh | 2 +- modules/bullet/space_bullet.cpp | 2 +- modules/fbx/data/fbx_mesh_data.cpp | 4 +- .../GodotSharp/GodotSharp/Core/Vector2.cs | 2 +- .../GodotSharp/GodotSharp/Core/Vector3.cs | 4 +- modules/theora/video_stream_theora.cpp | 8 +-- .../doc_classes/VisualScript.xml | 2 +- platform/android/java/gradlew.bat | 4 +- .../android/java/lib/res/values/strings.xml | 2 +- platform/android/plugin/godot_plugin_config.h | 4 +- platform/windows/context_gl_windows.cpp | 2 +- scene/gui/grid_container.cpp | 2 +- scene/resources/material.cpp | 6 +-- servers/audio/effects/reverb.cpp | 2 +- .../physics/joints/generic_6dof_joint_sw.h | 6 +-- 19 files changed, 30 insertions(+), 81 deletions(-) diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index d43789a9fa2..879e4d36c5f 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -112,7 +112,7 @@ Error QuickHull::build(const Vector &p_points, Geometry::MeshData &r_me } } - //fourth vertex is the one most further away from the plane + //fourth vertex is the one most further away from the plane { real_t maxd = 0; diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index eacab8cbda8..ceacbc320ef 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -829,7 +829,7 @@ Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. - Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. + Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. @@ -841,7 +841,7 @@ Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [code]ui_left[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one. - Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [code]ui_right[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. + Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [code]ui_right[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 7d73fd8b9ed..ab50c6af900 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -24,7 +24,7 @@ - Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. + Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index f5b4781f81e..e5da10832f4 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -1681,61 +1681,10 @@ void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { surface_tool->add_color(bonecolor); surface_tool->add_vertex(points[(j + 1) % 4]); } - - /* - bones[0]=parent; - surface_tool->add_bones(bones); - surface_tool->add_weights(weights); - surface_tool->add_color(Color(0.4,1,0.4,0.4)); - surface_tool->add_vertex(v0); - bones[0]=i; - surface_tool->add_bones(bones); - surface_tool->add_weights(weights); - surface_tool->add_color(Color(0.4,1,0.4,0.4)); - surface_tool->add_vertex(v1); -*/ } else { grests.write[i] = skel->get_bone_rest(i); bones.write[0] = i; } - /* - Transform t = grests[i]; - t.orthonormalize(); - - for (int i=0;i<6;i++) { - - - Vector3 face_points[4]; - - for (int j=0;j<4;j++) { - - float v[3]; - v[0]=1.0; - v[1]=1-2*((j>>1)&1); - v[2]=v[1]*(1-2*(j&1)); - - for (int k=0;k<3;k++) { - - if (i<3) - face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1); - else - face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1); - } - } - - for(int j=0;j<4;j++) { - surface_tool->add_bones(bones); - surface_tool->add_weights(weights); - surface_tool->add_color(Color(1.0,0.4,0.4,0.4)); - surface_tool->add_vertex(t.xform(face_points[j]*0.04)); - surface_tool->add_bones(bones); - surface_tool->add_weights(weights); - surface_tool->add_color(Color(1.0,0.4,0.4,0.4)); - surface_tool->add_vertex(t.xform(face_points[(j+1)%4]*0.04)); - } - - } - */ } Ref m = surface_tool->commit(); diff --git a/misc/hooks/canonicalize_filename.sh b/misc/hooks/canonicalize_filename.sh index 5eecabf5bcf..5fcae6ee70c 100755 --- a/misc/hooks/canonicalize_filename.sh +++ b/misc/hooks/canonicalize_filename.sh @@ -13,7 +13,7 @@ # There should be no need to change anything below this line. # Canonicalize by recursively following every symlink in every component of the -# specified filename. This should reproduce the results of the GNU version of +# specified filename. This should reproduce the results of the GNU version of # readlink with the -f option. # # Reference: http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 57232311ee1..ed1542161b0 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -460,7 +460,7 @@ real_t SpaceBullet::get_param(PhysicsServer::SpaceParameter p_param) { case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: default: - WARN_PRINTS("The SpaceBullet doesn't support this get parameter (" + itos(p_param) + "), 0 is returned."); + WARN_PRINT("The SpaceBullet doesn't support this get parameter (" + itos(p_param) + "), 0 is returned."); return 0.f; } } diff --git a/modules/fbx/data/fbx_mesh_data.cpp b/modules/fbx/data/fbx_mesh_data.cpp index 2706a6c1a98..bae75edd0fb 100644 --- a/modules/fbx/data/fbx_mesh_data.cpp +++ b/modules/fbx/data/fbx_mesh_data.cpp @@ -1136,8 +1136,8 @@ HashMap FBXMeshData::extract_per_vertex_data( } const int vertex_index = get_vertex_from_polygon_vertex(p_mesh_indices, polygon_vertex_index); ERR_FAIL_COND_V_MSG(vertex_index < 0, (HashMap()), "FBX file corrupted: #ERR8"); - ERR_FAIL_COND_V_MSG(vertex_index >= p_vertex_count, (HashMap()), "FBX file seems corrupted: #ERR9.") - ERR_FAIL_COND_V_MSG(p_mapping_data.index[polygon_vertex_index] < 0, (HashMap()), "FBX file seems corrupted: #ERR10.") + ERR_FAIL_COND_V_MSG(vertex_index >= p_vertex_count, (HashMap()), "FBX file seems corrupted: #ERR9.") + ERR_FAIL_COND_V_MSG(p_mapping_data.index[polygon_vertex_index] < 0, (HashMap()), "FBX file seems corrupted: #ERR10.") ERR_FAIL_COND_V_MSG(p_mapping_data.index[polygon_vertex_index] >= (int)p_mapping_data.data.size(), (HashMap()), "FBX file seems corrupted: #ERR11.") aggregate_vertex_data[vertex_index].push_back({ polygon_id, p_mapping_data.data[p_mapping_data.index[polygon_vertex_index]] }); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 99b16aa6409..1939547c2de 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -435,7 +435,7 @@ namespace Godot #if DEBUG if (!normal.IsNormalized()) { - throw new ArgumentException("Argument is not normalized", nameof(normal)); + throw new ArgumentException("Argument is not normalized", nameof(normal)); } #endif return 2 * Dot(normal) * normal - this; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 1fd7dc76e14..6c5496122fe 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -419,7 +419,7 @@ namespace Godot #if DEBUG if (!normal.IsNormalized()) { - throw new ArgumentException("Argument is not normalized", nameof(normal)); + throw new ArgumentException("Argument is not normalized", nameof(normal)); } #endif return 2.0f * Dot(normal) * normal - this; @@ -437,7 +437,7 @@ namespace Godot #if DEBUG if (!axis.IsNormalized()) { - throw new ArgumentException("Argument is not normalized", nameof(axis)); + throw new ArgumentException("Argument is not normalized", nameof(axis)); } #endif return new Basis(axis, phi).Xform(this); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index aa5775afd01..d47144da13b 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -302,7 +302,7 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) { } } - /* and now we have it all. initialize decoders */ + /* And now we have it all. Initialize decoders. */ if (theora_p) { td = th_decode_alloc(&ti, ts); px_fmt = ti.pixel_fmt; @@ -482,10 +482,10 @@ void VideoStreamPlaybackTheora::update(float p_delta) { //printf("frame time %f, play time %f, ready %i\n", (float)videobuf_time, get_time(), videobuf_ready); - /* is it already too old to be useful? This is only actually - useful cosmetically after a SIGSTOP. Note that we have to + /* is it already too old to be useful? This is only actually + useful cosmetically after a SIGSTOP. Note that we have to decode the frame even if we don't show it (for now) due to - keyframing. Soon enough libtheora will be able to deal + keyframing. Soon enough libtheora will be able to deal with non-keyframe seeks. */ if (videobuf_time >= get_time()) { diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index a6d30461bc3..6a095629454 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -4,7 +4,7 @@ A script implemented in the Visual Script programming environment. - A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. + A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. You are most likely to use this class via the Visual Script editor or when writing plugins for it. diff --git a/platform/android/java/gradlew.bat b/platform/android/java/gradlew.bat index f9553162f12..11cc30edb03 100644 --- a/platform/android/java/gradlew.bat +++ b/platform/android/java/gradlew.bat @@ -1,7 +1,7 @@ @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem Gradle startup script for Windows @rem @rem ########################################################################## @@ -75,7 +75,7 @@ if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd diff --git a/platform/android/java/lib/res/values/strings.xml b/platform/android/java/lib/res/values/strings.xml index 590b066d8ab..010006b81ea 100644 --- a/platform/android/java/lib/res/values/strings.xml +++ b/platform/android/java/lib/res/values/strings.xml @@ -6,7 +6,7 @@ Resume download Wi-Fi settings Verifying Download - XAPK File Validation Complete. Select OK to exit. + XAPK File Validation Complete. Select OK to exit. XAPK File Validation Failed. Pause Download Resume Download diff --git a/platform/android/plugin/godot_plugin_config.h b/platform/android/plugin/godot_plugin_config.h index e4cbaa2e7be..45e2da2cb85 100644 --- a/platform/android/plugin/godot_plugin_config.h +++ b/platform/android/plugin/godot_plugin_config.h @@ -37,8 +37,8 @@ /* The `config` section and fields are required and defined as follow: -- **name**: name of the plugin -- **binary_type**: can be either `local` or `remote`. The type affects the **binary** field +- **name**: name of the plugin. +- **binary_type**: can be either `local` or `remote`. The type affects the **binary** field. - **binary**: - if **binary_type** is `local`, then this should be the filename of the plugin `aar` file in the `res://android/plugins` directory (e.g: `MyPlugin.aar`). - if **binary_type** is `remote`, then this should be a declaration for a remote gradle binary (e.g: "org.godot.example:my-plugin:0.0.0"). diff --git a/platform/windows/context_gl_windows.cpp b/platform/windows/context_gl_windows.cpp index 737ed753d68..32200119da1 100644 --- a/platform/windows/context_gl_windows.cpp +++ b/platform/windows/context_gl_windows.cpp @@ -102,7 +102,7 @@ void ContextGL_Windows::swap_buffers() { if (vsync_via_compositor_now != vsync_via_compositor) { // The previous frame had a different operating mode than this - // frame. Set the 'vsync_via_compositor' member variable and the + // frame. Set the 'vsync_via_compositor' member variable and the // OpenGL swap interval to their proper values. set_use_vsync(true); } diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 75c1605e989..4bbc7861436 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -33,7 +33,7 @@ void GridContainer::_notification(int p_what) { switch (p_what) { case NOTIFICATION_SORT_CHILDREN: { - Map col_minw; // Max of min_width of all controls in each col (indexed by col). + Map col_minw; // Max of min_width of all controls in each col (indexed by col). Map row_minh; // Max of min_height of all controls in each row (indexed by row). Set col_expanded; // Columns which have the SIZE_EXPAND flag set. Set row_expanded; // Rows which have the SIZE_EXPAND flag set. diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a9ef274214e..89fcf9a9513 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -758,12 +758,12 @@ void SpatialMaterial::_update_shader() { code += "\t\tfloat current_layer_depth = 0.0;\n"; code += "\t\tvec2 P = view_dir.xy * depth_scale;\n"; code += "\t\tvec2 delta = P / num_layers;\n"; - code += "\t\tvec2 ofs = base_uv;\n"; - code += "\t\tfloat depth = textureLod(texture_depth, ofs,0.0).r;\n"; + code += "\t\tvec2 ofs = base_uv;\n"; + code += "\t\tfloat depth = textureLod(texture_depth, ofs, 0.0).r;\n"; code += "\t\tfloat current_depth = 0.0;\n"; code += "\t\twhile(current_depth < depth) {\n"; code += "\t\t\tofs -= delta;\n"; - code += "\t\t\tdepth = textureLod(texture_depth, ofs,0.0).r;\n"; + code += "\t\t\tdepth = textureLod(texture_depth, ofs, 0.0).r;\n"; code += "\t\t\tcurrent_depth += layer_depth;\n"; code += "\t\t}\n"; code += "\t\tvec2 prev_ofs = ofs + delta;\n"; diff --git a/servers/audio/effects/reverb.cpp b/servers/audio/effects/reverb.cpp index 5e5df226b10..d0a906a0944 100644 --- a/servers/audio/effects/reverb.cpp +++ b/servers/audio/effects/reverb.cpp @@ -287,7 +287,7 @@ void Reverb::update_parameters() { c.feedback = (room_offset + room_scale); } - float auxdmp = params.damp / 2.0 + 0.5; //only half the range (0.5 .. 1.0 is enough) + float auxdmp = params.damp / 2.0 + 0.5; //only half the range (0.5 .. 1.0 is enough) auxdmp *= auxdmp; c.damp = expf(-2.0 * Math_PI * auxdmp * 10000 / params.mix_rate); // 0 .. 10khz diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h index 52db3ba4734..f1f6182e71d 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.h +++ b/servers/physics/joints/generic_6dof_joint_sw.h @@ -81,7 +81,7 @@ public: //! temp_variables //!@{ - real_t m_currentLimitError; //! How much is violated this limit + real_t m_currentLimitError; //!< How much is violated this limit int m_currentLimit; //!< 0=free, 1=at lo limit, 2=at hi limit real_t m_accumulatedImpulse; //!@} @@ -113,7 +113,7 @@ public: return (m_enableMotor || m_currentLimit != 0); } - //! calculates error + //! calculates error /*! calculates m_currentLimit and m_currentLimitError. */ @@ -326,7 +326,7 @@ public: return &m_angularLimits[index]; } - //! Retrieves the limit informacion + //! Retrieves the limit informacion G6DOFTranslationalLimitMotorSW *getTranslationalLimitMotor() { return &m_linearLimits; }