summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/http_client.cpp12
-rw-r--r--core/io/stream_peer_ssl.cpp1
-rw-r--r--core/io/stream_peer_tcp.cpp17
-rw-r--r--doc/classes/@GDScript.xml4
-rw-r--r--doc/classes/EditorFileSystem.xml4
-rw-r--r--doc/classes/EditorImportPlugin.xml1
-rw-r--r--doc/classes/EditorInterface.xml12
-rw-r--r--doc/classes/EditorPlugin.xml58
-rw-r--r--doc/classes/EditorResourcePreviewGenerator.xml16
-rw-r--r--doc/classes/EditorScenePostImport.xml47
-rw-r--r--doc/classes/Image.xml20
-rw-r--r--doc/classes/ImageTexture.xml2
-rw-r--r--doc/classes/ProjectSettings.xml3
-rwxr-xr-xdoc/tools/makerst.py15
-rw-r--r--drivers/unix/net_socket_posix.cpp56
-rw-r--r--editor/editor_settings.cpp1
-rw-r--r--editor/filesystem_dock.cpp10
-rw-r--r--editor/import/resource_importer_obj.cpp21
-rwxr-xr-xmodules/mbedtls/stream_peer_mbed_tls.cpp39
-rw-r--r--modules/opensimplex/doc_classes/SimplexNoise.xml17
20 files changed, 244 insertions, 112 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 80a281a21d..ac563df0c3 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -375,6 +375,18 @@ Error HTTPClient::poll() {
}
} break;
case STATUS_CONNECTED: {
+ // Check if we are still connected
+ if (ssl) {
+ Ref<StreamPeerSSL> tmp = connection;
+ tmp->poll();
+ if (tmp->get_status() != StreamPeerSSL::STATUS_CONNECTED) {
+ status = STATUS_CONNECTION_ERROR;
+ return ERR_CONNECTION_ERROR;
+ }
+ } else if (tcp_connection->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
+ status = STATUS_CONNECTION_ERROR;
+ return ERR_CONNECTION_ERROR;
+ }
// Connection established, requests can now be made
return OK;
} break;
diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp
index 8d8682686a..138f91301e 100644
--- a/core/io/stream_peer_ssl.cpp
+++ b/core/io/stream_peer_ssl.cpp
@@ -128,6 +128,7 @@ void StreamPeerSSL::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "blocking_handshake"), "set_blocking_handshake_enabled", "is_blocking_handshake_enabled");
BIND_ENUM_CONSTANT(STATUS_DISCONNECTED);
+ BIND_ENUM_CONSTANT(STATUS_HANDSHAKING);
BIND_ENUM_CONSTANT(STATUS_CONNECTED);
BIND_ENUM_CONSTANT(STATUS_ERROR);
BIND_ENUM_CONSTANT(STATUS_ERROR_HOSTNAME_MISMATCH);
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index f4bf8a13ae..28561e8cbc 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -249,6 +249,23 @@ StreamPeerTCP::Status StreamPeerTCP::get_status() {
if (status == STATUS_CONNECTING) {
_poll_connection();
+ } else if (status == STATUS_CONNECTED) {
+ Error err;
+ err = _sock->poll(NetSocket::POLL_TYPE_IN, 0);
+ if (err == OK) {
+ // FIN received
+ if (_sock->get_available_bytes() == 0) {
+ disconnect_from_host();
+ return status;
+ }
+ }
+ // Also poll write
+ err = _sock->poll(NetSocket::POLL_TYPE_IN_OUT, 0);
+ if (err != OK && err != ERR_BUSY) {
+ // Got an error
+ disconnect_from_host();
+ status = STATUS_ERROR;
+ }
}
return status;
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index 3e46dc4e92..7bd332a3e4 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -120,9 +120,9 @@
<method name="atan2">
<return type="float">
</return>
- <argument index="0" name="x" type="float">
+ <argument index="0" name="y" type="float">
</argument>
- <argument index="1" name="y" type="float">
+ <argument index="1" name="x" type="float">
</argument>
<description>
Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml
index ade6d2034d..5a8b506f9e 100644
--- a/doc/classes/EditorFileSystem.xml
+++ b/doc/classes/EditorFileSystem.xml
@@ -93,10 +93,6 @@
Remitted if a resource is reimported.
</description>
</signal>
- <signal name="script_classes_updated">
- <description>
- </description>
- </signal>
<signal name="sources_changed">
<argument index="0" name="exist" type="bool">
</argument>
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index b21d402468..fdc204605e 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -41,6 +41,7 @@
return FAILED
var mesh = Mesh.new()
+ # Fill the Mesh with data read in 'file', left as exercise to the reader
var filename = save_path + "." + get_save_extension()
ResourceSaver.save(filename, mesh)
diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml
index d85d021a68..f073c5e40b 100644
--- a/doc/classes/EditorInterface.xml
+++ b/doc/classes/EditorInterface.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorInterface" inherits="Node" category="Core" version="3.1">
<brief_description>
- Editor interface and main components.
+ Godot editor's interface.
</brief_description>
<description>
- Editor interface. Allows saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects and provides access to [EditorSettings], [EditorFileSystem], [EditorResourcePreview], [ScriptEditor], the editor viewport, as well as information about scenes. Also see [EditorPlugin] and [EditorScript].
+ EditorInterface gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to [EditorSettings], [EditorFileSystem], [EditorResourcePreview], [ScriptEditor], the editor viewport, and information about scenes.
</description>
<tutorials>
</tutorials>
@@ -24,14 +24,14 @@
<return type="Control">
</return>
<description>
- Returns the main container of Godot's editor window. You can use it, for example, to retrieve the size of the container and place your controls accordingly.
+ Returns the main container of Godot editor's window. You can use it, for example, to retrieve the size of the container and place your controls accordingly.
</description>
</method>
<method name="get_edited_scene_root">
<return type="Node">
</return>
<description>
- Returns the edited scene's root [Node].
+ Returns the edited (current) scene's root [Node].
</description>
</method>
<method name="get_editor_settings">
@@ -52,7 +52,7 @@
<return type="Array">
</return>
<description>
- Returns an [Array] of the currently opened scenes.
+ Returns an [Array] with the file paths of the currently opened scenes.
</description>
</method>
<method name="get_resource_filesystem">
@@ -66,7 +66,7 @@
<return type="EditorResourcePreview">
</return>
<description>
- Returns the [EditorResourcePreview]\ er.
+ Returns the [EditorResourcePreview].
</description>
</method>
<method name="get_script_editor">
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 208780547e..ac139f18c9 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -4,7 +4,7 @@
Used by the editor to extend its functionality.
</brief_description>
<description>
- Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins.
+ Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. Also see [EditorScript] to add functions to the editor.
</description>
<tutorials>
<link>http://docs.godotengine.org/en/3.0/development/plugins/index.html</link>
@@ -31,7 +31,7 @@
<argument index="1" name="title" type="String">
</argument>
<description>
- Add a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. If your plugin is being removed, also make sure to remove your control by calling [method remove_control_from_bottom_panel].
+ Add a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [code]queue_free()[/code].
</description>
</method>
<method name="add_control_to_container">
@@ -44,7 +44,7 @@
<description>
Add a custom control to a container (see CONTAINER_* enum). There are many locations where custom controls can be added in the editor UI.
Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it).
- If your plugin is being removed, also make sure to remove your custom controls too.
+ When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [code]queue_free()[/code].
</description>
</method>
<method name="add_control_to_dock">
@@ -57,7 +57,7 @@
<description>
Add the control to a specific dock slot (see DOCK_* enum for options).
If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions.
- If your plugin is being removed, also make sure to remove your control by calling [method remove_control_from_docks].
+ When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [code]queue_free()[/code].
</description>
</method>
<method name="add_custom_type">
@@ -74,7 +74,7 @@
<description>
Add a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
When given node or resource is selected, the base type will be instanced (ie, "Spatial", "Control", "Resource"), then the script will be loaded and set to this object.
- You can use the [method EditorPlugin.handles] to check if your custom object is being edited by checking the script or using 'is' keyword.
+ You can use the virtual method [method handles] to check if your custom object is being edited by checking the script or using 'is' keyword.
During run-time, this will be a simple object with a script so this function does not need to be called then.
</description>
</method>
@@ -122,7 +122,7 @@
<argument index="3" name="ud" type="Variant" default="null">
</argument>
<description>
- Adds a custom menu to 'Project &gt; Tools' as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it.
+ Add a custom menu to 'Project &gt; Tools' as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it.
</description>
</method>
<method name="add_tool_submenu_item">
@@ -133,6 +133,7 @@
<argument index="1" name="submenu" type="Object">
</argument>
<description>
+ Like [method add_tool_menu_item] but adds the [code]submenu[/code] item inside the [code]name[/code] menu.
</description>
</method>
<method name="apply_changes" qualifiers="virtual">
@@ -165,15 +166,21 @@
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
</description>
</method>
- <method name="forward_canvas_gui_input" qualifiers="virtual">
- <return type="bool">
+ <method name="forward_canvas_draw_over_viewport" qualifiers="virtual">
+ <return type="void">
</return>
- <argument index="0" name="event" type="InputEvent">
+ <argument index="0" name="overlay" type="Control">
</argument>
<description>
+ This method is called when there is an input event in the 2D viewport, e.g. the user clicks with the mouse in the 2D space (canvas GUI). Keep in mind that for this method to be called you have to first declare the virtual method [method handles] so the editor knows that you want to work with the workspace:
+ [codeblock]
+ func handles(object):
+ return true
+ [/codeblock]
+ Also note that the edited scene must have a root node.
</description>
</method>
- <method name="forward_draw_over_viewport" qualifiers="virtual">
+ <method name="forward_canvas_force_draw_over_viewport" qualifiers="virtual">
<return type="void">
</return>
<argument index="0" name="overlay" type="Control">
@@ -181,10 +188,10 @@
<description>
</description>
</method>
- <method name="forward_force_draw_over_viewport" qualifiers="virtual">
- <return type="void">
+ <method name="forward_canvas_gui_input" qualifiers="virtual">
+ <return type="bool">
</return>
- <argument index="0" name="overlay" type="Control">
+ <argument index="0" name="event" type="InputEvent">
</argument>
<description>
</description>
@@ -197,8 +204,12 @@
<argument index="1" name="event" type="InputEvent">
</argument>
<description>
- Implement this function if you are interested in 3D view screen input events. It will be called only if currently selected node is handled by your plugin.
- If you would like to always gets those input events then additionally use [method set_input_forwarding_always_enabled].
+ This method is called when there is an input event in the 3D viewport, e.g. the user clicks with the mouse in the 3D space (spatial GUI). Keep in mind that for this method to be called you have to first declare the virtual method [method handles] so the editor knows that you want to work with the workspace:
+ [codeblock]
+ func handles(object):
+ return true
+ [/codeblock]
+ Also note that the edited scene must have a root node.
</description>
</method>
<method name="get_breakpoints" qualifiers="virtual">
@@ -212,6 +223,7 @@
<return type="EditorInterface">
</return>
<description>
+ Return the [EditorInterface] object that gives you control over Godot editor's window and its functionalities.
</description>
</method>
<method name="get_plugin_icon" qualifiers="virtual">
@@ -253,7 +265,7 @@
<argument index="0" name="layout" type="ConfigFile">
</argument>
<description>
- Get the GUI layout of the plugin. This is used to save the project's editor layout when the [method EditorPlugin.queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock).
+ Get the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock).
</description>
</method>
<method name="handles" qualifiers="virtual">
@@ -262,14 +274,14 @@
<argument index="0" name="object" type="Object">
</argument>
<description>
- Implement this function if your plugin edits a specific type of object (Resource or Node). If you return true, then you will get the functions [method EditorPlugin.edit] and [method EditorPlugin.make_visible] called when the editor requests them.
+ Implement this function if your plugin edits a specific type of object (Resource or Node). If you return true, then you will get the functions [method EditorPlugin.edit] and [method EditorPlugin.make_visible] called when the editor requests them. If you have declared the methods [method forward_canvas_gui_input] and [method forward_spatial_gui_input] these will be called too.
</description>
</method>
<method name="has_main_screen" qualifiers="virtual">
<return type="bool">
</return>
<description>
- Return true if this is a main screen editor plugin (it goes in the main screen selector together with 2D, 3D, Script).
+ Return true if this is a main screen editor plugin (it goes in the workspaces selector together with '2D', '3D', and 'Script').
</description>
</method>
<method name="hide_bottom_panel">
@@ -318,7 +330,7 @@
<argument index="0" name="control" type="Control">
</argument>
<description>
- Remove the control from the bottom panel. Don't forget to call this if you added one, so the editor can remove it cleanly.
+ Remove the control from the bottom panel. You have to manually [code]queue_free()[/code] the control.
</description>
</method>
<method name="remove_control_from_container">
@@ -329,7 +341,7 @@
<argument index="1" name="control" type="Control">
</argument>
<description>
- Remove the control from the specified container. Use it when cleaning up after adding a control with [method add_control_to_container]. Note that you can simply free the control if you won't use it anymore.
+ Remove the control from the specified container. You have to manually [code]queue_free()[/code] the control.
</description>
</method>
<method name="remove_control_from_docks">
@@ -338,7 +350,7 @@
<argument index="0" name="control" type="Control">
</argument>
<description>
- Remove the control from the dock. Don't forget to call this if you added one, so the editor can save the layout and remove it cleanly.
+ Remove the control from the dock. You have to manually [code]queue_free()[/code] the control.
</description>
</method>
<method name="remove_custom_type">
@@ -347,7 +359,7 @@
<argument index="0" name="type" type="String">
</argument>
<description>
- Remove a custom type added by [method EditorPlugin.add_custom_type]
+ Remove a custom type added by [method add_custom_type]
</description>
</method>
<method name="remove_export_plugin">
@@ -441,7 +453,7 @@
<argument index="0" name="screen_name" type="String">
</argument>
<description>
- Emitted when user change main screen view (2D, 3D, Script, AssetLib). Works also with screens which are defined by plugins.
+ Emitted when user change the workspace (2D, 3D, Script, AssetLib). Also works with custom screens defined by plugins.
</description>
</signal>
<signal name="resource_saved">
diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml
index fb9af47b1f..c4dcbbbc82 100644
--- a/doc/classes/EditorResourcePreviewGenerator.xml
+++ b/doc/classes/EditorResourcePreviewGenerator.xml
@@ -16,10 +16,12 @@
</return>
<argument index="0" name="from" type="Resource">
</argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
<description>
- Generate a preview from a given resource. This must be always implemented.
- Returning an empty texture is an OK way to fail and let another generator take care.
- Care must be taken because this function is always called from a thread (not the main thread).
+ Generate a preview from a given resource with the specified size. This must always be implemented.
+ Returning an empty texture is an OK way to fail and let another generator take care.
+ Care must be taken because this function is always called from a thread (not the main thread).
</description>
</method>
<method name="generate_from_path" qualifiers="virtual">
@@ -27,10 +29,12 @@
</return>
<argument index="0" name="path" type="String">
</argument>
+ <argument index="1" name="size" type="Vector2">
+ </argument>
<description>
- Generate a preview directly from a path, implementing this is optional, as default code will load and call generate()
- Returning an empty texture is an OK way to fail and let another generator take care.
- Care must be taken because this function is always called from a thread (not the main thread).
+ Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method generate].
+ Returning an empty texture is an OK way to fail and let another generator take care.
+ Care must be taken because this function is always called from a thread (not the main thread).
</description>
</method>
<method name="handles" qualifiers="virtual">
diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml
index 09cae25403..76c105dd25 100644
--- a/doc/classes/EditorScenePostImport.xml
+++ b/doc/classes/EditorScenePostImport.xml
@@ -4,44 +4,45 @@
Post process scenes after import
</brief_description>
<description>
- The imported scene can be automatically modified right after import by specifying a 'custom script' that inherits from this class. The [method post_import]-method receives the imported scene's root-node and returns the modified version of the scene
- </description>
- <tutorials>
- <link>http://docs.godotengine.org/en/latest/learning/workflow/assets/importing_scenes.html?highlight=post%20import</link>
- </tutorials>
- <demos>
+ Imported scenes can be automatically modified right after import by setting their [i]Custom Script[/i] Import property to a [code]tool[/code] script that inherits from this class.
+ The [method post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example:
[codeblock]
-tool # needed so it runs in editor
-extends EditorScenePostImport
+ tool # needed so it runs in editor
+ extends EditorScenePostImport
-# This sample changes all node names
+ # This sample changes all node names
-# get called right after the scene is imported and gets the root-node
-func post_import(scene):
- # change all node names to "modified_[oldnodename]"
- iterate(scene)
- return scene # remember to return the imported scene
+ # Called right after the scene is imported and gets the root node
+ func post_import(scene):
+ # change all node names to "modified_[oldnodename]"
+ iterate(scene)
+ return scene # remember to return the imported scene
-func iterate(node):
- if node!=null:
- node.name = "modified_"+node.name
- for child in node.get_children():
- iterate(child)
-[/codeblock]
+ func iterate(node):
+ if node != null:
+ node.name = "modified_"+node.name
+ for child in node.get_children():
+ iterate(child)
+ [/codeblock]
+ </description>
+ <tutorials>
+ <link>http://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link>
+ </tutorials>
+ <demos>
</demos>
<methods>
<method name="get_source_file" qualifiers="const">
<return type="String">
</return>
<description>
- Returns the source-file-path which got imported (e.g. [code]res://scene.dae[/code] )
+ Returns the source file path which got imported (e.g. [code]res://scene.dae[/code]).
</description>
</method>
<method name="get_source_folder" qualifiers="const">
<return type="String">
</return>
<description>
- Returns the resource-folder the imported scene-file is located in
+ Returns the resource folder the imported scene file is located in.
</description>
</method>
<method name="post_import" qualifiers="virtual">
@@ -50,7 +51,7 @@ func iterate(node):
<argument index="0" name="scene" type="Object">
</argument>
<description>
- Gets called after the scene got imported and has to return the modified version of the scene
+ Gets called after the scene got imported and has to return the modified version of the scene.
</description>
</method>
</methods>
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 55693bd49c..56accdcd9e 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -487,10 +487,10 @@
OpenGL texture format RG with two components and a bitdepth of 8 for each.
</constant>
<constant name="FORMAT_RGB8" value="4" enum="Format">
- OpenGL texture format RGB with three components, each with a bitdepth of 8.
+ OpenGL texture format RGB with three components, each with a bitdepth of 8. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGBA8" value="5" enum="Format">
- OpenGL texture format RGBA with four components, each with a bitdepth of 8.
+ OpenGL texture format RGBA with four components, each with a bitdepth of 8. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGBA4444" value="6" enum="Format">
OpenGL texture format RGBA with four components, each with a bitdepth of 4.
@@ -526,13 +526,13 @@
A special OpenGL texture format where the three color components have 9 bits of precision and all three share a single exponent.
</constant>
<constant name="FORMAT_DXT1" value="17" enum="Format">
- The S3TC texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha. More information can be found at https://www.khronos.org/opengl/wiki/S3_Texture_Compression.
+ The S3TC texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha. More information can be found at https://www.khronos.org/opengl/wiki/S3_Texture_Compression. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_DXT3" value="18" enum="Format">
- The S3TC texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas.
+ The S3TC texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_DXT5" value="19" enum="Format">
- The S3TC texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparency gradients than DXT3.
+ The S3TC texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparency gradients than DXT3. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_RGTC_R" value="20" enum="Format">
Texture format that uses Red Green Texture Compression, normalizing the red channel data using the same compression algorithm that DXT5 uses for the alpha channel. More information can be found here https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression.
@@ -541,7 +541,7 @@
Texture format that uses Red Green Texture Compression, normalizing the red and green channel data using the same compression algorithm that DXT5 uses for the alpha channel.
</constant>
<constant name="FORMAT_BPTC_RGBA" value="22" enum="Format">
- Texture format that uses BPTC compression with unsigned normalized RGBA components. More information can be found at https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression.
+ Texture format that uses BPTC compression with unsigned normalized RGBA components. More information can be found at https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_BPTC_RGBF" value="23" enum="Format">
Texture format that uses BPTC compression with signed floating-point RGB components.
@@ -550,7 +550,7 @@
Texture format that uses BPTC compression with unsigned floating-point RGB components.
</constant>
<constant name="FORMAT_PVRTC2" value="25" enum="Format">
- Texture format used on PowerVR-supported mobile platforms, uses 2 bit color depth with no alpha. More information on PVRTC can be found here https://en.wikipedia.org/wiki/PVRTC.
+ Texture format used on PowerVR-supported mobile platforms, uses 2 bit color depth with no alpha. More information on PVRTC can be found here https://en.wikipedia.org/wiki/PVRTC. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_PVRTC2A" value="26" enum="Format">
Same as PVRTC2, but with an alpha component.
@@ -577,13 +577,13 @@
Ericsson Texture Compression format 2 variant SIGNED_RG11_EAC, which provides two channels of signed data.
</constant>
<constant name="FORMAT_ETC2_RGB8" value="34" enum="Format">
- Ericsson Texture Compression format 2 variant RGB8, which is a followup of ETC1 and compresses RGB888 data.
+ Ericsson Texture Compression format 2 variant RGB8, which is a followup of ETC1 and compresses RGB888 data. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_ETC2_RGBA8" value="35" enum="Format">
- Ericsson Texture Compression format 2 variant RGBA8, which compresses RGBA8888 data with full alpha support.
+ Ericsson Texture Compression format 2 variant RGBA8, which compresses RGBA8888 data with full alpha support. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_ETC2_RGB8A1" value="36" enum="Format">
- Ericsson Texture Compression format 2 variant RGB8_PUNCHTHROUGH_ALPHA1, which compresses RGBA data to make alpha either fully transparent or fully opaque.
+ Ericsson Texture Compression format 2 variant RGB8_PUNCHTHROUGH_ALPHA1, which compresses RGBA data to make alpha either fully transparent or fully opaque. Note that when creating an [ImageTexture], an sRGB to linear color space conversion is performed.
</constant>
<constant name="FORMAT_MAX" value="37" enum="Format">
</constant>
diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml
index 0bff3317db..5c57899468 100644
--- a/doc/classes/ImageTexture.xml
+++ b/doc/classes/ImageTexture.xml
@@ -36,7 +36,7 @@
<argument index="1" name="flags" type="int" default="7">
</argument>
<description>
- Create a new [code]ImageTexture[/code] from an [Image] with "flags" from [Texture].FLAG_*.
+ Create a new [code]ImageTexture[/code] from an [Image] with "flags" from [Texture].FLAG_*. An sRGB to linear color space conversion can take place, according to [Image].FORMAT_*.
</description>
</method>
<method name="get_format" qualifiers="const">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 548d60fe35..c05d6bc849 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -609,9 +609,6 @@
<member name="network/remote_fs/page_size" type="int" setter="" getter="">
Page size used by remote filesystem.
</member>
- <member name="network/ssl/certificates" type="String" setter="" getter="">
- If your game or application uses HTTPS, a certificates file is needed. It must be set here.
- </member>
<member name="node/name_casing" type="int" setter="" getter="">
When creating nodes names automatically, set the type of casing in this project. This is mostly an editor setting.
</member>
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index 06b9a10123..63a5c8cbbf 100755
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -573,7 +573,7 @@ def make_rst_class(node):
if events != None and len(list(events)) > 0:
f.write(make_heading('Signals', '-'))
for m in list(events):
- f.write(" .. _class_" + name + "_" + m.attrib['name'] + ":\n\n")
+ f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n")
make_method(f, name, m, True, True)
f.write('\n')
d = m.find('description')
@@ -599,7 +599,7 @@ def make_rst_class(node):
if len(enum_names) > 0:
f.write(make_heading('Enumerations', '-'))
for e in enum_names:
- f.write(" .. _enum_" + name + "_" + e + ":\n\n")
+ f.write(".. _enum_" + name + "_" + e + ":\n\n")
f.write("enum **" + e + "**:\n\n")
for c in enums:
if c.attrib['enum'] != e:
@@ -624,6 +624,7 @@ def make_rst_class(node):
if c.text.strip() != '':
s += ' --- ' + rstize_text(c.text.strip(), name)
f.write(s + '\n')
+ f.write('\n')
# Class description
descr = node.find('description')
@@ -644,25 +645,25 @@ def make_rst_class(node):
if match.lastindex == 2:
# Doc reference with fragment identifier: emit direct link to section with reference to page, for example:
# `#calling-javascript-from-script in Exporting For Web`
- f.write("- `" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n")
+ f.write("- `" + groups[1] + " <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n")
# Commented out alternative: Instead just emit:
# `Subsection in Exporting For Web`
- # f.write("- `Subsection <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n")
+ # f.write("- `Subsection <../" + groups[0] + ".html" + groups[1] + ">`_ in :doc:`../" + groups[0] + "`\n\n")
elif match.lastindex == 1:
# Doc reference, for example:
# `Math`
- f.write("- :doc:`../" + groups[0] + "`\n")
+ f.write("- :doc:`../" + groups[0] + "`\n\n")
else:
# External link, for example:
# `http://enet.bespin.org/usergroup0.html`
- f.write("- `" + link + " <" + link + ">`_\n")
+ f.write("- `" + link + " <" + link + ">`_\n\n")
# Property descriptions
members = node.find('members')
if members != None and len(list(members)) > 0:
f.write(make_heading('Property Descriptions', '-'))
for m in list(members):
- f.write(" .. _class_" + name + "_" + m.attrib['name'] + ":\n\n")
+ f.write(".. _class_" + name + "_" + m.attrib['name'] + ":\n\n")
make_properties(f, name, m, True)
if m.text.strip() != '':
f.write(rstize_text(m.text.strip(), name))
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index 9dcc6038ab..07548ab91f 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -68,7 +68,6 @@
#define SOCK_BUF(x) x
#define SOCK_CBUF(x) x
#define SOCK_IOCTL ioctl
-#define SOCK_POLL ::poll
#define SOCK_CLOSE ::close
/* Windows */
@@ -80,7 +79,6 @@
#define SOCK_BUF(x) (char *)(x)
#define SOCK_CBUF(x) (const char *)(x)
#define SOCK_IOCTL ioctlsocket
-#define SOCK_POLL WSAPoll
#define SOCK_CLOSE closesocket
// Windows doesn't have this flag
@@ -331,10 +329,58 @@ Error NetSocketPosix::connect_to_host(IP_Address p_host, uint16_t p_port) {
return OK;
}
-Error NetSocketPosix::poll(PollType p_type, int timeout) const {
+Error NetSocketPosix::poll(PollType p_type, int p_timeout) const {
ERR_FAIL_COND_V(!is_open(), ERR_UNCONFIGURED);
+#if defined(WINDOWS_ENABLED)
+ bool ready = false;
+ fd_set rd, wr, ex;
+ fd_set *rdp = NULL;
+ fd_set *wrp = NULL;
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_ZERO(&ex);
+ FD_SET(_sock, &ex);
+ struct timeval timeout = { p_timeout, 0 };
+ // For blocking operation, pass NULL timeout pointer to select.
+ struct timeval *tp = NULL;
+ if (p_timeout >= 0) {
+ // If timeout is non-negative, we want to specify the timeout instead.
+ tp = &timeout;
+ }
+
+ switch (p_type) {
+ case POLL_TYPE_IN:
+ FD_SET(_sock, &rd);
+ rdp = &rd;
+ break;
+ case POLL_TYPE_OUT:
+ FD_SET(_sock, &wr);
+ wrp = &wr;
+ break;
+ case POLL_TYPE_IN_OUT:
+ FD_SET(_sock, &rd);
+ FD_SET(_sock, &wr);
+ rdp = &rd;
+ wrp = &wr;
+ }
+ int ret = select(1, rdp, wrp, &ex, tp);
+
+ ERR_FAIL_COND_V(ret == SOCKET_ERROR, FAILED);
+
+ if (ret == 0)
+ return ERR_BUSY;
+
+ ERR_FAIL_COND_V(FD_ISSET(_sock, &ex), FAILED);
+
+ if (rdp && FD_ISSET(_sock, rdp))
+ ready = true;
+ if (wrp && FD_ISSET(_sock, wrp))
+ ready = true;
+
+ return ready ? OK : ERR_BUSY;
+#else
struct pollfd pfd;
pfd.fd = _sock;
pfd.events = POLLIN;
@@ -351,14 +397,16 @@ Error NetSocketPosix::poll(PollType p_type, int timeout) const {
pfd.events = POLLOUT || POLLIN;
}
- int ret = SOCK_POLL(&pfd, 1, timeout);
+ int ret = ::poll(&pfd, 1, p_timeout);
ERR_FAIL_COND_V(ret < 0, FAILED);
+ ERR_FAIL_COND_V(pfd.revents & POLLERR, FAILED);
if (ret == 0)
return ERR_BUSY;
return OK;
+#endif
}
Error NetSocketPosix::recv(uint8_t *p_buffer, int p_len, int &r_read) {
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index f778c733d8..3f49edf88d 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -517,7 +517,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("docks/filesystem/display_mode", 0);
hints["docks/filesystem/display_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/display_mode", PROPERTY_HINT_ENUM, "Tree only, Split");
- _initial_set("docks/filesystem/split_mode_minimum_height", 600);
_initial_set("docks/filesystem/thumbnail_size", 64);
hints["docks/filesystem/thumbnail_size"] = PropertyInfo(Variant::INT, "docks/filesystem/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16");
_initial_set("docks/filesystem/files_display_mode", 0);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index bd1d355fb3..46f89439c0 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -223,11 +223,9 @@ void FileSystemDock::_update_tree(const Vector<String> p_uncollapsed_paths, bool
}
void FileSystemDock::_update_display_mode() {
- bool compact_mode = get_size().height < int(EditorSettings::get_singleton()->get("docks/filesystem/split_mode_minimum_height"));
-
// Compute the new display mode
DisplayMode new_display_mode;
- if ((display_mode_setting == DISPLAY_MODE_SETTING_TREE_ONLY) || compact_mode) {
+ if (display_mode_setting == DISPLAY_MODE_SETTING_TREE_ONLY) {
new_display_mode = file_list_view ? DISPLAY_MODE_FILE_LIST_ONLY : DISPLAY_MODE_TREE_ONLY;
} else {
new_display_mode = DISPLAY_MODE_SPLIT;
@@ -314,10 +312,11 @@ void FileSystemDock::_notification(int p_what) {
button_tree->connect("pressed", this, "_go_to_tree", varray(), CONNECT_DEFERRED);
current_path->connect("text_entered", this, "navigate_to_path");
- _update_display_mode();
-
+ display_mode_setting = DisplayModeSetting(int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode")));
always_show_folders = bool(EditorSettings::get_singleton()->get("docks/filesystem/always_show_folders"));
+ _update_display_mode();
+
if (EditorFileSystem::get_singleton()->is_scanning()) {
_set_scanning_mode();
} else {
@@ -2248,6 +2247,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
current_path = memnew(LineEdit);
current_path->set_h_size_flags(SIZE_EXPAND_FILL);
+ current_path->set_text(path);
toolbar_hbc->add_child(current_path);
button_reload = memnew(Button);
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index b18bbc8ce9..c237d2e854 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -126,7 +126,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
String p = l.replace("map_Kd", "").replace("\\", "/").strip_edges();
- String path = base_path.plus_file(p);
+ String path;
+ if (p.is_abs_path()) {
+ path = p;
+ } else {
+ path = base_path.plus_file(p);
+ }
Ref<Texture> texture = ResourceLoader::load(path);
@@ -141,7 +146,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
String p = l.replace("map_Ks", "").replace("\\", "/").strip_edges();
- String path = base_path.plus_file(p);
+ String path;
+ if (p.is_abs_path()) {
+ path = p;
+ } else {
+ path = base_path.plus_file(p);
+ }
Ref<Texture> texture = ResourceLoader::load(path);
@@ -156,7 +166,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
String p = l.replace("map_Ns", "").replace("\\", "/").strip_edges();
- String path = base_path.plus_file(p);
+ String path;
+ if (p.is_abs_path()) {
+ path = p;
+ } else {
+ path = base_path.plus_file(p);
+ }
Ref<Texture> texture = ResourceLoader::load(path);
diff --git a/modules/mbedtls/stream_peer_mbed_tls.cpp b/modules/mbedtls/stream_peer_mbed_tls.cpp
index 3c04254fd4..e0cd67a810 100755
--- a/modules/mbedtls/stream_peer_mbed_tls.cpp
+++ b/modules/mbedtls/stream_peer_mbed_tls.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "stream_peer_mbed_tls.h"
+#include "core/io/stream_peer_tcp.h"
#include "core/os/file_access.h"
#include "mbedtls/platform_util.h"
@@ -98,12 +99,16 @@ Error StreamPeerMbedTLS::_do_handshake() {
int ret = 0;
while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) {
if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
+ // An error occurred.
ERR_PRINTS("TLS handshake error: " + itos(ret));
_print_error(ret);
disconnect_from_stream();
status = STATUS_ERROR;
return FAILED;
- } else if (!blocking_handshake) {
+ }
+
+ // Handshake is still in progress.
+ if (!blocking_handshake) {
// Will retry via poll later
return OK;
}
@@ -192,7 +197,12 @@ Error StreamPeerMbedTLS::put_partial_data(const uint8_t *p_data, int p_bytes, in
int ret = mbedtls_ssl_write(&ssl, p_data, p_bytes);
if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
- ret = 0; // non blocking io
+ // Non blocking IO
+ ret = 0;
+ } else if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
+ // Clean close
+ disconnect_from_stream();
+ return ERR_FILE_EOF;
} else if (ret <= 0) {
_print_error(ret);
disconnect_from_stream();
@@ -234,6 +244,10 @@ Error StreamPeerMbedTLS::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r
int ret = mbedtls_ssl_read(&ssl, p_buffer, p_bytes);
if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
ret = 0; // non blocking io
+ } else if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
+ // Clean close
+ disconnect_from_stream();
+ return ERR_FILE_EOF;
} else if (ret <= 0) {
_print_error(ret);
disconnect_from_stream();
@@ -256,9 +270,22 @@ void StreamPeerMbedTLS::poll() {
int ret = mbedtls_ssl_read(&ssl, NULL, 0);
- if (ret < 0 && ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
+ if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
+ // Nothing to read/write (non blocking IO)
+ } else if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
+ // Clean close (disconnect)
+ disconnect_from_stream();
+ return;
+ } else if (ret < 0) {
_print_error(ret);
disconnect_from_stream();
+ return;
+ }
+
+ Ref<StreamPeerTCP> tcp = base;
+ if (tcp.is_valid() && tcp->get_status() != STATUS_CONNECTED) {
+ disconnect_from_stream();
+ return;
}
}
@@ -282,6 +309,12 @@ void StreamPeerMbedTLS::disconnect_from_stream() {
if (status != STATUS_CONNECTED && status != STATUS_HANDSHAKING)
return;
+ Ref<StreamPeerTCP> tcp = base;
+ if (tcp.is_valid() && tcp->get_status() == STATUS_CONNECTED) {
+ // We are still connected on the socket, try to send close notity.
+ mbedtls_ssl_close_notify(&ssl);
+ }
+
_cleanup();
}
diff --git a/modules/opensimplex/doc_classes/SimplexNoise.xml b/modules/opensimplex/doc_classes/SimplexNoise.xml
index de29ff874c..e5e0c15b3c 100644
--- a/modules/opensimplex/doc_classes/SimplexNoise.xml
+++ b/modules/opensimplex/doc_classes/SimplexNoise.xml
@@ -4,9 +4,7 @@
Noise generator based on Open Simplex.
</brief_description>
<description>
- This resource allows you to configure and sample a fractal noise space.
-
- Here is a brief usage example that configures a SimplexNoise and gets samples at various positions and dimensions:
+ This resource allows you to configure and sample a fractal noise space. Here is a brief usage example that configures a SimplexNoise and gets samples at various positions and dimensions:
[codeblock]
var noise = SimplexNoise.new()
@@ -14,7 +12,7 @@
noise.seed = randi()
noise.octaves = 4
noise.period = 20.0
- noise.persistance = 0.8
+ noise.persistence = 0.8
# Sample
print("Values:")
@@ -102,8 +100,7 @@
<argument index="0" name="size" type="int">
</argument>
<description>
- Generate a tileable noise image, based on the current noise parameters.
- Generated seamless images are always square ([code]size[/code] x [code]size[/code]).
+ Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square ([code]size[/code] x [code]size[/code]).
</description>
</method>
</methods>
@@ -115,12 +112,10 @@
Number of Simplex noise layers that are sampled to get the fractal noise.
</member>
<member name="period" type="float" setter="set_period" getter="get_period">
- Period of the base octave.
- A lower period results in a higher-frequency noise (more value changes across the same distance).
+ Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance).
</member>
- <member name="persistance" type="float" setter="set_persistance" getter="get_persistance">
- Contribution factor of the different octaves.
- A [code]persistance[/code] value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.
+ <member name="persistence" type="float" setter="set_persistence" getter="get_persistence">
+ Contribution factor of the different octaves. A [code]persistence[/code] value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.
</member>
<member name="seed" type="int" setter="set_seed" getter="get_seed">
Seed used to generate random values, different seeds will generate different noise maps.