Skip to content

Commit

Permalink
Merge pull request #1 from godotengine/master
Browse files Browse the repository at this point in the history
updating
  • Loading branch information
OXTyler committed Aug 7, 2023
2 parents c1c4b26 + f2acfb1 commit 0ae17aa
Show file tree
Hide file tree
Showing 184 changed files with 2,702 additions and 1,568 deletions.
16 changes: 8 additions & 8 deletions core/config/project_settings.cpp
Expand Up @@ -146,30 +146,30 @@ const PackedStringArray ProjectSettings::_trim_to_supported_features(const Packe
#endif // TOOLS_ENABLED

String ProjectSettings::localize_path(const String &p_path) const {
if (resource_path.is_empty() || (p_path.is_absolute_path() && !p_path.begins_with(resource_path))) {
return p_path.simplify_path();
String path = p_path.simplify_path();

if (resource_path.is_empty() || (path.is_absolute_path() && !path.begins_with(resource_path))) {
return path;
}

// Check if we have a special path (like res://) or a protocol identifier.
int p = p_path.find("://");
int p = path.find("://");
bool found = false;
if (p > 0) {
found = true;
for (int i = 0; i < p; i++) {
if (!is_ascii_alphanumeric_char(p_path[i])) {
if (!is_ascii_alphanumeric_char(path[i])) {
found = false;
break;
}
}
}
if (found) {
return p_path.simplify_path();
return path;
}

Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);

String path = p_path.replace("\\", "/").simplify_path();

if (dir->change_dir(path) == OK) {
String cwd = dir->get_current_dir();
cwd = cwd.replace("\\", "/");
Expand All @@ -187,7 +187,7 @@ String ProjectSettings::localize_path(const String &p_path) const {
cwd = cwd.path_join("");

if (!cwd.begins_with(res_path)) {
return p_path;
return path;
}

return cwd.replace_first(res_path, "res://");
Expand Down
1 change: 1 addition & 0 deletions core/config/project_settings.h
Expand Up @@ -43,6 +43,7 @@ class TypedArray;
class ProjectSettings : public Object {
GDCLASS(ProjectSettings, Object);
_THREAD_SAFE_CLASS_
friend class TestProjectSettingsInternalsAccessor;

public:
typedef HashMap<String, Variant> CustomMap;
Expand Down
2 changes: 1 addition & 1 deletion core/io/remote_filesystem_client.cpp
Expand Up @@ -270,7 +270,7 @@ Error RemoteFilesystemClient::_synchronize_with_server(const String &p_host, int
String file = temp_file_cache[i].path;

if (temp_file_cache[i].server_modified_time == 0 || server_disconnected) {
// File was removed, or server disconnected before tranferring it. Since it's no longer valid, remove anyway.
// File was removed, or server disconnected before transferring it. Since it's no longer valid, remove anyway.
_remove_file(file);
continue;
}
Expand Down
13 changes: 6 additions & 7 deletions core/math/delaunay_3d.h
Expand Up @@ -105,8 +105,8 @@ class Delaunay3D {
};

_FORCE_INLINE_ static void circum_sphere_compute(const Vector3 *p_points, Simplex *p_simplex) {
// the only part in the algorithm where there may be precision errors is this one, so ensure that
// we do it as maximum precision as possible
// The only part in the algorithm where there may be precision errors is this one,
// so ensure that we do it with the maximum precision possible.

R128 v0_x = p_points[p_simplex->points[0]].x;
R128 v0_y = p_points[p_simplex->points[0]].y;
Expand All @@ -121,7 +121,7 @@ class Delaunay3D {
R128 v3_y = p_points[p_simplex->points[3]].y;
R128 v3_z = p_points[p_simplex->points[3]].z;

//Create the rows of our "unrolled" 3x3 matrix
// Create the rows of our "unrolled" 3x3 matrix.
R128 row1_x = v1_x - v0_x;
R128 row1_y = v1_y - v0_y;
R128 row1_z = v1_z - v0_z;
Expand All @@ -138,19 +138,18 @@ class Delaunay3D {
R128 sq_lenght2 = row2_x * row2_x + row2_y * row2_y + row2_z * row2_z;
R128 sq_lenght3 = row3_x * row3_x + row3_y * row3_y + row3_z * row3_z;

//Compute the determinant of said matrix
// Compute the determinant of said matrix.
R128 determinant = row1_x * (row2_y * row3_z - row3_y * row2_z) - row2_x * (row1_y * row3_z - row3_y * row1_z) + row3_x * (row1_y * row2_z - row2_y * row1_z);

// Compute the volume of the tetrahedron, and precompute a scalar quantity for re-use in the formula
// Compute the volume of the tetrahedron, and precompute a scalar quantity for reuse in the formula.
R128 volume = determinant / R128(6.f);
R128 i12volume = R128(1.f) / (volume * R128(12.f));

R128 center_x = v0_x + i12volume * ((row2_y * row3_z - row3_y * row2_z) * sq_lenght1 - (row1_y * row3_z - row3_y * row1_z) * sq_lenght2 + (row1_y * row2_z - row2_y * row1_z) * sq_lenght3);
R128 center_y = v0_y + i12volume * (-(row2_x * row3_z - row3_x * row2_z) * sq_lenght1 + (row1_x * row3_z - row3_x * row1_z) * sq_lenght2 - (row1_x * row2_z - row2_x * row1_z) * sq_lenght3);
R128 center_z = v0_z + i12volume * ((row2_x * row3_y - row3_x * row2_y) * sq_lenght1 - (row1_x * row3_y - row3_x * row1_y) * sq_lenght2 + (row1_x * row2_y - row2_x * row1_y) * sq_lenght3);

//Once we know the center, the radius is clearly the distance to any vertex

// Once we know the center, the radius is clearly the distance to any vertex.
R128 rel1_x = center_x - v0_x;
R128 rel1_y = center_y - v0_y;
R128 rel1_z = center_z - v0_z;
Expand Down
5 changes: 2 additions & 3 deletions doc/classes/@GlobalScope.xml
Expand Up @@ -739,8 +739,7 @@
<return type="int" />
<param index="0" name="value" type="int" />
<description>
Returns the nearest equal or larger power of 2 for the integer [param value].
In other words, returns the smallest value [code]a[/code] where [code]a = pow(2, n)[/code] such that [code]value &lt;= a[/code] for some non-negative integer [code]n[/code].
Returns the smallest integer power of 2 that is greater than or equal to [param value].
[codeblock]
nearest_po2(3) # Returns 4
nearest_po2(4) # Returns 4
Expand All @@ -749,7 +748,7 @@
nearest_po2(0) # Returns 0 (this may not be expected)
nearest_po2(-1) # Returns 0 (this may not be expected)
[/codeblock]
[b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for negative values of [param value] (in reality, 1 is the smallest integer power of 2).
[b]Warning:[/b] Due to its implementation, this method returns [code]0[/code] rather than [code]1[/code] for values less than or equal to [code]0[/code], with an exception for [param value] being the smallest negative 64-bit integer ([code]-9223372036854775808[/code]) in which case the [param value] is returned unchanged.
</description>
</method>
<method name="pingpong">
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/EditorExportPlugin.xml
Expand Up @@ -44,7 +44,7 @@
<param index="1" name="path" type="String" />
<description>
Customize a scene. If changes are made to it, return the same or a new scene. Otherwise, return [code]null[/code]. If a new scene is returned, it is up to you to dispose of the old one.
Implementing this method is required if [method _begin_customize_resources] returns [code]true[/code].
Implementing this method is required if [method _begin_customize_scenes] returns [code]true[/code].
</description>
</method>
<method name="_end_customize_resources" qualifiers="virtual">
Expand Down
19 changes: 6 additions & 13 deletions doc/classes/Font.xml
Expand Up @@ -149,12 +149,6 @@
Returns number of faces in the TrueType / OpenType collection.
</description>
</method>
<method name="get_fallbacks" qualifiers="const">
<return type="Font[]" />
<description>
Returns array of fallback [Font]s.
</description>
</method>
<method name="get_font_name" qualifiers="const">
<return type="String" />
<description>
Expand Down Expand Up @@ -335,12 +329,11 @@
Sets LRU cache capacity for [code]draw_*[/code] methods.
</description>
</method>
<method name="set_fallbacks">
<return type="void" />
<param index="0" name="fallbacks" type="Font[]" />
<description>
Sets array of fallback [Font]s.
</description>
</method>
</methods>
<members>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s to use as a substitute if a glyph is not found in this current [Font].
If this array is empty in a [FontVariation], the [member FontVariation.base_font]'s fallbacks are used instead.
</member>
</members>
</class>
3 changes: 0 additions & 3 deletions doc/classes/FontFile.xml
Expand Up @@ -568,9 +568,6 @@
<member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()">
Contents of the dynamic font source file.
</member>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s.
</member>
<member name="fixed_size" type="int" setter="set_fixed_size" getter="get_fixed_size" default="0">
Font size, used only for the bitmap fonts.
</member>
Expand Down
3 changes: 0 additions & 3 deletions doc/classes/FontVariation.xml
Expand Up @@ -46,9 +46,6 @@
<member name="base_font" type="Font" setter="set_base_font" getter="get_base_font">
Base font used to create a variation. If not set, default [Theme] font is used.
</member>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s to use as a substitute if a glyph is not found in this [FontVariation]. If not set, [member base_font]'s fallbacks are used instead.
</member>
<member name="opentype_features" type="Dictionary" setter="set_opentype_features" getter="get_opentype_features" default="{}">
A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
</member>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/NavigationMeshGenerator.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="NavigationMeshGenerator" inherits="Object" is_experimental="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<class name="NavigationMeshGenerator" inherits="Object" is_deprecated="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Helper class for creating and clearing navigation meshes.
</brief_description>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Node3D.xml
Expand Up @@ -269,7 +269,7 @@
</methods>
<members>
<member name="basis" type="Basis" setter="set_basis" getter="get_basis">
Direct access to the 3x3 basis of the [Transform3D] property.
Direct access to the 3x3 basis of the [member transform] property.
</member>
<member name="global_position" type="Vector3" setter="set_global_position" getter="get_global_position">
Global position of this node. This is equivalent to [code]global_transform.origin[/code].
Expand Down
6 changes: 3 additions & 3 deletions doc/classes/ProjectSettings.xml
Expand Up @@ -809,8 +809,8 @@
<member name="display/window/stretch/mode" type="String" setter="" getter="" default="&quot;disabled&quot;">
Defines how the base size is stretched to fit the resolution of the window or screen.
[b]"disabled"[/b]: No stretching happens. One unit in the scene corresponds to one pixel on the screen. In this mode, [member display/window/stretch/aspect] has no effect. Recommended for non-game applications.
[b]"canvas_items"[/b]: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don't use a pixel art aesthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D).
[b]"viewport"[/b]: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings' Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art aesthetic.
[b]"canvas_items"[/b]: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don't use a pixel art esthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D).
[b]"viewport"[/b]: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings' Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art esthetic.
</member>
<member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0">
</member>
Expand Down Expand Up @@ -2623,7 +2623,7 @@
</member>
<member name="rendering/textures/default_filters/texture_mipmap_bias" type="float" setter="" getter="" default="0.0">
Affects the final texture sharpness by reading from a lower or higher mipmap (also called "texture LOD bias"). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close).
Enabling temporal antialiasing ([member rendering/anti_aliasing/quality/use_taa]) will automatically apply a [code]-0.5[/code] offset to this value, while enabling FXAA ([member rendering/anti_aliasing/quality/screen_space_aa]) will automatically apply a [code]-0.25[/code] offset to this value. If both TAA and FXAA are enbled at the same time, an offset of [code]-0.75[/code] is applied to this value.
Enabling temporal antialiasing ([member rendering/anti_aliasing/quality/use_taa]) will automatically apply a [code]-0.5[/code] offset to this value, while enabling FXAA ([member rendering/anti_aliasing/quality/screen_space_aa]) will automatically apply a [code]-0.25[/code] offset to this value. If both TAA and FXAA are enabled at the same time, an offset of [code]-0.75[/code] is applied to this value.
[b]Note:[/b] If [member rendering/scaling_3d/scale] is lower than [code]1.0[/code] (exclusive), [member rendering/textures/default_filters/texture_mipmap_bias] is used to adjust the automatic mipmap bias which is calculated internally based on the scale factor. The formula for this is [code]log2(scaling_3d_scale) + mipmap_bias[/code].
[b]Note:[/b] This property is only read when the project starts. To change the mipmap LOD bias at run-time, set [member Viewport.texture_mipmap_bias] instead.
</member>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/RenderSceneBuffersRD.xml
Expand Up @@ -5,7 +5,7 @@
</brief_description>
<description>
This object manages all 3D rendering buffers for the rendering device based renderers. An instance of this object is created for every viewport that has 3D rendering enabled.
All buffers are organised in [b]contexts[/b]. The default context is called [b]render_buffers[/b] and can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and MSAA variants of these buffers.
All buffers are organized in [b]contexts[/b]. The default context is called [b]render_buffers[/b] and can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and MSAA variants of these buffers.
Buffers are only guaranteed to exist during rendering of the viewport.
[b]Note:[/b] this is an internal rendering server object only exposed for GDExtension plugins.
</description>
Expand Down
3 changes: 2 additions & 1 deletion doc/classes/SceneTree.xml
Expand Up @@ -225,7 +225,8 @@
For mobile platforms, see [member quit_on_go_back].
</member>
<member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene">
The current scene.
Returns the root node of the currently running scene, regardless of its structure.
[b]Warning:[/b] Setting this directly might not work as expected, and will [i]not[/i] add or remove any nodes from the tree, consider using [method change_scene_to_file] or [method change_scene_to_packed] instead.
</member>
<member name="debug_collisions_hint" type="bool" setter="set_debug_collisions_hint" getter="is_debugging_collisions_hint" default="false">
If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes.
Expand Down
1 change: 1 addition & 0 deletions doc/classes/SoftBody3D.xml
Expand Up @@ -107,6 +107,7 @@
<member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0">
</member>
<member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5">
Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between [code]0.0[/code] and [code]1.0[/code] (inclusive).
</member>
<member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath(&quot;&quot;)">
[NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/StyleBox.xml
Expand Up @@ -110,7 +110,7 @@
[method get_margin] should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above.
</member>
<member name="content_margin_left" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0">
The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left.
The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left.
Refer to [member content_margin_bottom] for extra considerations.
</member>
<member name="content_margin_right" type="float" setter="set_content_margin" getter="get_content_margin" default="-1.0">
Expand Down
3 changes: 0 additions & 3 deletions doc/classes/SystemFont.xml
Expand Up @@ -19,9 +19,6 @@
<member name="antialiasing" type="int" setter="set_antialiasing" getter="get_antialiasing" enum="TextServer.FontAntialiasing" default="1">
Font anti-aliasing mode.
</member>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s.
</member>
<member name="font_italic" type="bool" setter="set_font_italic" getter="get_font_italic" default="false">
If set to [code]true[/code], italic or oblique font is preferred.
</member>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/TileMap.xml
Expand Up @@ -242,7 +242,7 @@
<param index="3" name="alternative_tile" type="int" default="-1" />
<description>
Returns a [Vector2i] array with the positions of all cells containing a tile in the given layer. Tiles may be filtered according to their source ([param source_id]), their atlas coordinates ([param atlas_coords]) or alternative id ([param alternative_tile]).
If a parameter has it's value set to the default one, this parameter is not used to filter a cell. Thus, if all parameters have their respective default value, this method returns the same result as [method get_used_cells].
If a parameter has its value set to the default one, this parameter is not used to filter a cell. Thus, if all parameters have their respective default value, this method returns the same result as [method get_used_cells].
A cell is considered empty if its source identifier equals -1, its atlas coordinates identifiers is [code]Vector2(-1, -1)[/code] and its alternative identifier is -1.
If [param layer] is negative, the layers are accessed from the last one.
</description>
Expand Down Expand Up @@ -316,7 +316,7 @@
<param index="3" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
<param index="4" name="alternative_tile" type="int" default="0" />
<description>
Sets the tile indentifiers for the cell on layer [param layer] at coordinates [param coords]. Each tile of the [TileSet] is identified using three parts:
Sets the tile identifiers for the cell on layer [param layer] at coordinates [param coords]. Each tile of the [TileSet] is identified using three parts:
- The source identifier [param source_id] identifies a [TileSetSource] identifier. See [method TileSet.set_source_id],
- The atlas coordinates identifier [param atlas_coords] identifies a tile coordinates in the atlas (if the source is a [TileSetAtlasSource]). For [TileSetScenesCollectionSource] it should always be [code]Vector2i(0, 0)[/code]),
- The alternative tile identifier [param alternative_tile] identifies a tile alternative in the atlas (if the source is a [TileSetAtlasSource]), and the scene for a [TileSetScenesCollectionSource].
Expand Down

0 comments on commit 0ae17aa

Please sign in to comment.