summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bind/core_bind.cpp8
-rw-r--r--core/bind/core_bind.h1
-rw-r--r--core/class_db.cpp2
-rw-r--r--core/color.h2
-rw-r--r--core/error_list.h8
-rw-r--r--core/error_macros.h36
-rw-r--r--core/global_constants.cpp52
-rw-r--r--core/image.cpp4
-rw-r--r--core/image.h2
-rw-r--r--core/input_map.cpp2
-rw-r--r--core/io/file_access_network.cpp1
-rw-r--r--core/io/http_client.cpp2
-rw-r--r--core/io/marshalls.cpp7
-rw-r--r--core/io/multiplayer_api.h2
-rw-r--r--core/io/pck_packer.cpp5
-rw-r--r--core/io/resource_format_binary.cpp4
-rw-r--r--core/io/stream_peer_tcp.cpp1
-rw-r--r--core/io/tcp_server.cpp6
-rw-r--r--core/math/expression.cpp2
-rw-r--r--core/math/random_number_generator.cpp3
-rw-r--r--core/math/triangle_mesh.h2
-rw-r--r--core/node_path.cpp10
-rw-r--r--core/object.cpp21
-rw-r--r--core/os/dir_access.cpp2
-rw-r--r--core/os/file_access.cpp6
-rw-r--r--core/os/input_event.cpp8
-rw-r--r--core/os/main_loop.cpp6
-rw-r--r--core/os/os.cpp3
-rw-r--r--core/pool_allocator.cpp7
-rw-r--r--core/project_settings.cpp2
-rw-r--r--core/safe_refcount.h6
-rw-r--r--core/undo_redo.cpp23
-rw-r--r--core/undo_redo.h3
-rw-r--r--core/ustring.cpp7
-rw-r--r--core/ustring.h2
-rw-r--r--core/variant.cpp2
-rw-r--r--core/variant.h24
-rw-r--r--doc/classes/@GlobalScope.xml123
-rw-r--r--doc/classes/ARVRAnchor.xml2
-rw-r--r--doc/classes/AStar.xml2
-rw-r--r--doc/classes/AnimationNodeStateMachineTransition.xml2
-rw-r--r--doc/classes/AnimationPlayer.xml4
-rw-r--r--doc/classes/AnimationTreePlayer.xml2
-rw-r--r--doc/classes/Area.xml2
-rw-r--r--doc/classes/Area2D.xml2
-rw-r--r--doc/classes/ArrayMesh.xml3
-rw-r--r--doc/classes/AudioEffectDistortion.xml2
-rw-r--r--doc/classes/AudioEffectPitchShift.xml1
-rw-r--r--doc/classes/AudioEffectSpectrumAnalyzer.xml1
-rw-r--r--doc/classes/AudioEffectSpectrumAnalyzerInstance.xml2
-rw-r--r--doc/classes/BackBufferCopy.xml4
-rw-r--r--doc/classes/Camera.xml6
-rw-r--r--doc/classes/CollisionPolygon2D.xml2
-rw-r--r--doc/classes/ConeTwistJoint.xml10
-rw-r--r--doc/classes/ConfigFile.xml4
-rw-r--r--doc/classes/Control.xml16
-rw-r--r--doc/classes/Curve.xml2
-rw-r--r--doc/classes/Curve3D.xml2
-rw-r--r--doc/classes/Directory.xml2
-rw-r--r--doc/classes/EditorFeatureProfile.xml1
-rw-r--r--doc/classes/EditorImportPlugin.xml2
-rw-r--r--doc/classes/EditorPlugin.xml7
-rw-r--r--doc/classes/Environment.xml2
-rw-r--r--doc/classes/Expression.xml2
-rw-r--r--doc/classes/File.xml2
-rw-r--r--doc/classes/FileDialog.xml2
-rw-r--r--doc/classes/GIProbe.xml1
-rw-r--r--doc/classes/Generic6DOFJoint.xml4
-rw-r--r--doc/classes/Geometry.xml41
-rw-r--r--doc/classes/GeometryInstance.xml11
-rw-r--r--doc/classes/HTTPClient.xml4
-rw-r--r--doc/classes/HTTPRequest.xml2
-rw-r--r--doc/classes/HingeJoint.xml4
-rw-r--r--doc/classes/IP.xml4
-rw-r--r--doc/classes/Image.xml3
-rw-r--r--doc/classes/ImageTexture.xml2
-rw-r--r--doc/classes/Input.xml10
-rw-r--r--doc/classes/InputEvent.xml10
-rw-r--r--doc/classes/InputEventWithModifiers.xml12
-rw-r--r--doc/classes/Light.xml1
-rw-r--r--doc/classes/Light2D.xml6
-rw-r--r--doc/classes/Line2D.xml8
-rw-r--r--doc/classes/LineEdit.xml3
-rw-r--r--doc/classes/MainLoop.xml81
-rw-r--r--doc/classes/Material.xml2
-rw-r--r--doc/classes/Mesh.xml1
-rw-r--r--doc/classes/MeshDataTool.xml6
-rw-r--r--doc/classes/MultiplayerAPI.xml10
-rw-r--r--doc/classes/Mutex.xml2
-rw-r--r--doc/classes/NetworkedMultiplayerPeer.xml6
-rw-r--r--doc/classes/Node.xml65
-rw-r--r--doc/classes/NodePath.xml3
-rw-r--r--doc/classes/OS.xml14
-rw-r--r--doc/classes/Object.xml106
-rw-r--r--doc/classes/OccluderPolygon2D.xml4
-rw-r--r--doc/classes/PackedScene.xml2
-rw-r--r--doc/classes/Particles.xml2
-rw-r--r--doc/classes/Particles2D.xml2
-rw-r--r--doc/classes/ParticlesMaterial.xml12
-rw-r--r--doc/classes/Path.xml7
-rw-r--r--doc/classes/Path2D.xml4
-rw-r--r--doc/classes/PathFollow.xml2
-rw-r--r--doc/classes/Performance.xml20
-rw-r--r--doc/classes/Physics2DServer.xml34
-rw-r--r--doc/classes/PhysicsServer.xml8
-rw-r--r--doc/classes/ProceduralSky.xml5
-rw-r--r--doc/classes/Reference.xml14
-rw-r--r--doc/classes/Resource.xml1
-rw-r--r--doc/classes/ResourceFormatLoader.xml4
-rw-r--r--doc/classes/ResourceFormatSaver.xml2
-rw-r--r--doc/classes/ResourceImporter.xml13
-rw-r--r--doc/classes/ResourceInteractiveLoader.xml10
-rw-r--r--doc/classes/ResourceSaver.xml2
-rw-r--r--doc/classes/RichTextLabel.xml4
-rw-r--r--doc/classes/RigidBody2D.xml8
-rw-r--r--doc/classes/SceneState.xml10
-rw-r--r--doc/classes/SceneTree.xml80
-rw-r--r--doc/classes/Semaphore.xml4
-rw-r--r--doc/classes/Shader.xml2
-rw-r--r--doc/classes/Sky.xml8
-rw-r--r--doc/classes/SliderJoint.xml2
-rw-r--r--doc/classes/Spatial.xml2
-rw-r--r--doc/classes/SpatialMaterial.xml3
-rw-r--r--doc/classes/SpriteBase3D.xml2
-rw-r--r--doc/classes/StreamPeerTCP.xml4
-rw-r--r--doc/classes/SurfaceTool.xml8
-rw-r--r--doc/classes/Tabs.xml2
-rw-r--r--doc/classes/TextureProgress.xml6
-rw-r--r--doc/classes/TextureRect.xml2
-rw-r--r--doc/classes/TileSet.xml12
-rw-r--r--doc/classes/Tree.xml8
-rw-r--r--doc/classes/Tween.xml2
-rw-r--r--doc/classes/UndoRedo.xml38
-rw-r--r--doc/classes/VehicleBody.xml2
-rw-r--r--doc/classes/VehicleWheel.xml4
-rw-r--r--doc/classes/Viewport.xml16
-rw-r--r--doc/classes/VisibilityEnabler.xml1
-rw-r--r--doc/classes/VisibilityEnabler2D.xml1
-rw-r--r--doc/classes/VisualServer.xml25
-rw-r--r--doc/classes/VisualShader.xml1
-rw-r--r--doc/classes/XMLParser.xml2
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp2
-rw-r--r--drivers/gles2/shader_gles2.cpp4
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp4
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp2
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h2
-rw-r--r--drivers/gles3/shader_gles3.cpp2
-rw-r--r--drivers/unix/dir_access_unix.cpp5
-rw-r--r--drivers/unix/net_socket_posix.cpp5
-rw-r--r--drivers/unix/net_socket_posix.h2
-rw-r--r--editor/animation_track_editor.cpp8
-rw-r--r--editor/animation_track_editor.h2
-rw-r--r--editor/array_property_edit.cpp6
-rw-r--r--editor/audio_stream_preview.h2
-rw-r--r--editor/collada/collada.cpp4
-rw-r--r--editor/connections_dialog.cpp2
-rw-r--r--editor/dictionary_property_edit.cpp5
-rw-r--r--editor/editor_audio_buses.cpp38
-rw-r--r--editor/editor_autoload_settings.cpp11
-rw-r--r--editor/editor_dir_dialog.cpp2
-rw-r--r--editor/editor_export.cpp8
-rw-r--r--editor/editor_file_system.cpp12
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--editor/editor_inspector.h4
-rw-r--r--editor/editor_plugin.cpp2
-rw-r--r--editor/editor_plugin.h2
-rw-r--r--editor/editor_profiler.cpp4
-rw-r--r--editor/editor_properties.cpp12
-rw-r--r--editor/editor_properties_array_dict.cpp2
-rw-r--r--editor/editor_run.cpp6
-rw-r--r--editor/editor_run_native.h2
-rw-r--r--editor/editor_settings.cpp9
-rw-r--r--editor/editor_settings.h5
-rw-r--r--editor/export_template_manager.cpp7
-rw-r--r--editor/filesystem_dock.cpp4
-rw-r--r--editor/filesystem_dock.h2
-rw-r--r--editor/import/editor_import_plugin.h2
-rw-r--r--editor/import/resource_importer_scene.cpp8
-rw-r--r--editor/import/resource_importer_scene.h2
-rw-r--r--editor/import/resource_importer_texture.cpp6
-rw-r--r--editor/import/resource_importer_texture_atlas.cpp2
-rw-r--r--editor/import/resource_importer_wav.cpp6
-rw-r--r--editor/multi_node_edit.cpp2
-rw-r--r--editor/node_dock.cpp4
-rw-r--r--editor/plugin_config_dialog.h2
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp2
-rw-r--r--editor/plugins/animation_blend_space_1d_editor.cpp4
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp4
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp8
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp8
-rw-r--r--editor/plugins/animation_tree_player_editor_plugin.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp15
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h2
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp2
-rw-r--r--editor/plugins/path_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp5
-rw-r--r--editor/plugins/root_motion_editor_plugin.cpp2
-rw-r--r--editor/plugins/skeleton_editor_plugin.h2
-rw-r--r--editor/plugins/spatial_editor_plugin.h2
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp2
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp12
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp5
-rw-r--r--editor/plugins/visual_shader_editor_plugin.h6
-rw-r--r--editor/project_export.cpp4
-rw-r--r--editor/project_settings_editor.cpp2
-rw-r--r--editor/property_editor.cpp2
-rw-r--r--editor/rename_dialog.cpp18
-rw-r--r--editor/scene_tree_editor.cpp6
-rw-r--r--editor/spatial_editor_gizmos.cpp18
-rw-r--r--main/input_default.cpp40
-rw-r--r--main/main.cpp4
-rw-r--r--main/tests/test_gdscript.cpp4
-rw-r--r--main/tests/test_physics.cpp1
-rw-r--r--main/tests/test_string.cpp6
-rw-r--r--modules/bmp/image_loader_bmp.cpp2
-rw-r--r--modules/csg/csg_shape.h2
-rw-r--r--modules/enet/doc_classes/NetworkedMultiplayerENet.xml6
-rw-r--r--modules/gdnative/include/gdnative/gdnative.h6
-rw-r--r--modules/gdscript/gdscript.cpp2
-rw-r--r--modules/gdscript/gdscript_compiler.cpp2
-rw-r--r--modules/gdscript/gdscript_parser.cpp12
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp4
-rw-r--r--modules/mono/csharp_script.cpp5
-rw-r--r--modules/mono/csharp_script.h2
-rw-r--r--modules/mono/editor/csharp_project.h2
-rw-r--r--modules/mono/editor/godotsharp_editor.h2
-rw-r--r--modules/mono/mono_gd/gd_mono_internals.cpp2
-rw-r--r--modules/mono/utils/thread_local.h2
-rw-r--r--modules/opensimplex/noise_texture.h4
-rw-r--r--modules/upnp/doc_classes/UPNP.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml8
-rw-r--r--modules/visual_script/doc_classes/VisualScriptClassConstant.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptCustomNode.xml2
-rw-r--r--modules/visual_script/doc_classes/VisualScriptMathConstant.xml1
-rw-r--r--modules/visual_script/visual_script_expression.cpp2
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp7
-rw-r--r--modules/webrtc/doc_classes/WebRTCDataChannel.xml2
-rw-r--r--modules/webrtc/doc_classes/WebRTCPeerConnection.xml4
-rw-r--r--modules/websocket/doc_classes/WebSocketServer.xml2
-rw-r--r--modules/websocket/websocket_multiplayer_peer.h2
-rw-r--r--platform/x11/joypad_linux.cpp1
-rw-r--r--platform/x11/os_x11.cpp8
-rw-r--r--platform/x11/power_x11.cpp5
-rw-r--r--scene/2d/animated_sprite.cpp5
-rw-r--r--scene/2d/audio_stream_player_2d.cpp4
-rw-r--r--scene/2d/canvas_item.h2
-rw-r--r--scene/2d/cpu_particles_2d.h2
-rw-r--r--scene/2d/line_2d.cpp3
-rw-r--r--scene/2d/physics_body_2d.h4
-rw-r--r--scene/2d/sprite.cpp5
-rw-r--r--scene/3d/audio_stream_player_3d.cpp6
-rw-r--r--scene/3d/camera.h2
-rw-r--r--scene/3d/cpu_particles.h2
-rw-r--r--scene/3d/soft_body.cpp1
-rw-r--r--scene/3d/vehicle_body.cpp5
-rw-r--r--scene/3d/visual_instance.cpp1
-rw-r--r--scene/3d/voxel_light_baker.cpp4
-rw-r--r--scene/animation/animation_node_state_machine.cpp114
-rw-r--r--scene/animation/root_motion_view.h2
-rw-r--r--scene/animation/skeleton_ik.cpp1
-rw-r--r--scene/animation/skeleton_ik.h4
-rw-r--r--scene/animation/tween.cpp4
-rw-r--r--scene/audio/audio_stream_player.cpp2
-rw-r--r--scene/gui/box_container.cpp1
-rw-r--r--scene/gui/control.cpp35
-rw-r--r--scene/gui/control.h4
-rw-r--r--scene/gui/file_dialog.cpp7
-rw-r--r--scene/gui/label.cpp1
-rw-r--r--scene/gui/line_edit.cpp5
-rw-r--r--scene/gui/rich_text_label.cpp109
-rw-r--r--scene/gui/scroll_container.cpp22
-rw-r--r--scene/gui/text_edit.cpp11
-rw-r--r--scene/gui/tree.cpp2
-rw-r--r--scene/main/node.cpp2
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/resources/multimesh.cpp8
-rw-r--r--scene/resources/primitive_meshes.cpp2
-rw-r--r--scene/resources/resource_format_text.cpp4
-rw-r--r--scene/resources/visual_shader_nodes.h8
-rw-r--r--servers/audio/audio_filter_sw.cpp2
-rw-r--r--servers/audio/audio_stream.cpp2
-rw-r--r--servers/audio/audio_stream.h2
-rw-r--r--servers/audio/effects/audio_effect_spectrum_analyzer.cpp4
-rw-r--r--servers/physics/broad_phase_octree.cpp2
-rw-r--r--servers/physics/collision_solver_sat.cpp12
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp1
-rw-r--r--servers/physics/space_sw.cpp4
-rw-r--r--servers/physics_2d/space_2d_sw.cpp2
-rw-r--r--servers/visual/visual_server_canvas.cpp2
-rw-r--r--servers/visual/visual_server_canvas.h4
-rw-r--r--servers/visual/visual_server_scene.cpp6
-rw-r--r--servers/visual/visual_server_viewport.cpp2
-rw-r--r--servers/visual/visual_server_viewport.h3
-rw-r--r--servers/visual_server.cpp11
296 files changed, 1198 insertions, 1108 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 8a898f3b53..44573a0d97 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -76,7 +76,7 @@ RES _ResourceLoader::load(const String &p_path, const String &p_type_hint, bool
if (err != OK) {
ERR_EXPLAIN("Error loading resource: '" + p_path + "'");
- ERR_FAIL_COND_V(err != OK, ret);
+ ERR_FAIL_V(ret);
}
return ret;
}
@@ -1524,6 +1524,11 @@ bool _Geometry::is_polygon_clockwise(const Vector<Vector2> &p_polygon) {
return Geometry::is_polygon_clockwise(p_polygon);
}
+bool _Geometry::is_point_in_polygon(const Point2 &p_point, const Vector<Vector2> &p_polygon) {
+
+ return Geometry::is_point_in_polygon(p_point, p_polygon);
+}
+
Vector<int> _Geometry::triangulate_polygon(const Vector<Vector2> &p_polygon) {
return Geometry::triangulate_polygon(p_polygon);
@@ -1706,6 +1711,7 @@ void _Geometry::_bind_methods() {
ClassDB::bind_method(D_METHOD("point_is_inside_triangle", "point", "a", "b", "c"), &_Geometry::point_is_inside_triangle);
ClassDB::bind_method(D_METHOD("is_polygon_clockwise", "polygon"), &_Geometry::is_polygon_clockwise);
+ ClassDB::bind_method(D_METHOD("is_point_in_polygon", "point", "polygon"), &_Geometry::is_point_in_polygon);
ClassDB::bind_method(D_METHOD("triangulate_polygon", "polygon"), &_Geometry::triangulate_polygon);
ClassDB::bind_method(D_METHOD("triangulate_delaunay_2d", "points"), &_Geometry::triangulate_delaunay_2d);
ClassDB::bind_method(D_METHOD("convex_hull_2d", "points"), &_Geometry::convex_hull_2d);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 7d0c158f51..2885e7c0e0 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -408,6 +408,7 @@ public:
int get_uv84_normal_bit(const Vector3 &p_vector);
bool is_polygon_clockwise(const Vector<Vector2> &p_polygon);
+ bool is_point_in_polygon(const Point2 &p_point, const Vector<Vector2> &p_polygon);
Vector<int> triangulate_polygon(const Vector<Vector2> &p_polygon);
Vector<int> triangulate_delaunay_2d(const Vector<Vector2> &p_points);
Vector<Point2> convex_hull_2d(const Vector<Point2> &p_points);
diff --git a/core/class_db.cpp b/core/class_db.cpp
index ec07ee98e2..c9527e3c8f 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -552,7 +552,7 @@ void ClassDB::_add_class2(const StringName &p_class, const StringName &p_inherit
OBJTYPE_WLOCK;
- StringName name = p_class;
+ const StringName &name = p_class;
ERR_FAIL_COND(classes.has(name));
diff --git a/core/color.h b/core/color.h
index b2148e1357..77f95b5dc9 100644
--- a/core/color.h
+++ b/core/color.h
@@ -195,7 +195,7 @@ struct Color {
static Color named(const String &p_name);
String to_html(bool p_alpha = true) const;
Color from_hsv(float p_h, float p_s, float p_v, float p_a) const;
- static Color from_rgbe9995(uint32_t p_color);
+ static Color from_rgbe9995(uint32_t p_rgbe);
_FORCE_INLINE_ bool operator<(const Color &p_color) const; //used in set keys
operator String() const;
diff --git a/core/error_list.h b/core/error_list.h
index 304861da4e..dc5a5e68dd 100644
--- a/core/error_list.h
+++ b/core/error_list.h
@@ -39,7 +39,7 @@
*/
enum Error {
- OK,
+ OK, // (0)
FAILED, ///< Generic fail error
ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
ERR_UNCONFIGURED, ///< The object being used hasn't been properly set up yet
@@ -69,12 +69,12 @@ enum Error {
ERR_CONNECTION_ERROR,
ERR_CANT_ACQUIRE_RESOURCE,
ERR_CANT_FORK,
- ERR_INVALID_DATA, ///< Data passed is invalid (30)
+ ERR_INVALID_DATA, ///< Data passed is invalid (30)
ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
ERR_ALREADY_EXISTS, ///< When adding, item already exists
- ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
+ ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, if item does not exist
ERR_DATABASE_CANT_READ, ///< database is full
- ERR_DATABASE_CANT_WRITE, ///< database is full (35)
+ ERR_DATABASE_CANT_WRITE, ///< database is full (35)
ERR_COMPILATION_FAILED,
ERR_METHOD_NOT_FOUND,
ERR_LINK_FAILED,
diff --git a/core/error_macros.h b/core/error_macros.h
index f72e987e23..69874e280b 100644
--- a/core/error_macros.h
+++ b/core/error_macros.h
@@ -136,8 +136,8 @@ extern bool _err_error_exists;
if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
_err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
return; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
} while (0); // (*)
/** An index has failed if m_index<0 or m_index >=m_size, the function exits.
@@ -150,8 +150,8 @@ extern bool _err_error_exists;
if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
_err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
return m_retval; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
} while (0); // (*)
/** An index has failed if m_index >=m_size, the function exits.
@@ -164,8 +164,8 @@ extern bool _err_error_exists;
if (unlikely((m_index) >= (m_size))) { \
_err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
return m_retval; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
} while (0); // (*)
/** Use this one if there is no sensible fallback, that is, the error is unrecoverable.
@@ -188,8 +188,8 @@ extern bool _err_error_exists;
if (unlikely(!m_param)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \
return; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
#define ERR_FAIL_NULL_V(m_param, m_retval) \
@@ -197,8 +197,8 @@ extern bool _err_error_exists;
if (unlikely(!m_param)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter ' " _STR(m_param) " ' is null."); \
return m_retval; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
/** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert().
@@ -210,8 +210,8 @@ extern bool _err_error_exists;
if (unlikely(m_cond)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true."); \
return; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
/** Use this one if there is no sensible fallback, that is, the error is unrecoverable.
@@ -236,8 +236,8 @@ extern bool _err_error_exists;
if (unlikely(m_cond)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. returned: " _STR(m_retval)); \
return m_retval; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
/** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert().
@@ -249,8 +249,8 @@ extern bool _err_error_exists;
if (unlikely(m_cond)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Continuing..:"); \
continue; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
/** An error condition happened (m_cond tested true) (WARNING this is the opposite as assert().
@@ -262,8 +262,8 @@ extern bool _err_error_exists;
if (unlikely(m_cond)) { \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition ' " _STR(m_cond) " ' is true. Breaking..:"); \
break; \
- } else \
- _err_error_exists = false; \
+ } \
+ _err_error_exists = false; \
}
/** Print an error string and return
diff --git a/core/global_constants.cpp b/core/global_constants.cpp
index 671b3c545b..5bfdc8ab8f 100644
--- a/core/global_constants.cpp
+++ b/core/global_constants.cpp
@@ -486,47 +486,55 @@ void register_global_constants() {
// error list
- BIND_GLOBAL_ENUM_CONSTANT(OK);
- BIND_GLOBAL_ENUM_CONSTANT(FAILED); ///< Generic fail error
- BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAVAILABLE); ///< What is requested is unsupported/unavailable
- BIND_GLOBAL_ENUM_CONSTANT(ERR_UNCONFIGURED); ///< The object being used hasn't been properly set up yet
- BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAUTHORIZED); ///< Missing credentials for requested resource
- BIND_GLOBAL_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); ///< Parameter given out of range
- BIND_GLOBAL_ENUM_CONSTANT(ERR_OUT_OF_MEMORY); ///< Out of memory
+ BIND_GLOBAL_ENUM_CONSTANT(OK); // (0)
+ BIND_GLOBAL_ENUM_CONSTANT(FAILED);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAVAILABLE);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_UNCONFIGURED);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_UNAUTHORIZED);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_PARAMETER_RANGE_ERROR); // (5)
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_OUT_OF_MEMORY);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NOT_FOUND);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_DRIVE);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_BAD_PATH);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_NO_PERMISSION); // (10)
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_ALREADY_IN_USE);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_OPEN);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_WRITE);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CANT_READ);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_UNRECOGNIZED); // (15)
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_CORRUPT);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_MISSING_DEPENDENCIES);
BIND_GLOBAL_ENUM_CONSTANT(ERR_FILE_EOF);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_OPEN); ///< Can't open a resource/socket/file
- BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CREATE);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_PARSE_ERROR);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_OPEN);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CREATE); // (20)
BIND_GLOBAL_ENUM_CONSTANT(ERR_QUERY_FAILED);
BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_IN_USE);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_LOCKED); ///< resource is locked
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_LOCKED);
BIND_GLOBAL_ENUM_CONSTANT(ERR_TIMEOUT);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_CONNECT); // (25)
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_RESOLVE);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CONNECTION_ERROR);
BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_ACQUIRE_RESOURCE);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DATA); ///< Data passed is invalid
- BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_PARAMETER); ///< Parameter passed is invalid
- BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_EXISTS); ///< When adding ), item already exists
- BIND_GLOBAL_ENUM_CONSTANT(ERR_DOES_NOT_EXIST); ///< When retrieving/erasing ), it item does not exist
- BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_READ); ///< database is full
- BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); ///< database is full
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CANT_FORK);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DATA); // (30)
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_PARAMETER);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_ALREADY_EXISTS);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_DOES_NOT_EXIST);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_READ);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_DATABASE_CANT_WRITE); // (35)
BIND_GLOBAL_ENUM_CONSTANT(ERR_COMPILATION_FAILED);
BIND_GLOBAL_ENUM_CONSTANT(ERR_METHOD_NOT_FOUND);
BIND_GLOBAL_ENUM_CONSTANT(ERR_LINK_FAILED);
BIND_GLOBAL_ENUM_CONSTANT(ERR_SCRIPT_FAILED);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_CYCLIC_LINK);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_CYCLIC_LINK); // (40)
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_INVALID_DECLARATION);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_DUPLICATE_SYMBOL);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_PARSE_ERROR);
BIND_GLOBAL_ENUM_CONSTANT(ERR_BUSY);
- BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP); ///< user requested help!!
- BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG); ///< a bug in the software certainly happened ), due to a double check failing or unexpected behavior.
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_SKIP); // (45)
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_HELP);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_BUG);
+ BIND_GLOBAL_ENUM_CONSTANT(ERR_PRINTER_ON_FIRE);
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NONE);
BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_RANGE);
diff --git a/core/image.cpp b/core/image.cpp
index c85d7f6bcc..dd8f2b9bac 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -2402,7 +2402,7 @@ Color Image::get_pixel(int p_x, int p_y) const {
#ifdef DEBUG_ENABLED
if (!ptr) {
ERR_EXPLAIN("Image must be locked with 'lock()' before using get_pixel()");
- ERR_FAIL_COND_V(!ptr, Color());
+ ERR_FAIL_V(Color());
}
ERR_FAIL_INDEX_V(p_x, width, Color());
@@ -2541,7 +2541,7 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
#ifdef DEBUG_ENABLED
if (!ptr) {
ERR_EXPLAIN("Image must be locked with 'lock()' before using set_pixel()");
- ERR_FAIL_COND(!ptr);
+ ERR_FAIL();
}
ERR_FAIL_INDEX(p_x, width);
diff --git a/core/image.h b/core/image.h
index 752ef20208..cc796789cd 100644
--- a/core/image.h
+++ b/core/image.h
@@ -350,7 +350,7 @@ public:
Color get_pixelv(const Point2 &p_src) const;
Color get_pixel(int p_x, int p_y) const;
- void set_pixelv(const Point2 &p_dest, const Color &p_color);
+ void set_pixelv(const Point2 &p_dst, const Color &p_color);
void set_pixel(int p_x, int p_y, const Color &p_color);
void copy_internals_from(const Ref<Image> &p_image) {
diff --git a/core/input_map.cpp b/core/input_map.cpp
index 012c6a7c4f..04911787a8 100644
--- a/core/input_map.cpp
+++ b/core/input_map.cpp
@@ -194,7 +194,7 @@ bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const Str
Map<StringName, Action>::Element *E = input_map.find(p_action);
if (!E) {
ERR_EXPLAIN("Request for nonexistent InputMap action: " + String(p_action));
- ERR_FAIL_COND_V(!E, false);
+ ERR_FAIL_V(false);
}
Ref<InputEventAction> input_event_action = p_event;
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index 5dd167c581..d1c7f5c334 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -435,7 +435,6 @@ int FileAccessNetwork::get_buffer(uint8_t *p_dst, int p_length) const {
_queue_page(page + j);
}
- buff = pages.write[page].buffer.ptrw();
//queue pages
buffer_mutex->unlock();
}
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 891fb7b0ca..c3626bfe31 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -775,7 +775,7 @@ Dictionary HTTPClient::_get_response_headers_as_dictionary() {
get_response_headers(&rh);
Dictionary ret;
for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
- String s = E->get();
+ const String &s = E->get();
int sp = s.find(":");
if (sp == -1)
continue;
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 3c9c5bc2bb..17a3f52a65 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -683,8 +683,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
if (r_len)
(*r_len) += adv;
- len -= adv;
- buf += adv;
}
r_variant = varray;
@@ -721,8 +719,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
if (r_len)
(*r_len) += adv;
- len -= adv;
- buf += adv;
}
r_variant = varray;
@@ -760,8 +756,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
if (r_len)
(*r_len) += adv;
- len -= adv;
- buf += adv;
}
r_variant = carray;
@@ -1094,7 +1088,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
if (!obj) {
if (buf) {
encode_uint32(0, buf);
- buf += 4;
}
r_len += 4;
diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h
index 779dd043bd..5258dde5d7 100644
--- a/core/io/multiplayer_api.h
+++ b/core/io/multiplayer_api.h
@@ -77,7 +77,7 @@ protected:
void _process_raw(int p_from, const uint8_t *p_packet, int p_packet_len);
void _send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p_set, const StringName &p_name, const Variant **p_arg, int p_argcount);
- bool _send_confirm_path(NodePath p_path, PathSentCache *psc, int p_from);
+ bool _send_confirm_path(NodePath p_path, PathSentCache *psc, int p_target);
public:
enum NetworkCommands {
diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp
index 8920bbfb81..55685a2d9a 100644
--- a/core/io/pck_packer.cpp
+++ b/core/io/pck_packer.cpp
@@ -109,10 +109,7 @@ Error PCKPacker::add_file(const String &p_file, const String &p_src) {
Error PCKPacker::flush(bool p_verbose) {
- if (!file) {
- ERR_FAIL_COND_V(!file, ERR_INVALID_PARAMETER);
- return ERR_INVALID_PARAMETER;
- };
+ ERR_FAIL_COND_V(!file, ERR_INVALID_PARAMETER);
// write the index
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index aef2dcfff3..688dfc21e5 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -720,7 +720,7 @@ Error ResourceInteractiveLoaderBinary::poll() {
error = ERR_FILE_CORRUPT;
memdelete(obj); //bye
ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class());
- ERR_FAIL_COND_V(!r, ERR_FILE_CORRUPT);
+ ERR_FAIL_V(ERR_FILE_CORRUPT);
}
RES res = RES(r);
@@ -1694,7 +1694,7 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
int len = varray.size();
for (int i = 0; i < len; i++) {
- Variant v = varray.get(i);
+ const Variant &v = varray.get(i);
_find_resources(v);
}
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index 45f3e46e35..bcdae343b8 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -352,7 +352,6 @@ void StreamPeerTCP::_bind_methods() {
StreamPeerTCP::StreamPeerTCP() :
_sock(Ref<NetSocket>(NetSocket::create())),
status(STATUS_NONE),
- peer_host(IP_Address()),
peer_port(0) {
}
diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp
index 6599c4eb5b..be87f47d50 100644
--- a/core/io/tcp_server.cpp
+++ b/core/io/tcp_server.cpp
@@ -83,11 +83,7 @@ bool TCP_Server::is_connection_available() const {
return false;
Error err = _sock->poll(NetSocket::POLL_TYPE_IN, 0);
- if (err != OK) {
- return false;
- }
-
- return true;
+ return (err == OK);
}
Ref<StreamPeerTCP> TCP_Server::take_connection() {
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index e484e9194d..b52658e2cf 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -1794,7 +1794,7 @@ Expression::ENode *Expression::_parse_expression() {
if (next_op == -1) {
_set_error("Yet another parser bug....");
- ERR_FAIL_COND_V(next_op == -1, NULL);
+ ERR_FAIL_V(NULL);
}
// OK! create operator..
diff --git a/core/math/random_number_generator.cpp b/core/math/random_number_generator.cpp
index 6add00c1d8..54a88d5cd8 100644
--- a/core/math/random_number_generator.cpp
+++ b/core/math/random_number_generator.cpp
@@ -30,8 +30,7 @@
#include "random_number_generator.h"
-RandomNumberGenerator::RandomNumberGenerator() :
- randbase() {}
+RandomNumberGenerator::RandomNumberGenerator() {}
void RandomNumberGenerator::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_seed", "seed"), &RandomNumberGenerator::set_seed);
diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h
index ee7bf0f6b5..8b01080852 100644
--- a/core/math/triangle_mesh.h
+++ b/core/math/triangle_mesh.h
@@ -97,7 +97,7 @@ public:
PoolVector<Triangle> get_triangles() const { return triangles; }
PoolVector<Vector3> get_vertices() const { return vertices; }
- void get_indices(PoolVector<int> *p_triangles_indices) const;
+ void get_indices(PoolVector<int> *r_triangles_indices) const;
void create(const PoolVector<Vector3> &p_faces);
TriangleMesh();
diff --git a/core/node_path.cpp b/core/node_path.cpp
index 07ff765516..a4b7cbe2eb 100644
--- a/core/node_path.cpp
+++ b/core/node_path.cpp
@@ -357,7 +357,7 @@ NodePath::NodePath(const String &p_path) {
String path = p_path;
Vector<StringName> subpath;
- int absolute = (path[0] == '/') ? 1 : 0;
+ bool absolute = (path[0] == '/');
bool last_is_slash = true;
bool has_slashes = false;
int slices = 0;
@@ -387,7 +387,7 @@ NodePath::NodePath(const String &p_path) {
path = path.substr(0, subpath_pos);
}
- for (int i = absolute; i < path.length(); i++) {
+ for (int i = (int)absolute; i < path.length(); i++) {
if (path[i] == '/') {
@@ -407,7 +407,7 @@ NodePath::NodePath(const String &p_path) {
data = memnew(Data);
data->refcount.init();
- data->absolute = absolute ? true : false;
+ data->absolute = absolute;
data->has_slashes = has_slashes;
data->subpath = subpath;
data->hash_cache_valid = false;
@@ -416,10 +416,10 @@ NodePath::NodePath(const String &p_path) {
return;
data->path.resize(slices);
last_is_slash = true;
- int from = absolute;
+ int from = (int)absolute;
int slice = 0;
- for (int i = absolute; i < path.length() + 1; i++) {
+ for (int i = (int)absolute; i < path.length() + 1; i++) {
if (path[i] == '/' || path[i] == 0) {
diff --git a/core/object.cpp b/core/object.cpp
index 64f55f08a9..ee512ff23c 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -474,7 +474,6 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
if (r_valid)
*r_valid = false;
- return;
}
Variant Object::get(const StringName &p_name, bool *r_valid) const {
@@ -810,11 +809,7 @@ bool Object::has_method(const StringName &p_method) const {
MethodBind *method = ClassDB::get_method(get_class_name(), p_method);
- if (method) {
- return true;
- }
-
- return false;
+ return method != NULL;
}
Variant Object::getvar(const Variant &p_key, bool *r_valid) const {
@@ -1485,7 +1480,7 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str
return OK;
} else {
ERR_EXPLAIN("Signal '" + p_signal + "' is already connected to given method '" + p_to_method + "' in that object.");
- ERR_FAIL_COND_V(s->slot_map.has(target), ERR_INVALID_PARAMETER);
+ ERR_FAIL_V(ERR_INVALID_PARAMETER);
}
}
@@ -1542,11 +1537,11 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const
Signal *s = signal_map.getptr(p_signal);
if (!s) {
ERR_EXPLAIN("Nonexistent signal: " + p_signal);
- ERR_FAIL_COND(!s);
+ ERR_FAIL();
}
if (s->lock > 0) {
ERR_EXPLAIN("Attempt to disconnect signal '" + p_signal + "' while emitting (locks: " + itos(s->lock) + ")");
- ERR_FAIL_COND(s->lock > 0);
+ ERR_FAIL();
}
Signal::Target target(p_to_object->get_instance_id(), p_to_method);
@@ -1689,7 +1684,7 @@ void Object::clear_internal_resource_paths() {
void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_class"), &Object::get_class);
- ClassDB::bind_method(D_METHOD("is_class", "type"), &Object::is_class);
+ ClassDB::bind_method(D_METHOD("is_class", "class"), &Object::is_class);
ClassDB::bind_method(D_METHOD("set", "property", "value"), &Object::_set_bind);
ClassDB::bind_method(D_METHOD("get", "property"), &Object::_get_bind);
ClassDB::bind_method(D_METHOD("set_indexed", "property", "value"), &Object::_set_indexed_bind);
@@ -1709,14 +1704,8 @@ void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_meta", "name"), &Object::has_meta);
ClassDB::bind_method(D_METHOD("get_meta_list"), &Object::_get_meta_list_bind);
- //todo reimplement this per language so all 5 arguments can be called
-
- //ClassDB::bind_method(D_METHOD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()));
- //ClassDB::bind_method(D_METHOD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()));
-
ClassDB::bind_method(D_METHOD("add_user_signal", "signal", "arguments"), &Object::_add_user_signal, DEFVAL(Array()));
ClassDB::bind_method(D_METHOD("has_user_signal", "signal"), &Object::_has_user_signal);
- //ClassDB::bind_method(D_METHOD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array()));
{
MethodInfo mi;
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index d81c30f33a..1c57bfdf3d 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -373,7 +373,7 @@ Error DirAccess::_copy_dir(DirAccess *p_target_da, String p_to, int p_chmod_flag
if (current_is_dir())
dirs.push_back(n);
else {
- String rel_path = n;
+ const String &rel_path = n;
if (!n.is_rel_path()) {
list_dir_end();
return ERR_BUG;
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 913caf6584..b5580b5c6e 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -601,7 +601,8 @@ Vector<uint8_t> FileAccess::get_file_as_array(const String &p_path, Error *r_err
if (r_error) { // if error requested, do not throw error
return Vector<uint8_t>();
}
- ERR_FAIL_COND_V(!f, Vector<uint8_t>());
+ ERR_EXPLAIN("Can't open file from path: " + String(p_path));
+ ERR_FAIL_V(Vector<uint8_t>());
}
Vector<uint8_t> data;
data.resize(f->get_len());
@@ -621,7 +622,8 @@ String FileAccess::get_file_as_string(const String &p_path, Error *r_error) {
if (r_error) {
return String();
}
- ERR_FAIL_COND_V(err != OK, String());
+ ERR_EXPLAIN("Can't get file as string from path: " + String(p_path));
+ ERR_FAIL_V(String());
}
String ret;
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 9c5066da3d..a40a50cfce 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -314,7 +314,7 @@ bool InputEventKey::action_match(const Ref<InputEvent> &p_event, bool *p_pressed
if (p_pressed != NULL)
*p_pressed = key->is_pressed();
if (p_strength != NULL)
- *p_strength = (*p_pressed) ? 1.0f : 0.0f;
+ *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f;
}
return match;
}
@@ -483,7 +483,7 @@ bool InputEventMouseButton::action_match(const Ref<InputEvent> &p_event, bool *p
if (p_pressed != NULL)
*p_pressed = mb->is_pressed();
if (p_strength != NULL)
- *p_strength = (*p_pressed) ? 1.0f : 0.0f;
+ *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f;
}
return match;
@@ -795,7 +795,7 @@ bool InputEventJoypadButton::action_match(const Ref<InputEvent> &p_event, bool *
if (p_pressed != NULL)
*p_pressed = jb->is_pressed();
if (p_strength != NULL)
- *p_strength = (*p_pressed) ? 1.0f : 0.0f;
+ *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f;
}
return match;
@@ -1041,7 +1041,7 @@ bool InputEventAction::action_match(const Ref<InputEvent> &p_event, bool *p_pres
if (p_pressed != NULL)
*p_pressed = act->pressed;
if (p_strength != NULL)
- *p_strength = (*p_pressed) ? 1.0f : 0.0f;
+ *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f;
}
return match;
}
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 895ce14ae9..9946ced2f3 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -44,9 +44,9 @@ void MainLoop::_bind_methods() {
BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text")));
BIND_VMETHOD(MethodInfo("_initialize"));
- BIND_VMETHOD(MethodInfo("_iteration", PropertyInfo(Variant::REAL, "delta")));
- BIND_VMETHOD(MethodInfo("_idle", PropertyInfo(Variant::REAL, "delta")));
- BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen")));
+ BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta")));
+ BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta")));
+ BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
BIND_VMETHOD(MethodInfo("_finalize"));
BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER);
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 1a3c9ac5f8..027740c6a9 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -239,7 +239,8 @@ void OS::print_all_resources(String p_to_file) {
_OSPRF = FileAccess::open(p_to_file, FileAccess::WRITE, &err);
if (err != OK) {
_OSPRF = NULL;
- ERR_FAIL_COND(err != OK);
+ ERR_EXPLAIN("Can't print all resources to file: " + String(p_to_file));
+ ERR_FAIL();
}
}
diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp
index 11a3be89bd..094352b5cc 100644
--- a/core/pool_allocator.cpp
+++ b/core/pool_allocator.cpp
@@ -206,8 +206,8 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) {
if (!find_hole(&new_entry_indices_pos, size_to_alloc)) {
mt_unlock();
- ERR_PRINT("memory can't be compacted further");
- return POOL_ALLOCATOR_INVALID_ID;
+ ERR_EXPLAIN("Memory can't be compacted further");
+ ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID);
}
}
@@ -217,7 +217,8 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) {
if (!found_free_entry) {
mt_unlock();
- ERR_FAIL_COND_V(!found_free_entry, POOL_ALLOCATOR_INVALID_ID);
+ ERR_EXPLAIN("No free entry found in PoolAllocator");
+ ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID);
}
/* move all entry indices up, make room for this one */
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index 0508806a35..983b2a2576 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -566,7 +566,7 @@ Error ProjectSettings::_load_settings_text(const String p_path) {
if (config_version > CONFIG_VERSION) {
memdelete(f);
ERR_EXPLAIN(vformat("Can't open project at '%s', its `config_version` (%d) is from a more recent and incompatible version of the engine. Expected config version: %d.", p_path, config_version, CONFIG_VERSION));
- ERR_FAIL_COND_V(config_version > CONFIG_VERSION, ERR_FILE_CANT_OPEN);
+ ERR_FAIL_V(ERR_FILE_CANT_OPEN);
}
} else {
if (section == String()) {
diff --git a/core/safe_refcount.h b/core/safe_refcount.h
index f6b8f80271..54f540b0c7 100644
--- a/core/safe_refcount.h
+++ b/core/safe_refcount.h
@@ -189,11 +189,7 @@ public:
_ALWAYS_INLINE_ bool unref() { // true if must be disposed of
- if (atomic_decrement(&count) == 0) {
- return true;
- }
-
- return false;
+ return atomic_decrement(&count) == 0;
}
_ALWAYS_INLINE_ uint32_t get() const { // nothrow
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index f7ca6d3bde..f0c2b8eb9b 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -336,6 +336,7 @@ bool UndoRedo::redo() {
_process_operation_list(actions.write[current_action].do_ops.front());
version++;
+ emit_signal("version_changed");
return true;
}
@@ -348,6 +349,8 @@ bool UndoRedo::undo() {
_process_operation_list(actions.write[current_action].undo_ops.front());
current_action--;
version--;
+ emit_signal("version_changed");
+
return true;
}
@@ -359,18 +362,30 @@ void UndoRedo::clear_history(bool p_increase_version) {
while (actions.size())
_pop_history_tail();
- if (p_increase_version)
+ if (p_increase_version) {
version++;
+ emit_signal("version_changed");
+ }
}
String UndoRedo::get_current_action_name() const {
ERR_FAIL_COND_V(action_level > 0, "");
if (current_action < 0)
- return ""; //nothing to redo
+ return "";
return actions[current_action].name;
}
+bool UndoRedo::has_undo() {
+
+ return current_action >= 0;
+}
+
+bool UndoRedo::has_redo() {
+
+ return (current_action + 1) < actions.size();
+}
+
uint64_t UndoRedo::get_version() const {
return version;
@@ -523,10 +538,14 @@ void UndoRedo::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_undo_reference", "object"), &UndoRedo::add_undo_reference);
ClassDB::bind_method(D_METHOD("clear_history", "increase_version"), &UndoRedo::clear_history, DEFVAL(true));
ClassDB::bind_method(D_METHOD("get_current_action_name"), &UndoRedo::get_current_action_name);
+ ClassDB::bind_method(D_METHOD("has_undo"), &UndoRedo::has_undo);
+ ClassDB::bind_method(D_METHOD("has_redo"), &UndoRedo::has_redo);
ClassDB::bind_method(D_METHOD("get_version"), &UndoRedo::get_version);
ClassDB::bind_method(D_METHOD("redo"), &UndoRedo::redo);
ClassDB::bind_method(D_METHOD("undo"), &UndoRedo::undo);
+ ADD_SIGNAL(MethodInfo("version_changed"));
+
BIND_ENUM_CONSTANT(MERGE_DISABLE);
BIND_ENUM_CONSTANT(MERGE_ENDS);
BIND_ENUM_CONSTANT(MERGE_ALL);
diff --git a/core/undo_redo.h b/core/undo_redo.h
index e2cc6c659b..276d00d9af 100644
--- a/core/undo_redo.h
+++ b/core/undo_redo.h
@@ -118,6 +118,9 @@ public:
String get_current_action_name() const;
void clear_history(bool p_increase_version = true);
+ bool has_undo();
+ bool has_redo();
+
uint64_t get_version() const;
void set_commit_notify_callback(CommitNotifyCallback p_callback, void *p_ud);
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 686aa6f8e3..ff28fa420d 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3799,11 +3799,7 @@ bool String::is_valid_filename() const {
return false;
}
- if (find(":") != -1 || find("/") != -1 || find("\\") != -1 || find("?") != -1 || find("*") != -1 || find("\"") != -1 || find("|") != -1 || find("%") != -1 || find("<") != -1 || find(">") != -1) {
- return false;
- } else {
- return true;
- }
+ return !(find(":") != -1 || find("/") != -1 || find("\\") != -1 || find("?") != -1 || find("*") != -1 || find("\"") != -1 || find("|") != -1 || find("%") != -1 || find("<") != -1 || find(">") != -1);
}
bool String::is_valid_ip_address() const {
@@ -3941,7 +3937,6 @@ String String::percent_decode() const {
uint8_t a = LOWERCASE(cs[i + 1]);
uint8_t b = LOWERCASE(cs[i + 2]);
- c = 0;
if (a >= '0' && a <= '9')
c = (a - '0') << 4;
else if (a >= 'a' && a <= 'f')
diff --git a/core/ustring.h b/core/ustring.h
index ecf934a26b..a32daabb91 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -404,8 +404,6 @@ _FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) {
l_ptr++;
r_ptr++;
}
-
- CRASH_COND(true); // unreachable
}
/* end of namespace */
diff --git a/core/variant.cpp b/core/variant.cpp
index 6eadf59fce..9306867ac7 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -709,7 +709,7 @@ bool Variant::is_zero() const {
// atomic types
case BOOL: {
- return _data._bool == false;
+ return !(_data._bool);
} break;
case INT: {
diff --git a/core/variant.h b/core/variant.h
index 5151262f27..a8e99c13f1 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -248,8 +248,8 @@ public:
Variant(unsigned short p_short);
Variant(signed char p_char); // real one
Variant(unsigned char p_char);
- Variant(int64_t p_char); // real one
- Variant(uint64_t p_char);
+ Variant(int64_t p_int); // real one
+ Variant(uint64_t p_int);
Variant(float p_float);
Variant(double p_double);
Variant(const String &p_string);
@@ -262,11 +262,11 @@ public:
Variant(const Plane &p_plane);
Variant(const ::AABB &p_aabb);
Variant(const Quat &p_quat);
- Variant(const Basis &p_transform);
+ Variant(const Basis &p_matrix);
Variant(const Transform2D &p_transform);
Variant(const Transform &p_transform);
Variant(const Color &p_color);
- Variant(const NodePath &p_path);
+ Variant(const NodePath &p_node_path);
Variant(const RefPtr &p_resource);
Variant(const RID &p_rid);
Variant(const Object *p_object);
@@ -283,17 +283,17 @@ public:
Variant(const PoolVector<Face3> &p_face_array);
Variant(const Vector<Variant> &p_array);
- Variant(const Vector<uint8_t> &p_raw_array);
- Variant(const Vector<int> &p_int_array);
- Variant(const Vector<real_t> &p_real_array);
- Variant(const Vector<String> &p_string_array);
- Variant(const Vector<StringName> &p_string_array);
- Variant(const Vector<Vector3> &p_vector3_array);
- Variant(const Vector<Color> &p_color_array);
+ Variant(const Vector<uint8_t> &p_array);
+ Variant(const Vector<int> &p_array);
+ Variant(const Vector<real_t> &p_array);
+ Variant(const Vector<String> &p_array);
+ Variant(const Vector<StringName> &p_array);
+ Variant(const Vector<Vector3> &p_array);
+ Variant(const Vector<Color> &p_array);
Variant(const Vector<Plane> &p_array); // helper
Variant(const Vector<RID> &p_array); // helper
Variant(const Vector<Vector2> &p_array); // helper
- Variant(const PoolVector<Vector2> &p_array); // helper
+ Variant(const PoolVector<Vector2> &p_vector2_array); // helper
Variant(const IP_Address &p_address);
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index d36a545c56..df98048a97 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -968,7 +968,7 @@
Joypad Button 15
</constant>
<constant name="JOY_BUTTON_MAX" value="16" enum="JoystickList">
- Joypad Button 16
+ Represents the maximum number of joystick buttons supported.
</constant>
<constant name="JOY_SONY_CIRCLE" value="1" enum="JoystickList">
DUALSHOCK circle button
@@ -1090,6 +1090,7 @@
<constant name="JOY_AXIS_9" value="9" enum="JoystickList">
</constant>
<constant name="JOY_AXIS_MAX" value="10" enum="JoystickList">
+ Represents the maximum number of joystick axes supported.
</constant>
<constant name="JOY_ANALOG_LX" value="0" enum="JoystickList">
Joypad Left Stick Horizontal Axis
@@ -1136,127 +1137,160 @@
<constant name="MIDI_MESSAGE_PITCH_BEND" value="14" enum="MidiMessageList">
</constant>
<constant name="OK" value="0" enum="Error">
- Functions that return Error return OK when no error occurred. Most functions don't return errors and/or just print errors to STDOUT.
+ Methods that return [enum Error] return [constant OK] when no error occurred. Note that many functions don't return an error code but will print error messages to stdout.
+ Since [constant OK] has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.:
+ [codeblock]
+ var err = method_that_returns_error()
+ if (err != OK):
+ print("Failure!)
+ # Or, equivalent:
+ if (err):
+ print("Still failing!)
+ [/codeblock]
</constant>
<constant name="FAILED" value="1" enum="Error">
Generic error.
</constant>
<constant name="ERR_UNAVAILABLE" value="2" enum="Error">
- Unavailable error
+ Unavailable error.
</constant>
<constant name="ERR_UNCONFIGURED" value="3" enum="Error">
- Unconfigured error
+ Unconfigured error.
</constant>
<constant name="ERR_UNAUTHORIZED" value="4" enum="Error">
- Unauthorized error
+ Unauthorized error.
</constant>
<constant name="ERR_PARAMETER_RANGE_ERROR" value="5" enum="Error">
- Parameter range error
+ Parameter range error.
</constant>
<constant name="ERR_OUT_OF_MEMORY" value="6" enum="Error">
- Out of memory (OOM) error
+ Out of memory (OOM) error.
</constant>
<constant name="ERR_FILE_NOT_FOUND" value="7" enum="Error">
- File: Not found error
+ File: Not found error.
</constant>
<constant name="ERR_FILE_BAD_DRIVE" value="8" enum="Error">
- File: Bad drive error
+ File: Bad drive error.
</constant>
<constant name="ERR_FILE_BAD_PATH" value="9" enum="Error">
- File: Bad path error
+ File: Bad path error.
</constant>
<constant name="ERR_FILE_NO_PERMISSION" value="10" enum="Error">
- File: No permission error
+ File: No permission error.
</constant>
<constant name="ERR_FILE_ALREADY_IN_USE" value="11" enum="Error">
- File: Already in use error
+ File: Already in use error.
</constant>
<constant name="ERR_FILE_CANT_OPEN" value="12" enum="Error">
- File: Can't open error
+ File: Can't open error.
</constant>
<constant name="ERR_FILE_CANT_WRITE" value="13" enum="Error">
- File: Can't write error
+ File: Can't write error.
</constant>
<constant name="ERR_FILE_CANT_READ" value="14" enum="Error">
- File: Can't read error
+ File: Can't read error.
</constant>
<constant name="ERR_FILE_UNRECOGNIZED" value="15" enum="Error">
- File: Unrecognized error
+ File: Unrecognized error.
</constant>
<constant name="ERR_FILE_CORRUPT" value="16" enum="Error">
- File: Corrupt error
+ File: Corrupt error.
</constant>
<constant name="ERR_FILE_MISSING_DEPENDENCIES" value="17" enum="Error">
- File: Missing dependencies error
+ File: Missing dependencies error.
</constant>
<constant name="ERR_FILE_EOF" value="18" enum="Error">
- File: End of file (EOF) error
+ File: End of file (EOF) error.
</constant>
<constant name="ERR_CANT_OPEN" value="19" enum="Error">
- Can't open error
+ Can't open error.
</constant>
<constant name="ERR_CANT_CREATE" value="20" enum="Error">
- Can't create error
- </constant>
- <constant name="ERR_PARSE_ERROR" value="43" enum="Error">
- Parse error
+ Can't create error.
</constant>
<constant name="ERR_QUERY_FAILED" value="21" enum="Error">
- Query failed error
+ Query failed error.
</constant>
<constant name="ERR_ALREADY_IN_USE" value="22" enum="Error">
- Already in use error
+ Already in use error.
</constant>
<constant name="ERR_LOCKED" value="23" enum="Error">
- Locked error
+ Locked error.
</constant>
<constant name="ERR_TIMEOUT" value="24" enum="Error">
- Timeout error
+ Timeout error.
+ </constant>
+ <constant name="ERR_CANT_CONNECT" value="25" enum="Error">
+ Can't connect error.
+ </constant>
+ <constant name="ERR_CANT_RESOLVE" value="26" enum="Error">
+ Can't resolve error.
+ </constant>
+ <constant name="ERR_CONNECTION_ERROR" value="27" enum="Error">
+ Connection error.
</constant>
<constant name="ERR_CANT_ACQUIRE_RESOURCE" value="28" enum="Error">
- Can't acquire resource error
+ Can't acquire resource error.
+ </constant>
+ <constant name="ERR_CANT_FORK" value="29" enum="Error">
+ Can't fork process error.
</constant>
<constant name="ERR_INVALID_DATA" value="30" enum="Error">
- Invalid data error
+ Invalid data error.
</constant>
<constant name="ERR_INVALID_PARAMETER" value="31" enum="Error">
- Invalid parameter error
+ Invalid parameter error.
</constant>
<constant name="ERR_ALREADY_EXISTS" value="32" enum="Error">
- Already exists error
+ Already exists error.
</constant>
<constant name="ERR_DOES_NOT_EXIST" value="33" enum="Error">
- Does not exist error
+ Does not exist error.
</constant>
<constant name="ERR_DATABASE_CANT_READ" value="34" enum="Error">
- Database: Read error
+ Database: Read error.
</constant>
<constant name="ERR_DATABASE_CANT_WRITE" value="35" enum="Error">
- Database: Write error
+ Database: Write error.
</constant>
<constant name="ERR_COMPILATION_FAILED" value="36" enum="Error">
- Compilation failed error
+ Compilation failed error.
</constant>
<constant name="ERR_METHOD_NOT_FOUND" value="37" enum="Error">
- Method not found error
+ Method not found error.
</constant>
<constant name="ERR_LINK_FAILED" value="38" enum="Error">
- Linking failed error
+ Linking failed error.
</constant>
<constant name="ERR_SCRIPT_FAILED" value="39" enum="Error">
- Script failed error
+ Script failed error.
</constant>
<constant name="ERR_CYCLIC_LINK" value="40" enum="Error">
- Cycling link (import cycle) error
+ Cycling link (import cycle) error.
+ </constant>
+ <constant name="ERR_INVALID_DECLARATION" value="41" enum="Error">
+ Invalid declaration error.
+ </constant>
+ <constant name="ERR_DUPLICATE_SYMBOL" value="42" enum="Error">
+ Duplicate symbol error.
+ </constant>
+ <constant name="ERR_PARSE_ERROR" value="43" enum="Error">
+ Parse error.
</constant>
<constant name="ERR_BUSY" value="44" enum="Error">
- Busy error
+ Busy error.
+ </constant>
+ <constant name="ERR_SKIP" value="45" enum="Error">
+ Skip error.
</constant>
<constant name="ERR_HELP" value="46" enum="Error">
- Help error
+ Help error.
</constant>
<constant name="ERR_BUG" value="47" enum="Error">
- Bug error
+ Bug error.
+ </constant>
+ <constant name="ERR_PRINTER_ON_FIRE" value="48" enum="Error">
+ Printer on fire error. (This is an easter egg, no engine methods return this error code.)
</constant>
<constant name="PROPERTY_HINT_NONE" value="0" enum="PropertyHint">
No hint for edited property.
@@ -1449,7 +1483,7 @@
Variable is of type [PoolColorArray].
</constant>
<constant name="TYPE_MAX" value="27" enum="Variant.Type">
- Marker for end of type constants.
+ Represents the size of the [enum Variant.Type] enum.
</constant>
<constant name="OP_EQUAL" value="0" enum="Variant.Operator">
</constant>
@@ -1502,6 +1536,7 @@
<constant name="OP_IN" value="24" enum="Variant.Operator">
</constant>
<constant name="OP_MAX" value="25" enum="Variant.Operator">
+ Represents the size of the [enum Variant.Operator] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/ARVRAnchor.xml b/doc/classes/ARVRAnchor.xml
index 91f44151fa..ff2691f7a7 100644
--- a/doc/classes/ARVRAnchor.xml
+++ b/doc/classes/ARVRAnchor.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
- This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised.
+ This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognized.
Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
</description>
<tutorials>
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml
index 81722535c2..0c7de55329 100644
--- a/doc/classes/AStar.xml
+++ b/doc/classes/AStar.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
A* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting an efficiently directed path between multiple points. It enjoys widespread use due to its performance and accuracy. Godot's A* implementation make use of vectors as points.
- You must add points manually with [method AStar.add_point] and create segments manually with [method AStar.connect_points]. So you can test if there is a path between two points with the [method AStar.are_points_connected] function, get the list of existing ids in the found path with [method AStar.get_id_path], or the points list with [method AStar.get_point_path].
+ You must add points manually with [method add_point] and create segments manually with [method connect_points]. So you can test if there is a path between two points with the [method are_points_connected] function, get the list of existing ids in the found path with [method get_id_path], or the points list with [method get_point_path].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/AnimationNodeStateMachineTransition.xml b/doc/classes/AnimationNodeStateMachineTransition.xml
index aeb44a789b..0ba3e7057e 100644
--- a/doc/classes/AnimationNodeStateMachineTransition.xml
+++ b/doc/classes/AnimationNodeStateMachineTransition.xml
@@ -16,7 +16,7 @@
[/codeblock]
</member>
<member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance">
- Turn on the transition automatically when this state is reached. This works best with [code]SWITCH_MODE_AT_END[/code].
+ Turn on the transition automatically when this state is reached. This works best with [constant SWITCH_MODE_AT_END].
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
Don't use this transition during [method AnimationNodeStateMachinePlayback.travel] or [member auto_advance].
diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml
index ff91db2e28..3e2fad8a92 100644
--- a/doc/classes/AnimationPlayer.xml
+++ b/doc/classes/AnimationPlayer.xml
@@ -239,7 +239,7 @@
The position (in seconds) of the currently playing animation.
</member>
<member name="method_call_mode" type="int" setter="set_method_call_mode" getter="get_method_call_mode" enum="AnimationPlayer.AnimationMethodCallMode">
- The call mode to use for Call Method tracks. Default value: [code]ANIMATION_METHOD_CALL_DEFERRED[/code].
+ The call mode to use for Call Method tracks. Default value: [constant ANIMATION_METHOD_CALL_DEFERRED].
</member>
<member name="playback_active" type="bool" setter="set_active" getter="is_active">
If [code]true[/code], updates animations in response to process-related notifications. Default value: [code]true[/code].
@@ -248,7 +248,7 @@
The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. Default value: [code]0[/code].
</member>
<member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationPlayer.AnimationProcessMode">
- The process notification in which to update animations. Default value: [code]ANIMATION_PROCESS_IDLE[/code].
+ The process notification in which to update animations. Default value: [constant ANIMATION_PROCESS_IDLE].
</member>
<member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale">
The speed scaling ratio. For instance, if this value is 1 then the animation plays at normal speed. If it's 0.5 then it plays at half speed. If it's 2 then it plays at double speed. Default value: [code]1[/code].
diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml
index 818565e0dc..179dc5577b 100644
--- a/doc/classes/AnimationTreePlayer.xml
+++ b/doc/classes/AnimationTreePlayer.xml
@@ -616,7 +616,7 @@
Once set, Animation nodes can be added to the AnimationTreePlayer.
</member>
<member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationTreePlayer.AnimationProcessMode">
- The thread in which to update animations. Default value: [code]ANIMATION_PROCESS_IDLE[/code].
+ The thread in which to update animations. Default value: [constant ANIMATION_PROCESS_IDLE].
</member>
</members>
<constants>
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml
index d40376414f..17d9678f64 100644
--- a/doc/classes/Area.xml
+++ b/doc/classes/Area.xml
@@ -136,7 +136,7 @@
The degree to which this area's reverb is a uniform effect. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision.
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area.SpaceOverride">
- Override mode for gravity and damping calculations within this area. See [enum Area.SpaceOverride] for possible values.
+ Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
</member>
</members>
<signals>
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index 4771a976b5..c287f2b6f5 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -124,7 +124,7 @@
The area's priority. Higher priority areas are processed first. Default value: 0.
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride">
- Override mode for gravity and damping calculations within this area. See [enum Area2D.SpaceOverride] for possible values.
+ Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
</member>
</members>
<signals>
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index d44e3c54c9..19fe833334 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -48,7 +48,7 @@
<description>
Creates a new surface.
Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. See [Mesh] for details. (As a note, when using indices, it is recommended to only use points, lines or triangles). [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
- The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [code]ARRAY_INDEX[/code] if it is used.
+ The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used.
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
Godot uses clockwise winding order for front faces of triangle primitive modes.
</description>
@@ -225,6 +225,7 @@
For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
</constant>
<constant name="ARRAY_MAX" value="9" enum="ArrayType">
+ Represents the size of the [enum ArrayType] enum.
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
Array format will include vertices (mandatory).
diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml
index 4393f942f0..cf02a8fb6d 100644
--- a/doc/classes/AudioEffectDistortion.xml
+++ b/doc/classes/AudioEffectDistortion.xml
@@ -20,7 +20,7 @@
High-pass filter. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000. Default value: [code]16000[/code].
</member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="AudioEffectDistortion.Mode">
- Distortion type. Default value: [code]MODE_CLIP[/code].
+ Distortion type. Default value: [constant MODE_CLIP].
</member>
<member name="post_gain" type="float" setter="set_post_gain" getter="get_post_gain">
Increases or decreases the volume after the effect. Value can range from -80 to 24. Default value: [code]0[/code].
diff --git a/doc/classes/AudioEffectPitchShift.xml b/doc/classes/AudioEffectPitchShift.xml
index 8c22afb40f..271e1a2a4c 100644
--- a/doc/classes/AudioEffectPitchShift.xml
+++ b/doc/classes/AudioEffectPitchShift.xml
@@ -32,6 +32,7 @@
<constant name="FFT_SIZE_4096" value="4" enum="FFT_Size">
</constant>
<constant name="FFT_SIZE_MAX" value="5" enum="FFT_Size">
+ Represents the size of the [enum FFT_Size] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectSpectrumAnalyzer.xml b/doc/classes/AudioEffectSpectrumAnalyzer.xml
index 8a71991437..21d74a8fb0 100644
--- a/doc/classes/AudioEffectSpectrumAnalyzer.xml
+++ b/doc/classes/AudioEffectSpectrumAnalyzer.xml
@@ -28,6 +28,7 @@
<constant name="FFT_SIZE_4096" value="4" enum="FFT_Size">
</constant>
<constant name="FFT_SIZE_MAX" value="5" enum="FFT_Size">
+ Represents the size of the [enum FFT_Size] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
index f4620f9905..ca068d572d 100644
--- a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
+++ b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml
@@ -22,8 +22,10 @@
</methods>
<constants>
<constant name="MAGNITUDE_AVERAGE" value="0" enum="MagnitudeMode">
+ Use the average value as magnitude.
</constant>
<constant name="MAGNITUDE_MAX" value="1" enum="MagnitudeMode">
+ Use the maximum value as magnitude.
</constant>
</constants>
</class>
diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml
index 65e8774c59..1ee4f08a38 100644
--- a/doc/classes/BackBufferCopy.xml
+++ b/doc/classes/BackBufferCopy.xml
@@ -12,10 +12,10 @@
</methods>
<members>
<member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" enum="BackBufferCopy.CopyMode">
- Buffer mode. See [code]COPY_MODE_*[/code] constants.
+ Buffer mode. See [enum CopyMode] constants.
</member>
<member name="rect" type="Rect2" setter="set_rect" getter="get_rect">
- The area covered by the BackBufferCopy. Only used if [code]copy_mode[/code] is [code]COPY_MODE_RECT[/code].
+ The area covered by the BackBufferCopy. Only used if [member copy_mode] is [constant COPY_MODE_RECT].
</member>
</members>
<constants>
diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml
index cc869d28a2..b7d983afa2 100644
--- a/doc/classes/Camera.xml
+++ b/doc/classes/Camera.xml
@@ -168,7 +168,7 @@
If [code]true[/code], the ancestor [Viewport] is currently using this Camera. Default value: [code]false[/code].
</member>
<member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" enum="Camera.DopplerTracking">
- If not [code]DOPPLER_TRACKING_DISABLED[/code] this Camera will simulate the Doppler effect for objects changed in particular [code]_process[/code] methods. Default value: [code]DOPPLER_TRACKING_DISABLED[/code].
+ If not [constant DOPPLER_TRACKING_DISABLED] this Camera will simulate the Doppler effect for objects changed in particular [code]_process[/code] methods. Default value: [constant DOPPLER_TRACKING_DISABLED].
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] to use for this Camera.
@@ -185,13 +185,13 @@
The horizontal (X) offset of the Camera viewport.
</member>
<member name="keep_aspect" type="int" setter="set_keep_aspect_mode" getter="get_keep_aspect_mode" enum="Camera.KeepAspect">
- The axis to lock during [member fov]/[member size] adjustments. Can be either [code]KEEP_WIDTH[/code] or [code]KEEP_HEIGHT[/code].
+ The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT].
</member>
<member name="near" type="float" setter="set_znear" getter="get_znear">
The distance to the near culling boundary for this Camera relative to its local z-axis.
</member>
<member name="projection" type="int" setter="set_projection" getter="get_projection" enum="Camera.Projection">
- The camera's projection mode. In [code]PROJECTION_PERSPECTIVE[/code] mode, objects' z-distance from the camera's local space scales their perceived size.
+ The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' z-distance from the camera's local space scales their perceived size.
</member>
<member name="size" type="float" setter="set_size" getter="get_size">
The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since [member keep_aspect] locks on axis, [code]size[/code] sets the other axis' size length.
diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml
index 3d609fa965..b0c514affc 100644
--- a/doc/classes/CollisionPolygon2D.xml
+++ b/doc/classes/CollisionPolygon2D.xml
@@ -12,7 +12,7 @@
</methods>
<members>
<member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode">
- Collision build mode. Use one of the [code]BUILD_*[/code] constants. Default value: [code]BUILD_SOLIDS[/code].
+ Collision build mode. Use one of the [code]BUILD_*[/code] constants. Default value: [constant BUILD_SOLIDS].
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
If [code]true[/code], no collisions will be detected.
diff --git a/doc/classes/ConeTwistJoint.xml b/doc/classes/ConeTwistJoint.xml
index cd2289d715..28dee22b7f 100644
--- a/doc/classes/ConeTwistJoint.xml
+++ b/doc/classes/ConeTwistJoint.xml
@@ -25,9 +25,9 @@
</member>
<member name="swing_span" type="float" setter="_set_swing_span" getter="_get_swing_span">
Swing is rotation from side to side, around the axis perpendicular to the twist axis.
- The swing span defines, how much rotation will not get corrected allong the swing axis.
+ The swing span defines, how much rotation will not get corrected along the swing axis.
Could be defined as looseness in the [ConeTwistJoint].
- If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code].
+ If below 0.05, this behavior is locked. Default value: [code]PI/4[/code].
</member>
<member name="twist_span" type="float" setter="_set_twist_span" getter="_get_twist_span">
Twist is the rotation around the twist axis, this value defined how far the joint can twist.
@@ -37,9 +37,9 @@
<constants>
<constant name="PARAM_SWING_SPAN" value="0" enum="Param">
Swing is rotation from side to side, around the axis perpendicular to the twist axis.
- The swing span defines, how much rotation will not get corrected allong the swing axis.
+ The swing span defines, how much rotation will not get corrected along the swing axis.
Could be defined as looseness in the [ConeTwistJoint].
- If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code].
+ If below 0.05, this behavior is locked. Default value: [code]PI/4[/code].
</constant>
<constant name="PARAM_TWIST_SPAN" value="1" enum="Param">
Twist is the rotation around the twist axis, this value defined how far the joint can twist.
@@ -56,7 +56,7 @@
Defines, how fast the swing- and twist-speed-difference on both sides gets synced.
</constant>
<constant name="PARAM_MAX" value="5" enum="Param">
- End flag of PARAM_* constants, used internally.
+ Represents the size of the [enum Param] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml
index 68831a886a..b65f3c5609 100644
--- a/doc/classes/ConfigFile.xml
+++ b/doc/classes/ConfigFile.xml
@@ -94,7 +94,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [code]OK[/code].
+ Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [constant OK], [constant FAILED] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [constant OK].
</description>
</method>
<method name="save">
@@ -103,7 +103,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [code]OK[/code].
+ Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [constant OK], [constant FAILED] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [constant OK].
</description>
</method>
<method name="set_value">
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index fea706987c..d2c6b02e6e 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -645,16 +645,16 @@
</methods>
<members>
<member name="anchor_bottom" type="float" setter="_set_anchor" getter="get_anchor">
- Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. Default value: [code]ANCHOR_BEGIN[/code].
+ Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience. Default value: [constant ANCHOR_BEGIN].
</member>
<member name="anchor_left" type="float" setter="_set_anchor" getter="get_anchor">
- Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience.Default value: [code]ANCHOR_BEGIN[/code].
+ Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the [code]ANCHOR_*[/code] constants for convenience.Default value: [constant ANCHOR_BEGIN].
</member>
<member name="anchor_right" type="float" setter="_set_anchor" getter="get_anchor">
- 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 [code]ANCHOR_*[/code] constants for convenience. Default value: [code]ANCHOR_BEGIN[/code].
+ 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 [code]ANCHOR_*[/code] constants for convenience. Default value: [constant ANCHOR_BEGIN].
</member>
<member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor">
- 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 [code]ANCHOR_*[/code] constants for convenience. Default value: [code]ANCHOR_BEGIN[/code].
+ 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 [code]ANCHOR_*[/code] constants for convenience. Default value: [constant ANCHOR_BEGIN].
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode">
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.
@@ -739,7 +739,7 @@
Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [code]SIZE_*[/code] constants to change the flags. See the constants to learn what each does.
</member>
<member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio">
- If the node and at least one of its neighbours uses the [code]SIZE_EXPAND[/code] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.
+ If the node and at least one of its neighbours uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags">
Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [code]SIZE_*[/code] constants to change the flags. See the constants to learn what each does.
@@ -871,16 +871,16 @@
Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.
</constant>
<constant name="CURSOR_FDIAGSIZE" value="12" enum="CursorShape">
- Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double headed arrow that goes from the top left to the bottom right, the opposite of [code]CURSOR_BDIAGSIZE[/code]. It tells the user they can resize the window or the panel both horizontally and vertically.
+ Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically.
</constant>
<constant name="CURSOR_MOVE" value="13" enum="CursorShape">
Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely.
</constant>
<constant name="CURSOR_VSPLIT" value="14" enum="CursorShape">
- Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [code]CURSOR_VSIZE[/code].
+ Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_VSIZE].
</constant>
<constant name="CURSOR_HSPLIT" value="15" enum="CursorShape">
- Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [code]CURSOR_HSIZE[/code].
+ Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_HSIZE].
</constant>
<constant name="CURSOR_HELP" value="16" enum="CursorShape">
Show the system's help mouse cursor when the user hovers the node, a question mark.
diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml
index 20afb03048..f7af2c159f 100644
--- a/doc/classes/Curve.xml
+++ b/doc/classes/Curve.xml
@@ -23,7 +23,7 @@
<argument index="4" name="right_mode" type="int" enum="Curve.TangentMode" default="0">
</argument>
<description>
- Adds a point to the curve. For each side, if the [code]*_mode[/code] is [code]TANGENT_LINEAR[/code], the [code]*_tangent[/code] angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is set to [code]TANGENT_FREE[/code].
+ Adds a point to the curve. For each side, if the [code]*_mode[/code] is [constant TANGENT_LINEAR], the [code]*_tangent[/code] angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is set to [constant TANGENT_FREE].
</description>
</method>
<method name="bake">
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index 7fda8aaa93..2966e2f8c0 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -246,7 +246,7 @@
The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care.
</member>
<member name="up_vector_enabled" type="bool" setter="set_up_vector_enabled" getter="is_up_vector_enabled">
- If [code]true[/code], the curve will bake up vectors used for orientation. This is used when a [member PathFollow.rotation_mode] is set to [code]ROTATION_ORIENTED[/code], see [PathFollow] for details. Changing it forces the cache to be recomputed.
+ If [code]true[/code], the curve will bake up vectors used for orientation. This is used when [member PathFollow.rotation_mode] is set to [constant PathFollow.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed.
</member>
</members>
<constants>
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index 54aac33652..9c33b4fc0e 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -126,7 +126,7 @@
<argument index="1" name="skip_hidden" type="bool" default="false">
</argument>
<description>
- Initialise the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end].
+ Initialize the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end].
If you pass [code]skip_navigational[/code], then [code].[/code] and [code]..[/code] would be filtered out.
If you pass [code]skip_hidden[/code], then hidden files would be filtered out.
</description>
diff --git a/doc/classes/EditorFeatureProfile.xml b/doc/classes/EditorFeatureProfile.xml
index 410b71a43e..21da9fd454 100644
--- a/doc/classes/EditorFeatureProfile.xml
+++ b/doc/classes/EditorFeatureProfile.xml
@@ -124,6 +124,7 @@
<constant name="FEATURE_FILESYSTEM_DOCK" value="6" enum="Feature">
</constant>
<constant name="FEATURE_MAX" value="7" enum="Feature">
+ Represents the size of the [enum Feature] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index c3f38e9e20..e66596412b 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="EditorImportPlugin" inherits="Reference" category="Core" version="3.2">
+<class name="EditorImportPlugin" inherits="ResourceImporter" category="Core" version="3.2">
<brief_description>
Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type.
</brief_description>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 3d91bff0aa..36d6e38be9 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -292,7 +292,7 @@
<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 [code]true[/code], 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.
+ Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method edit] and [method 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">
@@ -455,7 +455,7 @@
<argument index="0" name="state" type="Dictionary">
</argument>
<description>
- Restore the state saved by [method EditorPlugin.get_state].
+ Restore the state saved by [method get_state].
</description>
</method>
<method name="set_window_layout" qualifiers="virtual">
@@ -464,7 +464,7 @@
<argument index="0" name="layout" type="ConfigFile">
</argument>
<description>
- Restore the plugin GUI layout saved by [method EditorPlugin.get_window_layout].
+ Restore the plugin GUI layout saved by [method get_window_layout].
</description>
</method>
<method name="update_overlays" qualifiers="const">
@@ -546,6 +546,7 @@
<constant name="DOCK_SLOT_RIGHT_BR" value="7" enum="DockSlot">
</constant>
<constant name="DOCK_SLOT_MAX" value="8" enum="DockSlot">
+ Represents the size of the [enum DockSlot] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml
index eb94447529..72993103e8 100644
--- a/doc/classes/Environment.xml
+++ b/doc/classes/Environment.xml
@@ -273,7 +273,7 @@
Display a camera feed in the background.
</constant>
<constant name="BG_MAX" value="7" enum="BGMode">
- Helper constant keeping track of the enum's size, has no direct usage in API calls.
+ Represents the size of the [enum BGMode] enum.
</constant>
<constant name="GLOW_BLEND_MODE_ADDITIVE" value="0" enum="GlowBlendMode">
Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources.
diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml
index 464ed44ecd..f85413b8b4 100644
--- a/doc/classes/Expression.xml
+++ b/doc/classes/Expression.xml
@@ -62,7 +62,7 @@
<argument index="1" name="input_names" type="PoolStringArray" default="PoolStringArray( )">
</argument>
<description>
- Parses the expression and returns a [enum @GlobalScope.Error].
+ Parses the expression and returns an [enum Error] code.
You can optionally specify names of variables that may appear in the expression with [code]input_names[/code], so that you can bind them when it gets executed.
</description>
</method>
diff --git a/doc/classes/File.xml b/doc/classes/File.xml
index 32fa628bbf..42fee8df17 100644
--- a/doc/classes/File.xml
+++ b/doc/classes/File.xml
@@ -115,7 +115,7 @@
<return type="int" enum="Error">
</return>
<description>
- Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [enum @GlobalScope.Error].
+ Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [enum Error].
</description>
</method>
<method name="get_float" qualifiers="const">
diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml
index 908c017ac9..f8df356da2 100644
--- a/doc/classes/FileDialog.xml
+++ b/doc/classes/FileDialog.xml
@@ -74,7 +74,7 @@
Set dialog to open or save mode, changes selection behavior. See enum [code]Mode[/code] constants.
</member>
<member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title">
- If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [code]MODE_OPEN_FILE[/code] will change the window title to "Open a File").
+ If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant MODE_OPEN_FILE] will change the window title to "Open a File").
</member>
<member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files">
If [code]true[/code], the dialog will show hidden files.
diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml
index e42d3ed2c4..84cd446ea2 100644
--- a/doc/classes/GIProbe.xml
+++ b/doc/classes/GIProbe.xml
@@ -57,6 +57,7 @@
<constant name="SUBDIV_512" value="3" enum="Subdiv">
</constant>
<constant name="SUBDIV_MAX" value="4" enum="Subdiv">
+ Represents the size of the [enum Subdiv] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Generic6DOFJoint.xml b/doc/classes/Generic6DOFJoint.xml
index 53cece21fa..52888e9587 100644
--- a/doc/classes/Generic6DOFJoint.xml
+++ b/doc/classes/Generic6DOFJoint.xml
@@ -293,7 +293,7 @@
Maximum acceleration for the motor at the axes.
</constant>
<constant name="PARAM_MAX" value="22" enum="Param">
- End flag of PARAM_* constants, used internally.
+ Represents the size of the [enum Param] enum.
</constant>
<constant name="FLAG_ENABLE_LINEAR_LIMIT" value="0" enum="Flag">
If [code]set[/code] there is linear motion possible within the given limits.
@@ -311,7 +311,7 @@
<constant name="FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="Flag">
</constant>
<constant name="FLAG_MAX" value="6" enum="Flag">
- End flag of FLAG_* constants, used internally.
+ Represents the size of the [enum Flag] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml
index e2ba3fb7b0..002b224d6f 100644
--- a/doc/classes/Geometry.xml
+++ b/doc/classes/Geometry.xml
@@ -67,8 +67,8 @@
<argument index="1" name="polygon_b" type="PoolVector2Array">
</argument>
<description>
- Clips [code]polygon_a[/code] against [code]polygon_b[/code] and returns an array of clipped polygons. This performs [code]OPERATION_DIFFERENCE[/code] between polygons. Returns an empty array if [code]polygon_b[/code] completely overlaps [code]polygon_a[/code].
- If [code]polygon_b[/code] is enclosed by [code]polygon_a[/code], returns an outer polygon (boundary) and inner polygon (hole) which could be distiguished by calling [method is_polygon_clockwise].
+ Clips [code]polygon_a[/code] against [code]polygon_b[/code] and returns an array of clipped polygons. This performs [constant OPERATION_DIFFERENCE] between polygons. Returns an empty array if [code]polygon_b[/code] completely overlaps [code]polygon_a[/code].
+ If [code]polygon_b[/code] is enclosed by [code]polygon_a[/code], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="clip_polyline_with_polygon_2d">
@@ -79,7 +79,7 @@
<argument index="1" name="polygon" type="PoolVector2Array">
</argument>
<description>
- Clips [code]polyline[/code] against [code]polygon[/code] and returns an array of clipped polylines. This performs [code]OPERATION_DIFFERENCE[/code] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape.
+ Clips [code]polyline[/code] against [code]polygon[/code] and returns an array of clipped polylines. This performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape.
</description>
</method>
<method name="convex_hull_2d">
@@ -99,8 +99,8 @@
<argument index="1" name="polygon_b" type="PoolVector2Array">
</argument>
<description>
- Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons_2d]) and returns an array of excluded polygons. This performs [code]OPERATION_XOR[/code] between polygons. In other words, returns all but common area between polygons.
- The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distiguished by calling [method is_polygon_clockwise].
+ Mutually excludes common area defined by intersection of [code]polygon_a[/code] and [code]polygon_b[/code] (see [method intersect_polygons_2d]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons.
+ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="get_closest_point_to_segment">
@@ -201,8 +201,8 @@
<argument index="1" name="polygon_b" type="PoolVector2Array">
</argument>
<description>
- Intersects [code]polygon_a[/code] with [code]polygon_b[/code] and returns an array of intersected polygons. This performs [code]OPERATION_INTERSECTION[/code] between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs.
- The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distiguished by calling [method is_polygon_clockwise].
+ Intersects [code]polygon_a[/code] with [code]polygon_b[/code] and returns an array of intersected polygons. This performs [constant OPERATION_INTERSECTION] between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs.
+ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="intersect_polyline_with_polygon_2d">
@@ -213,7 +213,18 @@
<argument index="1" name="polygon" type="PoolVector2Array">
</argument>
<description>
- Intersects [code]polyline[/code] with [code]polygon[/code] and returns an array of intersected polylines. This performs [code]OPERATION_INTERSECTION[/code] between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape.
+ Intersects [code]polyline[/code] with [code]polygon[/code] and returns an array of intersected polylines. This performs [constant OPERATION_INTERSECTION] between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape.
+ </description>
+ </method>
+ <method name="is_point_in_polygon">
+ <return type="bool">
+ </return>
+ <argument index="0" name="point" type="Vector2">
+ </argument>
+ <argument index="1" name="polygon" type="PoolVector2Array">
+ </argument>
+ <description>
+ Returns [code]true[/code] if [code]point[/code] is inside [code]polygon[/code] or if it's located exactly [i]on[/i] polygon's boundary, otherwise returns [code]false[/code].
</description>
</method>
<method name="is_polygon_clockwise">
@@ -257,8 +268,8 @@
<argument index="1" name="polygon_b" type="PoolVector2Array">
</argument>
<description>
- Merges (combines) [code]polygon_a[/code] and [code]polygon_b[/code] and returns an array of merged polygons. This performs [code]OPERATION_UNION[/code] between polygons.
- The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distiguished by calling [method is_polygon_clockwise].
+ Merges (combines) [code]polygon_a[/code] and [code]polygon_b[/code] and returns an array of merged polygons. This performs [constant OPERATION_UNION] between polygons.
+ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="offset_polygon_2d">
@@ -272,8 +283,8 @@
</argument>
<description>
Inflates or deflates [code]polygon[/code] by [code]delta[/code] units (pixels). If [code]delta[/code] is positive, makes the polygon grow outward. If [code]delta[/code] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [code]delta[/code] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon.
- Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum Geometry.PolyJoinType].
- The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distiguished by calling [method is_polygon_clockwise].
+ Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType].
+ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="offset_polyline_2d">
@@ -289,9 +300,9 @@
</argument>
<description>
Inflates or deflates [code]polyline[/code] by [code]delta[/code] units (pixels), producing polygons. If [code]delta[/code] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [code]delta[/code] is negative, returns an empty array.
- Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum Geometry.PolyJoinType].
- Each polygon's endpoints will be rounded as determined by [code]end_type[/code], see [enum Geometry.PolyEndType].
- The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distiguished by calling [method is_polygon_clockwise].
+ Each polygon's vertices will be rounded as determined by [code]join_type[/code], see [enum PolyJoinType].
+ Each polygon's endpoints will be rounded as determined by [code]end_type[/code], see [enum PolyEndType].
+ The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise].
</description>
</method>
<method name="point_is_inside_triangle" qualifiers="const">
diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml
index 674f786149..22135a048e 100644
--- a/doc/classes/GeometryInstance.xml
+++ b/doc/classes/GeometryInstance.xml
@@ -15,13 +15,13 @@
<argument index="0" name="aabb" type="AABB">
</argument>
<description>
- Overrides the bounding box of this node with a custom one. To remove it, set an AABB with all fields set to zero.
+ Overrides the bounding box of this node with a custom one. To remove it, set an [AABB] with all fields set to zero.
</description>
</method>
</methods>
<members>
<member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" enum="GeometryInstance.ShadowCastingSetting">
- The selected shadow casting flag. See SHADOW_CASTING_SETTING_* constants for values.
+ The selected shadow casting flag. See [enum ShadowCastingSetting] for possible values.
</member>
<member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin">
The extra distance added to the GeometryInstance's bounding box ([AABB]) to increase its cull box.
@@ -40,7 +40,7 @@
</member>
<member name="material_override" type="Material" setter="set_material_override" getter="get_material_override">
The material override for the whole geometry.
- If there is a material in material_override, it will be used instead of any material set in any material slot of the mesh.
+ If there is a material in [code]material_override[/code], it will be used instead of any material set in any material slot of the mesh.
</member>
<member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag">
If [code]true[/code], this GeometryInstance will be used when baking lights using a [GIProbe] and/or any other form of baked lighting.
@@ -64,9 +64,12 @@
</constant>
<constant name="FLAG_USE_BAKED_LIGHT" value="0" enum="Flags">
Will allow the GeometryInstance to be used when baking lights using a [GIProbe] and/or any other form of baked lighting.
- Added documentation for GeometryInstance and VisualInstance
+ </constant>
+ <constant name="FLAG_DRAW_NEXT_FRAME_IF_VISIBLE" value="1" enum="Flags">
+ Unused in this class, exposed for consistency with [enum VisualServer.InstanceFlags].
</constant>
<constant name="FLAG_MAX" value="2" enum="Flags">
+ Represents the size of the [enum Flags] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 8ae0120a34..325e6ca48e 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -193,7 +193,7 @@
HTTP POST method. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. This is often used for forms and submitting data or uploading files.
</constant>
<constant name="METHOD_PUT" value="3" enum="Method">
- HTTP PUT method. The PUT method asks to replace all current representations of the target resource with the request payload. (You can think of [code]POST[/code] as "create or update" and [code]PUT[/code] as "update", although many services tend to not make a clear distinction or change their meaning).
+ HTTP PUT method. The PUT method asks to replace all current representations of the target resource with the request payload. (You can think of POST as "create or update" and PUT as "update", although many services tend to not make a clear distinction or change their meaning).
</constant>
<constant name="METHOD_DELETE" value="4" enum="Method">
HTTP DELETE method. The DELETE method requests to delete the specified resource.
@@ -211,7 +211,7 @@
HTTP PATCH method. The PATCH method is used to apply partial modifications to a resource.
</constant>
<constant name="METHOD_MAX" value="9" enum="Method">
- Marker for end of [code]METHOD_*[/code] enum. Not used.
+ Represents the size of the [enum Method] enum.
</constant>
<constant name="STATUS_DISCONNECTED" value="0" enum="Status">
Status: Disconnected from the server.
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index 3dccc8e741..58833bd84b 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -54,7 +54,7 @@
</argument>
<description>
Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request].
- Returns [code]OK[/code] if request is successfully created. (Does not imply that the server has responded), [code]ERR_UNCONFIGURED[/code] if not in the tree, [code]ERR_BUSY[/code] if still processing previous request, [code]ERR_INVALID_PARAMETER[/code] if given string is not a valid URL format, or [code]ERR_CANT_CONNECT[/code] if not using thread and the [HTTPClient] cannot connect to host.
+ Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host.
</description>
</method>
</methods>
diff --git a/doc/classes/HingeJoint.xml b/doc/classes/HingeJoint.xml
index 79df64f226..2fde885ee8 100644
--- a/doc/classes/HingeJoint.xml
+++ b/doc/classes/HingeJoint.xml
@@ -66,7 +66,7 @@
Maximum acceleration for the motor.
</constant>
<constant name="PARAM_MAX" value="8" enum="Param">
- End flag of PARAM_* constants, used internally.
+ Represents the size of the [enum Param] enum.
</constant>
<constant name="FLAG_USE_LIMIT" value="0" enum="Flag">
If [code]true[/code], the hinges maximum and minimum rotation, defined by [member angular_limit/lower] and [member angular_limit/upper] has effects.
@@ -75,7 +75,7 @@
When activated, a motor turns the hinge.
</constant>
<constant name="FLAG_MAX" value="2" enum="Flag">
- End flag of FLAG_* constants, used internally.
+ Represents the size of the [enum Flag] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/IP.xml b/doc/classes/IP.xml
index 65b1700333..1d64ee1085 100644
--- a/doc/classes/IP.xml
+++ b/doc/classes/IP.xml
@@ -105,10 +105,10 @@
DNS hostname resolver status: Error.
</constant>
<constant name="RESOLVER_MAX_QUERIES" value="32">
- Maximum number of concurrent DNS resolver queries allowed, [code]RESOLVER_INVALID_ID[/code] is returned if exceeded.
+ Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is returned if exceeded.
</constant>
<constant name="RESOLVER_INVALID_ID" value="-1">
- Invalid ID constant. Returned if [code]RESOLVER_MAX_QUERIES[/code] is exceeded.
+ Invalid ID constant. Returned if [constant RESOLVER_MAX_QUERIES] is exceeded.
</constant>
<constant name="TYPE_NONE" value="0" enum="Type">
Address type: None.
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index 75434b031e..f2b6ddc7e9 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -590,6 +590,7 @@
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">
+ Represents the size of the [enum Format] enum.
</constant>
<constant name="INTERPOLATE_NEAREST" value="0" enum="Interpolation">
</constant>
@@ -599,7 +600,7 @@
</constant>
<constant name="INTERPOLATE_TRILINEAR" value="3" enum="Interpolation">
Performs bilinear separately on the two most suited mipmap levels, then linearly interpolates between them.
- It's slower than [code]INTERPOLATE_BILINEAR[/code], but produces higher quality results, with much less aliasing artifacts.
+ It's slower than [constant INTERPOLATE_BILINEAR], but produces higher quality results, with much less aliasing artifacts.
If the image does not have mipmaps, they will be generated and used internally, but no mipmaps will be generated on the resulting image. (Note that if you intend to scale multiple copies of the original image, it's better to call [code]generate_mipmaps[/code] on it in advance, to avoid wasting processing power in generating them again and again.)
On the other hand, if the image already has mipmaps, they will be used, and a new set will be generated for the resulting image.
</constant>
diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml
index e5a8fee767..00a3c5c614 100644
--- a/doc/classes/ImageTexture.xml
+++ b/doc/classes/ImageTexture.xml
@@ -73,7 +73,7 @@
</methods>
<members>
<member name="lossy_quality" type="float" setter="set_lossy_storage_quality" getter="get_lossy_storage_quality">
- The storage quality for [code]STORAGE_COMPRESS_LOSSY[/code].
+ The storage quality for [constant STORAGE_COMPRESS_LOSSY].
</member>
<member name="storage" type="int" setter="set_storage" getter="get_storage" enum="ImageTexture.Storage">
The storage type (raw, lossy, or compressed).
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index 9c41e4bf1d..1c2826ee57 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -316,7 +316,7 @@
<argument index="0" name="shape" type="int" enum="Input.CursorShape" default="0">
</argument>
<description>
- Sets the default cursor shape to be used in the viewport instead of [code]CURSOR_ARROW[/code].
+ Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW].
Note that if you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead.
</description>
</method>
@@ -413,7 +413,7 @@
Wait cursor. Indicates that the application is busy performing an operation.
</constant>
<constant name="CURSOR_BUSY" value="5" enum="CursorShape">
- Busy cursor. See [code]CURSOR_WAIT[/code].
+ Busy cursor. See [constant CURSOR_WAIT].
</constant>
<constant name="CURSOR_DRAG" value="6" enum="CursorShape">
Drag cursor. Usually displayed when dragging something.
@@ -434,16 +434,16 @@
Window resize mouse cursor. The cursor is a double headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically.
</constant>
<constant name="CURSOR_FDIAGSIZE" value="12" enum="CursorShape">
- Window resize mouse cursor. The cursor is a double headed arrow that goes from the top left to the bottom right, the opposite of [code]CURSOR_BDIAGSIZE[/code]. It tells the user they can resize the window or the panel both horizontally and vertically.
+ Window resize mouse cursor. The cursor is a double headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically.
</constant>
<constant name="CURSOR_MOVE" value="13" enum="CursorShape">
Move cursor. Indicates that something can be moved.
</constant>
<constant name="CURSOR_VSPLIT" value="14" enum="CursorShape">
- Vertical split mouse cursor. On Windows, it's the same as [code]CURSOR_VSIZE[/code].
+ Vertical split mouse cursor. On Windows, it's the same as [constant CURSOR_VSIZE].
</constant>
<constant name="CURSOR_HSPLIT" value="15" enum="CursorShape">
- Horizontal split mouse cursor. On Windows, it's the same as [code]CURSOR_HSIZE[/code].
+ Horizontal split mouse cursor. On Windows, it's the same as [constant CURSOR_HSIZE].
</constant>
<constant name="CURSOR_HELP" value="16" enum="CursorShape">
Help cursor. Usually a question mark.
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 934597d0c6..335506867f 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -49,7 +49,7 @@
<argument index="0" name="action" type="String">
</argument>
<description>
- Returns [code]true[/code] if the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
+ Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
</description>
</method>
<method name="is_action_released" qualifiers="const">
@@ -58,28 +58,28 @@
<argument index="0" name="action" type="String">
</argument>
<description>
- Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
+ Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
</description>
</method>
<method name="is_action_type" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this input event's type is one of the [InputEvent] constants.
+ Returns [code]true[/code] if this input event's type is one that can be assigned to an input action.
</description>
</method>
<method name="is_echo" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this input event is an echo event (only for events of type KEY).
+ Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]).
</description>
</method>
<method name="is_pressed" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this input event is pressed. Not relevant for the event types [code]MOUSE_MOTION[/code], [code]SCREEN_DRAG[/code] or [code]NONE[/code].
+ Returns [code]true[/code] if this input event is pressed. Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
</description>
</method>
<method name="shortcut_match" qualifiers="const">
diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml
index de120446fb..9ea9ff7bef 100644
--- a/doc/classes/InputEventWithModifiers.xml
+++ b/doc/classes/InputEventWithModifiers.xml
@@ -4,7 +4,7 @@
Base class for keys events with modifiers.
</brief_description>
<description>
- Contains keys events information with modifiers support like [code]SHIFT[/code] or [code]ALT[/code]. See [method Node._input].
+ Contains keys events information with modifiers support like [code]Shift[/code] or [code]Alt[/code]. See [method Node._input].
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
@@ -13,19 +13,19 @@
</methods>
<members>
<member name="alt" type="bool" setter="set_alt" getter="get_alt">
- State of the Alt modifier.
+ State of the [code]Alt[/code] modifier.
</member>
<member name="command" type="bool" setter="set_command" getter="get_command">
- State of the Command modifier.
+ State of the [code]Command[/code] modifier.
</member>
<member name="control" type="bool" setter="set_control" getter="get_control">
- State of the Ctrl modifier.
+ State of the [code]Ctrl[/code] modifier.
</member>
<member name="meta" type="bool" setter="set_metakey" getter="get_metakey">
- State of the Meta modifier.
+ State of the [code]Meta[/code] modifier.
</member>
<member name="shift" type="bool" setter="set_shift" getter="get_shift">
- State of the Shift modifier.
+ State of the [code]Shift[/code] modifier.
</member>
</members>
<constants>
diff --git a/doc/classes/Light.xml b/doc/classes/Light.xml
index ecbc07ba72..05eb44b2f1 100644
--- a/doc/classes/Light.xml
+++ b/doc/classes/Light.xml
@@ -83,6 +83,7 @@
<constant name="PARAM_SHADOW_BIAS_SPLIT_SCALE" value="14" enum="Param">
</constant>
<constant name="PARAM_MAX" value="15" enum="Param">
+ Represents the size of the [enum Param] enum.
</constant>
<constant name="BAKE_DISABLED" value="0" enum="BakeMode">
Light is ignored when baking. Note: hiding a light does [i]not[/i] affect baking.
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index a487fdf2fe..a83b48da88 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -43,7 +43,7 @@
Minimum layer value of objects that are affected by the Light2D. Default value: [code]0[/code].
</member>
<member name="range_z_max" type="int" setter="set_z_range_max" getter="get_z_range_max">
- Maximum [code]Z[/code] value of objects that are affected by the Light2D. Default value: [code]1024[/code].
+ Maximum [code]z[/code] value of objects that are affected by the Light2D. Default value: [code]1024[/code].
</member>
<member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min">
Minimum [code]z[/code] value of objects that are affected by the Light2D. Default value: [code]-1024[/code].
@@ -58,7 +58,7 @@
If [code]true[/code], the Light2D will cast shadows. Default value: [code]false[/code].
</member>
<member name="shadow_filter" type="int" setter="set_shadow_filter" getter="get_shadow_filter" enum="Light2D.ShadowFilter">
- Shadow filter type. Use [enum Light2D.ShadowFilter] constants as values. Default value: [code]SHADOW_FILTER_NONE[/code].
+ Shadow filter type. Use [enum ShadowFilter] constants as values. Default value: [constant SHADOW_FILTER_NONE].
</member>
<member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth">
Smoothing value for shadows.
@@ -78,7 +78,7 @@
</members>
<constants>
<constant name="MODE_ADD" value="0" enum="Mode">
- Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behaviour of a light.
+ Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
</constant>
<constant name="MODE_SUB" value="1" enum="Mode">
Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index c55760767a..8a13e044f0 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -67,13 +67,13 @@
</methods>
<members>
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode">
- Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
+ Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants. Default value: [constant LINE_CAP_NONE].
</member>
<member name="default_color" type="Color" setter="set_default_color" getter="get_default_color">
The line's color. Will not be used if a gradient is set.
</member>
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode">
- Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
+ Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. Default value: [constant LINE_CAP_NONE].
</member>
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
@@ -88,13 +88,13 @@
The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
</member>
<member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit">
- The direction difference in radians between vector points. This value is only used if [code]joint mode[/code] is set to [code]LINE_JOINT_SHARP[/code].
+ The direction difference in radians between vector points. This value is only used if [code]joint mode[/code] is set to [constant LINE_JOINT_SHARP].
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
</member>
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode">
- The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. Default value: [code]LINE_TEXTURE_NONE[/code].
+ The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. Default value: [constant LINE_TEXTURE_NONE].
</member>
<member name="width" type="float" setter="set_width" getter="get_width">
The line's width.
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 333f6a3671..44043a5a16 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -108,7 +108,7 @@
If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode">
- Defines how the [LineEdit] can grab focus (Keyboard and mouse, only keyboard, or none). See [enum Control.FocusMode] in [Control] for details.
+ Defines how the [LineEdit] can grab focus (Keyboard and mouse, only keyboard, or none). See [enum Control.FocusMode] for details.
</member>
<member name="max_length" type="int" setter="set_max_length" getter="get_max_length">
Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
@@ -181,6 +181,7 @@
Reverse the last undo action.
</constant>
<constant name="MENU_MAX" value="7" enum="MenuItems">
+ Represents the size of the [enum MenuItems] enum.
</constant>
</constants>
<theme_items>
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 324ee72b8e..312b2ff692 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -1,10 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MainLoop" inherits="Object" category="Core" version="3.2">
<brief_description>
- Main loop is the abstract main loop base class.
+ Abstract base class for the game's main loop.
</brief_description>
<description>
- Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a [MainLoop] has to be provided to OS, else the application will exit. This happens automatically (and a [SceneTree] is created), unless a main [Script] is supplied, which may or not create and return a [MainLoop].
+ [MainLoop] is the abstract base class for a Godot project's game loop. It in inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree.
+ Upon application start, a [MainLoop] implementation has to be provided to the OS, or the application will exit. This happens automatically (and a [SceneTree] is created) unless a main [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code], which should then be a [MainLoop] implementation.
+ Here is an example script implementing a simple [MainLoop]:
+ [codeblock]
+ extends MainLoop
+
+ var time_elapsed = 0
+ var keys_typed = []
+ var quit = false
+
+ func _initialize():
+ print("Initialized:")
+ print(" Starting time: %s" % str(time_elapsed))
+
+ func _idle(delta):
+ time_elapsed += delta
+ # Return true to end the main loop
+ return quit
+
+ func _input_event(event):
+ # Record keys
+ if event is InputEventKey and event.pressed and !event.echo:
+ keys_typed.append(OS.get_scancode_string(event.scancode))
+ # Quit on Escape press
+ if event.scancode == KEY_ESCAPE:
+ quit = true
+ # Quit on any mouse click
+ if event is InputEventMouseButton:
+ quit = true
+
+ func _finalize():
+ print("Finalized:")
+ print(" End time: %s" % str(time_elapsed))
+ print(" Keys typed: %s" % var2str(keys_typed))
+ [/codeblock]
</description>
<tutorials>
</tutorials>
@@ -14,9 +48,10 @@
</return>
<argument index="0" name="files" type="PoolStringArray">
</argument>
- <argument index="1" name="screen" type="int">
+ <argument index="1" name="from_screen" type="int">
</argument>
<description>
+ Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.
</description>
</method>
<method name="_finalize" qualifiers="virtual">
@@ -27,12 +62,13 @@
</description>
</method>
<method name="_idle" qualifiers="virtual">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="delta" type="float">
</argument>
<description>
- Called each idle frame with time since last call as an only argument.
+ Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to [method Node._process].
+ If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
<method name="_initialize" qualifiers="virtual">
@@ -48,6 +84,7 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
+ Called whenever an [InputEvent] is received by the main loop.
</description>
</method>
<method name="_input_text" qualifiers="virtual">
@@ -56,20 +93,24 @@
<argument index="0" name="text" type="String">
</argument>
<description>
+ Deprecated callback, does not do anything. Use [method _input_event] to parse text input. Will be removed in Godot 4.0.
</description>
</method>
<method name="_iteration" qualifiers="virtual">
- <return type="void">
+ <return type="bool">
</return>
<argument index="0" name="delta" type="float">
</argument>
<description>
+ Called each physics frame with the time since the last physics frame as argument (in seconds). Equivalent to [method Node._physics_process].
+ If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
<method name="finish">
<return type="void">
</return>
<description>
+ Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="idle">
@@ -78,12 +119,14 @@
<argument index="0" name="delta" type="float">
</argument>
<description>
+ Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="init">
<return type="void">
</return>
<description>
+ Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="input_event">
@@ -92,6 +135,7 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
+ Should not be called manually, override [method _input_event] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="input_text">
@@ -100,6 +144,7 @@
<argument index="0" name="text" type="String">
</argument>
<description>
+ Should not be called manually, override [method _input_text] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="iteration">
@@ -108,33 +153,57 @@
<argument index="0" name="delta" type="float">
</argument>
<description>
+ Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0.
</description>
</method>
</methods>
<constants>
<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
+ Notification received from the OS when the mouse enters the game window.
+ Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_MOUSE_EXIT" value="1003">
+ Notification received from the OS when the mouse leaves the game window.
+ Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_IN" value="1004">
+ Notification received from the OS when the game window is focused.
+ Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_OUT" value="1005">
+ Notification received from the OS when the game window is unfocused.
+ Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_QUIT_REQUEST" value="1006">
+ Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4).
+ Implemented on desktop platforms.
</constant>
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
+ Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
+ Specific to the Android platform.
</constant>
<constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="1008">
+ Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus).
+ No supported platforms currently send this notification.
</constant>
<constant name="NOTIFICATION_OS_MEMORY_WARNING" value="1009">
+ Notification received from the OS when the application is exceeding its allocated memory.
+ Specific to the iOS platform.
</constant>
<constant name="NOTIFICATION_TRANSLATION_CHANGED" value="1010">
+ Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr].
</constant>
<constant name="NOTIFICATION_WM_ABOUT" value="1011">
+ Notification received from the OS when a request for "About" information is sent.
+ Specific to the macOS platform.
</constant>
<constant name="NOTIFICATION_CRASH" value="1012">
+ Notification received from Godot's crash handler when the engine is about to crash.
+ Implemented on desktop platforms if the crash handler is enabled.
</constant>
<constant name="NOTIFICATION_OS_IME_UPDATE" value="1013">
+ Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
+ Specific to the macOS platform.
</constant>
</constants>
</class>
diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml
index 848a43e6c4..22da012022 100644
--- a/doc/classes/Material.xml
+++ b/doc/classes/Material.xml
@@ -18,8 +18,10 @@
</members>
<constants>
<constant name="RENDER_PRIORITY_MAX" value="127">
+ Maximum value for the [member render_priority] parameter.
</constant>
<constant name="RENDER_PRIORITY_MIN" value="-128">
+ Minimum value for the [member render_priority] parameter.
</constant>
</constants>
</class>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 048e7074f1..d2911fd299 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -194,6 +194,7 @@
Array of indices.
</constant>
<constant name="ARRAY_MAX" value="9" enum="ArrayType">
+ Represents the size of the [enum ArrayType] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml
index eeb251c8c7..5cee9915ff 100644
--- a/doc/classes/MeshDataTool.xml
+++ b/doc/classes/MeshDataTool.xml
@@ -46,7 +46,7 @@
</argument>
<description>
Uses specified surface of given [Mesh] to populate data for MeshDataTool.
- Requires [Mesh] with primitive type [code]PRIMITIVE_TRIANGLES[/code].
+ Requires [Mesh] with primitive type [constant Mesh.PRIMITIVE_TRIANGLES].
</description>
</method>
<method name="get_edge_count" qualifiers="const">
@@ -139,8 +139,8 @@
<return type="int">
</return>
<description>
- Returns format of [Mesh]. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [code]ARRAY_FORMAT_VERTEX[/code] is [code]1[/code] and [code]ARRAY_FORMAT_NORMAL[/code] is [code]2[/code].
- For list of format flags see [ArrayMesh].
+ Returns format of [Mesh]. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] because [constant ArrayMesh.ARRAY_FORMAT_VERTEX] is [code]1[/code] and [constant ArrayMesh.ARRAY_FORMAT_NORMAL] is [code]2[/code].
+ For list of format flags see [enum ArrayMesh.ArrayFormat].
</description>
</method>
<method name="get_material" qualifiers="const">
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 7b5794bbfc..b67d83efec 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -152,19 +152,19 @@
Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
</constant>
<constant name="RPC_MODE_SLAVE" value="3" enum="RPCMode">
- Deprecated. Use [code]RPC_MODE_PUPPET[/code] instead. Analogous to the [code]slave[/code] keyword.
+ Deprecated. Use [constant RPC_MODE_PUPPET] instead. Analogous to the [code]slave[/code] keyword.
</constant>
<constant name="RPC_MODE_REMOTESYNC" value="4" enum="RPCMode">
- Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Analogous to the [code]remotesync[/code] keyword.
+ Behave like [constant RPC_MODE_REMOTE] but also make the call or property change locally. Analogous to the [code]remotesync[/code] keyword.
</constant>
<constant name="RPC_MODE_SYNC" value="4" enum="RPCMode">
- Deprecated. Use [code]RPC_MODE_REMOTESYNC[/code] instead. Analogous to the [code]sync[/code] keyword.
+ Deprecated. Use [constant RPC_MODE_REMOTESYNC] instead. Analogous to the [code]sync[/code] keyword.
</constant>
<constant name="RPC_MODE_MASTERSYNC" value="5" enum="RPCMode">
- Behave like [code]RPC_MODE_MASTER[/code] but also make the call or property change locally. Analogous to the [code]mastersync[/code] keyword.
+ Behave like [constant RPC_MODE_MASTER] but also make the call or property change locally. Analogous to the [code]mastersync[/code] keyword.
</constant>
<constant name="RPC_MODE_PUPPETSYNC" value="6" enum="RPCMode">
- Behave like [code]RPC_MODE_PUPPET[/code] but also make the call or property change locally. Analogous to the [code]puppetsync[/code] keyword.
+ Behave like [constant RPC_MODE_PUPPET] but also make the call or property change locally. Analogous to the [code]puppetsync[/code] keyword.
</constant>
</constants>
</class>
diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml
index 73c0a53f59..2f41e100fc 100644
--- a/doc/classes/Mutex.xml
+++ b/doc/classes/Mutex.xml
@@ -20,7 +20,7 @@
<return type="int" enum="Error">
</return>
<description>
- Try locking this [Mutex], does not block. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise.
+ Try locking this [Mutex], does not block. Returns [constant OK] on success, [constant ERR_BUSY] otherwise.
</description>
</method>
<method name="unlock">
diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml
index e5cadb6ffe..ac84c32b5e 100644
--- a/doc/classes/NetworkedMultiplayerPeer.xml
+++ b/doc/classes/NetworkedMultiplayerPeer.xml
@@ -45,7 +45,7 @@
</argument>
<description>
Sets the peer to which packets will be sent.
- The [code]id[/code] can be one of: [code]TARGET_PEER_BROADCAST[/code] to send to all connected peers, [code]TARGET_PEER_SERVER[/code] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. Default: [code]TARGET_PEER_BROADCAST[/code]
+ The [code]id[/code] can be one of: [constant TARGET_PEER_BROADCAST] to send to all connected peers, [constant TARGET_PEER_SERVER] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. Default: [constant TARGET_PEER_BROADCAST]
</description>
</method>
</methods>
@@ -90,10 +90,10 @@
</signals>
<constants>
<constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [code]TRANSFER_MODE_UNRELIABLE_ORDERED[/code]. Use for non-critical data, and always consider whether the order matters.
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters.
</constant>
<constant name="TRANSFER_MODE_UNRELIABLE_ORDERED" value="1" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [code]TRANSFER_MODE_RELIABLE[/code]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
</constant>
<constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode">
Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index e8b43ead85..6df207b2cd 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -6,8 +6,8 @@
<description>
Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
- [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the NOTIFICATION_ENTER_TREE notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's.
- Once all nodes have been added in the scene tree, they receive the NOTIFICATION_READY notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes.
+ [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's.
+ Once all nodes have been added in the scene tree, they receive the [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes.
This means that when adding a node to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (recursively for the entire scene tree).
[b]Processing:[/b] Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
Nodes can also process input events. When present, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it.
@@ -25,7 +25,7 @@
</return>
<description>
Called when the node enters the [SceneTree] (e.g. upon instancing, scene changing, or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children.
- Corresponds to the NOTIFICATION_ENTER_TREE notification in [method Object._notification].
+ Corresponds to the [constant NOTIFICATION_ENTER_TREE] notification in [method Object._notification].
</description>
</method>
<method name="_exit_tree" qualifiers="virtual">
@@ -33,7 +33,7 @@
</return>
<description>
Called when the node is about to leave the [SceneTree] (e.g. upon freeing, scene changing, or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree.
- Corresponds to the NOTIFICATION_EXIT_TREE notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]
+ Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]
</description>
</method>
<method name="_get_configuration_warning" qualifiers="virtual">
@@ -64,7 +64,7 @@
<description>
Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [code]delta[/code] variable should be constant.
It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
- Corresponds to the NOTIFICATION_PHYSICS_PROCESS notification in [method Object._notification].
+ Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
</description>
</method>
<method name="_process" qualifiers="virtual">
@@ -75,7 +75,7 @@
<description>
Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant.
It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process].
- Corresponds to the NOTIFICATION_PROCESS notification in [method Object._notification].
+ Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
</description>
</method>
<method name="_ready" qualifiers="virtual">
@@ -83,7 +83,7 @@
</return>
<description>
Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards.
- Corresponds to the NOTIFICATION_READY notification in [method Object._notification]. See also the [code]onready[/code] keyword for variables.
+ Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the [code]onready[/code] keyword for variables.
Usually used for initialization. For even earlier initialization, [method Object._init] may be used. Also see [method _enter_tree].
</description>
</method>
@@ -120,7 +120,7 @@
</argument>
<description>
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
- Setting "legible_unique_name" [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type.
+ Setting [code]legible_unique_name[/code] to [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type.
</description>
</method>
<method name="add_child_below_node">
@@ -134,7 +134,7 @@
</argument>
<description>
Adds a child node. The child is placed below the given node in the list of children.
- Setting "legible_unique_name" [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type.
+ Setting [code]legible_unique_name[/code] to [code]true[/code] creates child nodes with human-readable names, based on the name of the node being instanced instead of its type.
</description>
</method>
<method name="add_to_group">
@@ -146,7 +146,7 @@
</argument>
<description>
Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see [method is_inside_tree]). See notes in the description, and the group methods in [SceneTree].
- [code]persistent[/code] option is used when packing node to [PackedScene] and saving to file. Non-persistent groups aren't stored.
+ The [code]persistent[/code] option is used when packing node to [PackedScene] and saving to file. Non-persistent groups aren't stored.
</description>
</method>
<method name="can_process" qualifiers="const">
@@ -163,7 +163,7 @@
</argument>
<description>
Duplicates the node, returning a new node.
- You can fine-tune the behavior using the [code]flags[/code] (see [enum Node.DuplicateFlags]).
+ You can fine-tune the behavior using the [code]flags[/code] (see [enum DuplicateFlags]).
</description>
</method>
<method name="find_node" qualifiers="const">
@@ -314,7 +314,7 @@
<return type="float">
</return>
<description>
- Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed in [OS].
+ Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.target_fps].
</description>
</method>
<method name="get_position_in_parent" qualifiers="const">
@@ -475,7 +475,7 @@
<argument index="1" name="to_position" type="int">
</argument>
<description>
- Moves a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.
+ Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful.
</description>
</method>
<method name="print_stray_nodes">
@@ -525,7 +525,7 @@
<argument index="2" name="parent_first" type="bool" default="false">
</argument>
<description>
- Calls the given method (if present) with the arguments given in [code]args[/code] on this node and recursively on all its children. If the parent_first argument is [code]true[/code] then the method will be called on the current node first, then on all children. If it is [code]false[/code] then the children will be called first.
+ Calls the given method (if present) with the arguments given in [code]args[/code] on this node and recursively on all its children. If the [code]parent_first[/code] argument is [code]true[/code] then the method will be called on the current node first, then on all children. If it is [code]false[/code] then the children will be called first.
</description>
</method>
<method name="propagate_notification">
@@ -534,7 +534,7 @@
<argument index="0" name="what" type="int">
</argument>
<description>
- Notifies the current node and all its children recursively by calling notification() on all of them.
+ Notifies the current node and all its children recursively by calling [method Object.notification] on all of them.
</description>
</method>
<method name="queue_free">
@@ -730,7 +730,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a NOTIFICATION_PHYSICS_PROCESS at a fixed (usually 60 fps, see [OS] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored.
+ Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.target_fps] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored.
</description>
</method>
<method name="set_physics_process_internal">
@@ -739,7 +739,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
+ Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behavior.
</description>
</method>
<method name="set_process">
@@ -748,7 +748,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disables processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every drawn frame (and the [method _process] callback will be called if exists). Enabled automatically if [method _process] is overridden. Any calls to this before [method _ready] will be ignored.
+ Enables or disables processing. When a node is being processed, it will receive a [constant NOTIFICATION_PROCESS] on every drawn frame (and the [method _process] callback will be called if exists). Enabled automatically if [method _process] is overridden. Any calls to this before [method _ready] will be ignored.
</description>
</method>
<method name="set_process_input">
@@ -766,7 +766,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
+ Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behavior.
</description>
</method>
<method name="set_process_priority">
@@ -775,6 +775,7 @@
<argument index="0" name="priority" type="int">
</argument>
<description>
+ Sets the node's priority in the execution order of the enabled processing callbacks (i.e. [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS] and their internal counterparts). Nodes with a higher process priority will have their processing callbacks executed first.
</description>
</method>
<method name="set_process_unhandled_input">
@@ -878,7 +879,7 @@
Notification received every frame when the process flag is set (see [method set_process]).
</constant>
<constant name="NOTIFICATION_PARENTED" value="18">
- Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the Scene Tree.
+ Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the [SceneTree].
</constant>
<constant name="NOTIFICATION_UNPARENTED" value="19">
Notification received when a node is unparented (parent removed it from the list of children).
@@ -902,32 +903,54 @@
Notification received every frame when the internal physics process flag is set (see [method set_physics_process_internal]).
</constant>
<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
+ Notification received from the OS when the mouse enters the game window.
+ Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_MOUSE_EXIT" value="1003">
+ Notification received from the OS when the mouse leaves the game window.
+ Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_IN" value="1004">
+ Notification received from the OS when the game window is focused.
+ Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_OUT" value="1005">
+ Notification received from the OS when the game window is unfocused.
+ Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_QUIT_REQUEST" value="1006">
+ Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4).
+ Implemented on desktop platforms.
</constant>
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
+ Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
+ Specific to the Android platform.
</constant>
<constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="1008">
+ Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus).
+ No supported platforms currently send this notification.
</constant>
<constant name="NOTIFICATION_OS_MEMORY_WARNING" value="1009">
+ Notification received from the OS when the application is exceeding its allocated memory.
+ Specific to the iOS platform.
</constant>
<constant name="NOTIFICATION_TRANSLATION_CHANGED" value="1010">
Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr].
</constant>
<constant name="NOTIFICATION_WM_ABOUT" value="1011">
+ Notification received from the OS when a request for "About" information is sent.
+ Specific to the macOS platform.
</constant>
<constant name="NOTIFICATION_CRASH" value="1012">
+ Notification received from Godot's crash handler when the engine is about to crash.
+ Implemented on desktop platforms if the crash handler is enabled.
</constant>
<constant name="NOTIFICATION_OS_IME_UPDATE" value="1013">
+ Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
+ Specific to the macOS platform.
</constant>
<constant name="PAUSE_MODE_INHERIT" value="0" enum="PauseMode">
- Inherits pause mode from the node's parent. For the root node, it is equivalent to PAUSE_MODE_STOP. Default.
+ Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default.
</constant>
<constant name="PAUSE_MODE_STOP" value="1" enum="PauseMode">
Stop processing when the [SceneTree] is paused.
diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml
index 2879a83efb..67f12813cc 100644
--- a/doc/classes/NodePath.xml
+++ b/doc/classes/NodePath.xml
@@ -47,6 +47,7 @@
# This will be parsed as a node path to the 'x' component of the 'position' property in the current node
var property_path = node_path.get_as_property_path()
print(property_path) # :position:x
+ [/codeblock]
</description>
</method>
<method name="get_concatenated_subnames">
@@ -80,7 +81,7 @@
</return>
<description>
Get the number of node names which make up the path. Subnames (see [method get_subname_count]) are not included.
- For example, [code]"Path2D/PathFollow2D/Sprite"[code] has 3 names.
+ For example, [code]"Path2D/PathFollow2D/Sprite"[/code] has 3 names.
</description>
</method>
<method name="get_subname">
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 3292438851..f6e2f47a42 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -102,7 +102,7 @@
<description>
Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable.
The arguments are used in the given order and separated by a space, so [code]OS.execute('ping', ['-w', '3', 'godotengine.org'], false)[/code] will resolve to [code]ping -w 3 godotengine.org[/code] in the system's shell.
- This method has slightly different behaviour based on whether the [code]blocking[/code] mode is enabled.
+ This method has slightly different behavior based on whether the [code]blocking[/code] mode is enabled.
When [code]blocking[/code] is enabled, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the [code]output[/code] array as a single string. When the process terminates, the Godot thread will resume execution.
When [code]blocking[/code] is disabled, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty.
The return value also depends on the blocking mode. When blocking, the method will return -2 (no process ID information is available in blocking mode). When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return -1.
@@ -163,7 +163,7 @@
<return type="int" enum="OS.VideoDriver">
</return>
<description>
- Returns the currently used video driver, using one of the values from [enum OS.VideoDriver].
+ Returns the currently used video driver, using one of the values from [enum VideoDriver].
</description>
</method>
<method name="get_date" qualifiers="const">
@@ -222,7 +222,7 @@
</return>
<description>
Returns IME cursor position (currently edited portion of the string) relative to the characters in the composition string.
- [code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME cursor position.
+ [constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME cursor position.
</description>
</method>
<method name="get_ime_text" qualifiers="const">
@@ -230,7 +230,7 @@
</return>
<description>
Returns IME intermediate composition string.
- [code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME composition string.
+ [constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME composition string.
</description>
</method>
<method name="get_latin_keyboard_variant" qualifiers="const">
@@ -280,7 +280,7 @@
<return type="int" enum="OS.PowerState">
</return>
<description>
- Returns the current state of the device regarding battery and power. See [code]POWERSTATE_*[/code] constants.
+ Returns the current state of the device regarding battery and power. See [enum PowerState] constants.
</description>
</method>
<method name="get_process_id" qualifiers="const">
@@ -380,7 +380,7 @@
<argument index="0" name="dir" type="int" enum="OS.SystemDir">
</argument>
<description>
- Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum OS.SystemDir].
+ Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir].
</description>
</method>
<method name="get_system_time_msecs" qualifiers="const">
@@ -477,7 +477,7 @@
<argument index="0" name="driver" type="int" enum="OS.VideoDriver">
</argument>
<description>
- Returns the name of the video driver matching the given [code]driver[/code] index. This index is a value from [enum OS.VideoDriver], and you can use [method get_current_video_driver] to get the current backend's index.
+ Returns the name of the video driver matching the given [code]driver[/code] index. This index is a value from [enum VideoDriver], and you can use [method get_current_video_driver] to get the current backend's index.
</description>
</method>
<method name="get_virtual_keyboard_height">
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index a1fba1ac8d..7b262d80c7 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -9,7 +9,7 @@
Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++.
Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory.
Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them.
- Objects also receive notifications. Notifications are a simple way to notify the object about simple events, so they can all be handled together. See [method _notification].
+ Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification].
</description>
<tutorials>
</tutorials>
@@ -20,6 +20,7 @@
<argument index="0" name="property" type="String">
</argument>
<description>
+ Virtual method which can be overridden to customize the return value of [method get].
Returns the given property. Returns [code]null[/code] if the [code]property[/code] does not exist.
</description>
</method>
@@ -27,14 +28,16 @@
<return type="Array">
</return>
<description>
- Returns the object's property list as an [Array] of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]).
+ Virtual method which can be overridden to customize the return value of [method get_property_list].
+ Returns the object's property list as an [Array] of dictionaries.
+ Each property's [Dictionary] must contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum PropertyUsageFlags]).
</description>
</method>
<method name="_init" qualifiers="virtual">
<return type="void">
</return>
<description>
- The virtual method called upon initialization.
+ Called when the object is initialized.
</description>
</method>
<method name="_notification" qualifiers="virtual">
@@ -43,7 +46,7 @@
<argument index="0" name="what" type="int">
</argument>
<description>
- Notify the object internally using an ID.
+ Called whenever the object receives a notification, which is identified in [code]what[/code] by a constant. The base [Object] has two constants [constant NOTIFICATION_POSTINITIALIZE] and [constant NOTIFICATION_PREDELETE], but subclasses such as [Node] define a lot more notifications which are also received by this method.
</description>
</method>
<method name="_set" qualifiers="virtual">
@@ -54,6 +57,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
+ Virtual method which can be overridden to customize the return value of [method set].
Sets a property. Returns [code]true[/code] if the [code]property[/code] exists.
</description>
</method>
@@ -61,8 +65,8 @@
<return type="String">
</return>
<description>
+ Virtual method which can be overridden to customize the return value of [method to_string], and thus the object's representation where it is converted to a string, e.g. with [code]print(obj)[/code].
Returns a [String] representing the object. Default is [code]"[ClassName:RID]"[/code].
- Override this method to customize the [String] representation of the object when it's being converted to a string, for example: [code]print(obj)[/code].
</description>
</method>
<method name="add_user_signal">
@@ -73,7 +77,7 @@
<argument index="1" name="arguments" type="Array" default="[ ]">
</argument>
<description>
- Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing "name" and "type" (from [@GlobalScope] TYPE_*).
+ Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries.
</description>
</method>
<method name="call" qualifiers="vararg">
@@ -82,7 +86,10 @@
<argument index="0" name="method" type="String">
</argument>
<description>
- Calls the [code]method[/code] on the object and returns a result. Pass parameters as a comma separated list.
+ Calls the [code]method[/code] on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
+ [codeblock]
+ call("set", "position", Vector2(42.0, 0.0))
+ [/codeblock]
</description>
</method>
<method name="call_deferred" qualifiers="vararg">
@@ -91,7 +98,10 @@
<argument index="0" name="method" type="String">
</argument>
<description>
- Calls the [code]method[/code] on the object during idle time and returns a result. Pass parameters as a comma separated list.
+ Calls the [code]method[/code] on the object during idle time and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
+ [codeblock]
+ call_deferred("set", "position", Vector2(42.0, 0.0))
+ [/codeblock]
</description>
</method>
<method name="callv">
@@ -102,14 +112,17 @@
<argument index="1" name="arg_array" type="Array">
</argument>
<description>
- Calls the [code]method[/code] on the object and returns a result. Pass parameters as an [Array].
+ Calls the [code]method[/code] on the object and returns the result. Contrarily to [method call], this method does not support a variable number of arguments but expected all parameters passed via a single [Array].
+ [codeblock]
+ callv("set", [ "position", Vector2(42.0, 0.0) ])
+ [/codeblock]
</description>
</method>
<method name="can_translate_messages" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the object can translate strings.
+ Returns [code]true[/code] if the object can translate strings. See [method set_message_translation] and [method tr].
</description>
</method>
<method name="connect">
@@ -126,9 +139,15 @@
<argument index="4" name="flags" type="int" default="0">
</argument>
<description>
- Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call. Use [code]flags[/code] to set deferred or one shot connections. See [code]CONNECT_*[/code] constants.
- A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected. To avoid this, first, use [method is_connected] to check for existing connections.
+ Connects a [code]signal[/code] to a [code]method[/code] on a [code]target[/code] object. Pass optional [code]binds[/code] to the call as an [Array] of parameters. Use [code]flags[/code] to set deferred or one shot connections. See [enum ConnectFlags] constants.
+ A [code]signal[/code] can only be connected once to a [code]method[/code]. It will throw an error if already connected, unless the signal was connected with [constant CONNECT_REFERENCE_COUNTED]. To avoid this, first, use [method is_connected] to check for existing connections.
If the [code]target[/code] is destroyed in the game's lifecycle, the connection will be lost.
+ Examples:
+ [codeblock]
+ connect("pressed", self, "_on_Button_pressed") # BaseButton signal
+ connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal
+ connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal
+ [/codeblock]
</description>
</method>
<method name="disconnect">
@@ -151,14 +170,18 @@
<argument index="0" name="signal" type="String">
</argument>
<description>
- Emits the given [code]signal[/code].
+ Emits the given [code]signal[/code]. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example:
+ [codeblock]
+ emit_signal("hit", weapon_type, damage)
+ emit_signal("game_over")
+ [/codeblock]
</description>
</method>
<method name="free">
<return type="void">
</return>
<description>
- Deletes the object from memory.
+ Deletes the object from memory. Any pre-existing reference to the freed object will now return [code]null[/code].
</description>
</method>
<method name="get" qualifiers="const">
@@ -167,7 +190,7 @@
<argument index="0" name="property" type="String">
</argument>
<description>
- Returns a [Variant] for a [code]property[/code].
+ Returns the [Variant] value of the given [code]property[/code].
</description>
</method>
<method name="get_class" qualifiers="const">
@@ -182,10 +205,10 @@
</return>
<description>
Returns an [Array] of dictionaries with information about signals that are connected to the object.
- Inside each [Dictionary] there are 3 fields:
- - "source" is a reference to signal emitter.
- - "signal_name" is name of connected signal.
- - "method_name" is a name of method to which signal is connected.
+ Each [Dictionary] contains three String entries:
+ - [code]source[/code] is a reference to the signal emitter.
+ - [code]signal_name[/code] is the name of the connected signal.
+ - [code]method_name[/code] is the name of the method to which the signal is connected.
</description>
</method>
<method name="get_indexed" qualifiers="const">
@@ -194,8 +217,7 @@
<argument index="0" name="property" type="NodePath">
</argument>
<description>
- Get indexed object property by String.
- Property indices get accessed with colon separation, for example: [code]position:x[/code]
+ Get the object's property indexed by the given [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Examples: [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code].
</description>
</method>
<method name="get_instance_id" qualifiers="const">
@@ -212,7 +234,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
- Returns the object's metadata for the given [code]name[/code].
+ Returns the object's metadata entry for the given [code]name[/code].
</description>
</method>
<method name="get_meta_list" qualifiers="const">
@@ -233,14 +255,15 @@
<return type="Array">
</return>
<description>
- Returns the list of properties as an [Array] of dictionaries. Dictionaries contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]).
+ Returns the object's property list as an [Array] of dictionaries.
+ Each property's [Dictionary] contain at least [code]name: String[/code] and [code]type: int[/code] (see [enum Variant.Type]) entries. Optionally, it can also include [code]hint: int[/code] (see [enum PropertyHint]), [code]hint_string: String[/code], and [code]usage: int[/code] (see [enum PropertyUsageFlags]).
</description>
</method>
<method name="get_script" qualifiers="const">
<return type="Reference">
</return>
<description>
- Returns the object's [Script] or [code]null[/code] if one doesn't exist.
+ Returns the object's [Script] instance, or [code]null[/code] if none is assigned.
</description>
</method>
<method name="get_signal_connection_list" qualifiers="const">
@@ -265,7 +288,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
- Returns [code]true[/code] if a metadata is found with the given [code]name[/code].
+ Returns [code]true[/code] if a metadata entry is found with the given [code]name[/code].
</description>
</method>
<method name="has_method" qualifiers="const">
@@ -296,10 +319,10 @@
<method name="is_class" qualifiers="const">
<return type="bool">
</return>
- <argument index="0" name="type" type="String">
+ <argument index="0" name="class" type="String">
</argument>
<description>
- Returns [code]true[/code] if the object inherits from the given [code]type[/code].
+ Returns [code]true[/code] if the object inherits from the given [code]class[/code].
</description>
</method>
<method name="is_connected" qualifiers="const">
@@ -319,7 +342,7 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the [code]queue_free[/code] method was called for the object.
+ Returns [code]true[/code] if the [method Node.queue_free] method was called for the object.
</description>
</method>
<method name="notification">
@@ -330,13 +353,15 @@
<argument index="1" name="reversed" type="bool" default="false">
</argument>
<description>
- Notify the object of something.
+ Send a given notification to the object, which will also trigger a call to the [method _notification] method of all classes that the object inherits from.
+ If [code]reversed[/code] is [code]true[/code], [method _notification] is called first on the object's own class, and then up to its successive parent classes. If [code]reversed[/code] is [code]false[/code], [method _notification] is called first on the highest ancestor ([Object] itself), and then down to its successive inheriting classes.
</description>
</method>
<method name="property_list_changed_notify">
<return type="void">
</return>
<description>
+ Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds.
</description>
</method>
<method name="remove_meta">
@@ -345,6 +370,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
+ Removes a given entry from the object's metadata.
</description>
</method>
<method name="set">
@@ -355,7 +381,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
- Set property into the object.
+ Assigns a new value to the given property. If the [code]property[/code] does not exist, nothing will happen.
</description>
</method>
<method name="set_block_signals">
@@ -375,7 +401,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
- Set property into the object, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", [property, value])[/code].
+ Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [method set] via [method call_deferred], i.e. [code]call_deferred("set", property, value)[/code].
</description>
</method>
<method name="set_indexed">
@@ -386,6 +412,12 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
+ Assigns a new value to the property identified by the [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Example:
+ [codeblock]
+ set_indexed("position", Vector2(42, 0))
+ set_indexed("position:y", -10)
+ print(position) # (42, -10)
+ [/codeblock]
</description>
</method>
<method name="set_message_translation">
@@ -394,7 +426,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Define whether the object can translate strings (with calls to [method tr]). Default is [code]true[/code].
+ Defines whether the object can translate strings (with calls to [method tr]). Default is [code]true[/code].
</description>
</method>
<method name="set_meta">
@@ -405,7 +437,7 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
- Set a metadata into the object. Metadata is serialized. Metadata can be [i]anything[/i].
+ Adds or changes a given entry in the object's metadata. Metadata are serialized, and can take any [Variant] value.
</description>
</method>
<method name="set_script">
@@ -414,7 +446,7 @@
<argument index="0" name="script" type="Reference">
</argument>
<description>
- Set a script into the object, scripts extend the object functionality.
+ Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality.
</description>
</method>
<method name="to_string">
@@ -431,14 +463,15 @@
<argument index="0" name="message" type="String">
</argument>
<description>
- Translate a message. Only works if message translation is enabled (which it is by default). See [method set_message_translation].
+ Translates a message using translation catalogs configured in the Project Settings.
+ Only works if message translation is enabled (which it is by default), otherwise it returns the [code]message[/code] unchanged. See [method set_message_translation].
</description>
</method>
</methods>
<signals>
<signal name="script_changed">
<description>
- Emitted whenever the script of the Object is changed.
+ Emitted whenever the object's script is changed.
</description>
</signal>
</signals>
@@ -459,6 +492,7 @@
One shot connections disconnect themselves after emission.
</constant>
<constant name="CONNECT_REFERENCE_COUNTED" value="8" enum="ConnectFlags">
+ Connect a signal as reference counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left.
</constant>
</constants>
</class>
diff --git a/doc/classes/OccluderPolygon2D.xml b/doc/classes/OccluderPolygon2D.xml
index f1d7d55cb9..a52d51fa7d 100644
--- a/doc/classes/OccluderPolygon2D.xml
+++ b/doc/classes/OccluderPolygon2D.xml
@@ -12,10 +12,10 @@
</methods>
<members>
<member name="closed" type="bool" setter="set_closed" getter="is_closed">
- If [code]true[/code], closes the polygon. A closed OccluderPolygon2D occludes the light coming from any direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. Default value [code]true[/code].
+ If [code]true[/code], closes the polygon. A closed OccluderPolygon2D occludes the light coming from any direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. Default value: [code]true[/code].
</member>
<member name="cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" enum="OccluderPolygon2D.CullMode">
- Set the direction of the occlusion culling when not [code]CULL_DISABLED[/code]. Default value [code]DISABLED[/code].
+ Set the direction of the occlusion culling or disable it. Default value: [constant CULL_DISABLED].
</member>
<member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon">
A [Vector2] array with the index for polygon's vertices positions. Note that the returned value is a copy of the underlying array, rather than a reference.
diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml
index 777e5221ed..7827571178 100644
--- a/doc/classes/PackedScene.xml
+++ b/doc/classes/PackedScene.xml
@@ -50,7 +50,7 @@
<argument index="0" name="edit_state" type="int" enum="PackedScene.GenEditState" default="0">
</argument>
<description>
- Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers [Node]'s [code]NOTIFICATION_INSTANCED[/code] notification on the root node.
+ Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a [constant Node.NOTIFICATION_INSTANCED] notification on the root node.
</description>
</method>
<method name="pack">
diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml
index a29b621406..d7e939ba31 100644
--- a/doc/classes/Particles.xml
+++ b/doc/classes/Particles.xml
@@ -31,7 +31,7 @@
Number of particles to emit.
</member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles.DrawOrder">
- Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [code]DRAW_ORDER_INDEX[/code].
+ Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [constant DRAW_ORDER_INDEX].
</member>
<member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh">
[Mesh] that is drawn for the first draw pass.
diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml
index 78114e985d..a874e8f6a0 100644
--- a/doc/classes/Particles2D.xml
+++ b/doc/classes/Particles2D.xml
@@ -31,7 +31,7 @@
Number of particles emitted in one emission cycle.
</member>
<member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" enum="Particles2D.DrawOrder">
- Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [code]DRAW_ORDER_INDEX[/code].
+ Particle draw order. Uses [code]DRAW_ORDER_*[/code] values. Default value: [constant DRAW_ORDER_INDEX].
</member>
<member name="emitting" type="bool" setter="set_emitting" getter="is_emitting">
If [code]true[/code], particles are being emitted. Default value: [code]true[/code].
diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml
index cb06593bc2..00862e5672 100644
--- a/doc/classes/ParticlesMaterial.xml
+++ b/doc/classes/ParticlesMaterial.xml
@@ -67,25 +67,25 @@
Damping randomness ratio. Default value: [code]0[/code].
</member>
<member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents">
- The box's extents if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_BOX[/code].
+ The box's extents if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_BOX].
</member>
<member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture">
Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture].
</member>
<member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture">
- Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [code]EMISSION_SHAPE_DIRECTED[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
+ Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
</member>
<member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count">
- The number of emission points if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_POINTS[/code] or [code]EMISSION_SHAPE_DIRECTED_POINTS[/code].
+ The number of emission points if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS].
</member>
<member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture">
- Particles will be emitted at positions determined by sampling this texture at a random position. Used with [code]EMISSION_SHAPE_POINTS[/code] and [code]EMISSION_SHAPE_DIRECTED_POINTS[/code]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
+ Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
</member>
<member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" enum="ParticlesMaterial.EmissionShape">
- Particles will be emitted inside this region. Use [code]EMISSION_SHAPE_*[/code] constants for values. Default value: [code]EMISSION_SHAPE_POINT[/code].
+ Particles will be emitted inside this region. Use [code]EMISSION_SHAPE_*[/code] constants for values. Default value: [constant EMISSION_SHAPE_POINT].
</member>
<member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius">
- The sphere's radius if [code]emission_shape[/code] is set to [code]EMISSION_SHAPE_SPHERE[/code].
+ The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].
</member>
<member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag">
Align y-axis of particle with the direction of its velocity.
diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml
index 1b553dbc02..12ae8fd3d5 100644
--- a/doc/classes/Path.xml
+++ b/doc/classes/Path.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Path" inherits="Spatial" category="Core" version="3.2">
<brief_description>
- Container for a [Curve3D].
+ Contains a [Curve3D] path for [PathFollow] nodes to follow.
</brief_description>
<description>
- This class is a container/Node-ification of a [Curve3D], so it can have [Spatial] properties and [Node] info.
+ Can have [PathFollow] child nodes moving along the [Curve3D]. See [PathFollow] for more information on the usage.
+ Note that the path is considered as relative to the moved nodes (children of [PathFollow]). As such, the curve should usually start with a zero vector [code](0, 0, 0)[/code].
</description>
<tutorials>
</tutorials>
@@ -12,11 +13,13 @@
</methods>
<members>
<member name="curve" type="Curve3D" setter="set_curve" getter="get_curve">
+ A [Curve3D] describing the path.
</member>
</members>
<signals>
<signal name="curve_changed">
<description>
+ Emitted when the [member curve] changes.
</description>
</signal>
</signals>
diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml
index ce15b3eab2..a50df96bda 100644
--- a/doc/classes/Path2D.xml
+++ b/doc/classes/Path2D.xml
@@ -4,8 +4,8 @@
Contains a [Curve2D] path for [PathFollow2D] nodes to follow.
</brief_description>
<description>
- Can have [PathFollow2D] child-nodes moving along the [Curve2D]. See [PathFollow2D] for more information on this usage.
- Note that the path is considered as relative to the moved nodes (children of [PathFollow2D]) - usually the curve should start with a zero vector (0, 0).
+ Can have [PathFollow2D] child nodes moving along the [Curve2D]. See [PathFollow2D] for more information on the usage.
+ Note that the path is considered as relative to the moved nodes (children of [PathFollow2D]). As such, the curve should usually start with a zero vector [code](0, 0)[/code].
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/PathFollow.xml b/doc/classes/PathFollow.xml
index ba27ca04eb..f0b238eb1d 100644
--- a/doc/classes/PathFollow.xml
+++ b/doc/classes/PathFollow.xml
@@ -27,7 +27,7 @@
The distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path.
</member>
<member name="rotation_mode" type="int" setter="set_rotation_mode" getter="get_rotation_mode" enum="PathFollow.RotationMode">
- Allows or forbids rotation on one or more axes, depending on the constants being used.
+ Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used.
</member>
<member name="unit_offset" type="float" setter="set_unit_offset" getter="get_unit_offset">
The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length.
diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml
index 3860511615..3bcc001a2b 100644
--- a/doc/classes/Performance.xml
+++ b/doc/classes/Performance.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Performance" inherits="Object" category="Core" version="3.2">
<brief_description>
- Exposes performance related data.
+ Exposes performance-related data.
</brief_description>
<description>
This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the [i]Monitor[/i] tab in the editor's [i]Debugger[/i] panel. By using the [method get_monitor] method of this class, you can access this data from your code. Note that a few of these monitors are only available in debug mode and will always return 0 when used in a release build.
@@ -16,7 +16,7 @@
<argument index="0" name="monitor" type="int" enum="Performance.Monitor">
</argument>
<description>
- Returns the value of one of the available monitors. You should provide one of this class's constants as the argument, like this:
+ Returns the value of one of the available monitors. You should provide one of the [enum Monitor] constants as the argument, like this:
[codeblock]
print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console
[/codeblock]
@@ -25,13 +25,13 @@
</methods>
<constants>
<constant name="TIME_FPS" value="0" enum="Monitor">
- Frames per second.
+ Number of frames per second.
</constant>
<constant name="TIME_PROCESS" value="1" enum="Monitor">
- Time it took to complete one frame.
+ Time it took to complete one frame, in seconds.
</constant>
<constant name="TIME_PHYSICS_PROCESS" value="2" enum="Monitor">
- Time it took to complete one physics frame.
+ Time it took to complete one physics frame, in seconds.
</constant>
<constant name="MEMORY_STATIC" value="3" enum="Monitor">
Static memory currently used, in bytes. Not available in release builds.
@@ -58,6 +58,7 @@
Number of nodes currently instanced in the scene tree. This also includes the root node.
</constant>
<constant name="OBJECT_ORPHAN_NODE_COUNT" value="11" enum="Monitor">
+ Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
</constant>
<constant name="RENDER_OBJECTS_IN_FRAME" value="12" enum="Monitor">
3D objects drawn per frame.
@@ -78,15 +79,16 @@
Draw calls per frame. 3D only.
</constant>
<constant name="RENDER_VIDEO_MEM_USED" value="18" enum="Monitor">
- Video memory used. Includes both texture and vertex memory.
+ The amount of video memory used, i.e. texture and vertex memory combined.
</constant>
<constant name="RENDER_TEXTURE_MEM_USED" value="19" enum="Monitor">
- Texture memory used.
+ The amount of texture memory used.
</constant>
<constant name="RENDER_VERTEX_MEM_USED" value="20" enum="Monitor">
- Vertex memory used.
+ The amount of vertex memory used.
</constant>
<constant name="RENDER_USAGE_VIDEO_MEM_TOTAL" value="21" enum="Monitor">
+ Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
</constant>
<constant name="PHYSICS_2D_ACTIVE_OBJECTS" value="22" enum="Monitor">
Number of active [RigidBody2D] nodes in the game.
@@ -107,8 +109,10 @@
Number of islands in the 3D physics engine.
</constant>
<constant name="AUDIO_OUTPUT_LATENCY" value="28" enum="Monitor">
+ Output latency of the [AudioServer].
</constant>
<constant name="MONITOR_MAX" value="29" enum="Monitor">
+ Represents the size of the [enum Monitor] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml
index 172420e4ca..de4a8c233e 100644
--- a/doc/classes/Physics2DServer.xml
+++ b/doc/classes/Physics2DServer.xml
@@ -86,7 +86,7 @@
<argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter">
</argument>
<description>
- Returns an area parameter value. A list of available parameters is on the AREA_PARAM_* constants.
+ Returns an area parameter value. See [enum AreaParameter] for a list of available parameters.
</description>
</method>
<method name="area_get_shape" qualifiers="const">
@@ -230,7 +230,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Sets the value for an area parameter. A list of available parameters is on the AREA_PARAM_* constants.
+ Sets the value for an area parameter. See [enum AreaParameter] for a list of available parameters.
</description>
</method>
<method name="area_set_shape">
@@ -291,7 +291,7 @@
<argument index="1" name="mode" type="int" enum="Physics2DServer.AreaSpaceOverrideMode">
</argument>
<description>
- Sets the space override mode for the area. The modes are described in the constants AREA_SPACE_OVERRIDE_*.
+ Sets the space override mode for the area. See [enum AreaSpaceOverrideMode] for a list of available modes.
</description>
</method>
<method name="area_set_transform">
@@ -431,7 +431,7 @@
<return type="RID">
</return>
<description>
- Creates a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
+ Creates a physics body.
</description>
</method>
<method name="body_get_canvas_instance_id" qualifiers="const">
@@ -513,7 +513,7 @@
<argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter">
</argument>
<description>
- Returns the value of a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
+ Returns the value of a body parameter. See [enum BodyParameter] for a list of available parameters.
</description>
</method>
<method name="body_get_shape" qualifiers="const">
@@ -650,7 +650,7 @@
<argument index="1" name="mode" type="int" enum="Physics2DServer.CCDMode">
</argument>
<description>
- Sets the continuous collision detection mode from any of the CCD_MODE_* constants.
+ Sets the continuous collision detection mode using one of the [enum CCDMode] constants.
Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
</description>
</method>
@@ -688,7 +688,7 @@
<argument index="1" name="mode" type="int" enum="Physics2DServer.BodyMode">
</argument>
<description>
- Sets the body mode, from one of the constants BODY_MODE*.
+ Sets the body mode using one of the [enum BodyMode] constants.
</description>
</method>
<method name="body_set_omit_force_integration">
@@ -712,7 +712,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a body parameter. A list of available parameters is on the BODY_PARAM_* constants.
+ Sets a body parameter. See [enum BodyParameter] for a list of available parameters.
</description>
</method>
<method name="body_set_shape">
@@ -803,7 +803,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Sets a body state (see BODY_STATE* constants).
+ Sets a body state using one of the [enum BodyState] constants.
</description>
</method>
<method name="body_test_motion">
@@ -885,7 +885,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a damped spring joint parameter. Parameters are explained in the DAMPED_STRING* constants.
+ Sets a damped spring joint parameter. See [enum DampedStringParam] for a list of available parameters.
</description>
</method>
<method name="free_rid">
@@ -903,7 +903,7 @@
<argument index="0" name="process_info" type="int" enum="Physics2DServer.ProcessInfo">
</argument>
<description>
- Returns information about the current state of the 2D physics engine. The states are listed under the INFO_* constants.
+ Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for a list of available states.
</description>
</method>
<method name="groove_joint_create">
@@ -920,7 +920,7 @@
<argument index="4" name="body_b" type="RID">
</argument>
<description>
- Creates a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
+ Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself.
</description>
</method>
<method name="joint_get_param" qualifiers="const">
@@ -940,7 +940,7 @@
<argument index="0" name="joint" type="RID">
</argument>
<description>
- Returns the type of a joint (see JOINT_* constants).
+ Returns the type of a joint (see [enum JointType]).
</description>
</method>
<method name="joint_set_param">
@@ -953,7 +953,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets a joint parameter. Parameters are explained in the JOINT_PARAM* constants.
+ Sets a joint parameter. See [enum JointParam] for a list of available parameters.
</description>
</method>
<method name="line_shape_create">
@@ -1017,7 +1017,7 @@
<argument index="0" name="shape" type="RID">
</argument>
<description>
- Returns the type of shape (see SHAPE_* constants).
+ Returns the type of shape (see [enum ShapeType]).
</description>
</method>
<method name="shape_set_data">
@@ -1088,7 +1088,7 @@
<argument index="2" name="value" type="float">
</argument>
<description>
- Sets the value for a space parameter. A list of available parameters is on the SPACE_PARAM_* constants.
+ Sets the value for a space parameter. See [enum SpaceParameter] for a list of available parameters.
</description>
</method>
</methods>
@@ -1215,7 +1215,7 @@
Constant to set/get a body's angular dampening factor.
</constant>
<constant name="BODY_PARAM_MAX" value="7" enum="BodyParameter">
- This is the last ID for body parameters. Any attempt to set this property is ignored. Any attempt to get it returns 0.
+ Represents the size of the [enum BodyParameter] enum.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
Constant to set/get the current transform matrix of the body.
diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml
index 78a6ed8ac0..77536e2b5b 100644
--- a/doc/classes/PhysicsServer.xml
+++ b/doc/classes/PhysicsServer.xml
@@ -910,7 +910,7 @@
<argument index="0" name="process_info" type="int" enum="PhysicsServer.ProcessInfo">
</argument>
<description>
- Returns an Info defined by the [enum PhysicsServer.ProcessInfo] input given.
+ Returns an Info defined by the [enum ProcessInfo] input given.
</description>
</method>
<method name="hinge_joint_get_flag" qualifiers="const">
@@ -1384,13 +1384,13 @@
The amount of damping of the rotation across axes orthogonal to the slider.
</constant>
<constant name="SLIDER_JOINT_MAX" value="22" enum="SliderJointParam">
- End flag of SLIDER_JOINT_* constants, used internally.
+ Represents the size of the [enum SliderJointParam] enum.
</constant>
<constant name="CONE_TWIST_JOINT_SWING_SPAN" value="0" enum="ConeTwistJointParam">
Swing is rotation from side to side, around the axis perpendicular to the twist axis.
The swing span defines, how much rotation will not get corrected allong the swing axis.
Could be defined as looseness in the [ConeTwistJoint].
- If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code].
+ If below 0.05, this behavior is locked. Default value: [code]PI/4[/code].
</constant>
<constant name="CONE_TWIST_JOINT_TWIST_SPAN" value="1" enum="ConeTwistJointParam">
Twist is the rotation around the twist axis, this value defined how far the joint can twist.
@@ -1566,7 +1566,7 @@
Constant to set/get a body's angular dampening factor.
</constant>
<constant name="BODY_PARAM_MAX" value="6" enum="BodyParameter">
- This is the last ID for body parameters. Any attempt to set this property is ignored. Any attempt to get it returns 0.
+ Represents the size of the [enum BodyParameter] enum.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0" enum="BodyState">
Constant to set/get the current transform matrix of the body.
diff --git a/doc/classes/ProceduralSky.xml b/doc/classes/ProceduralSky.xml
index 97ad1efa93..68deb5aff4 100644
--- a/doc/classes/ProceduralSky.xml
+++ b/doc/classes/ProceduralSky.xml
@@ -46,7 +46,7 @@
Color of the sun.
</member>
<member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve">
- How quickly the sun fades away between [member sun_angle_min] and [member sun_angle_max]
+ How quickly the sun fades away between [member sun_angle_min] and [member sun_angle_max].
</member>
<member name="sun_energy" type="float" setter="set_sun_energy" getter="get_sun_energy">
Amount of energy contribution from the sun.
@@ -58,7 +58,7 @@
The direction of the sun using polar coordinates.
</member>
<member name="texture_size" type="int" setter="set_texture_size" getter="get_texture_size" enum="ProceduralSky.TextureSize">
- Size of [Texture] that the ProceduralSky will generate.
+ Size of [Texture] that the ProceduralSky will generate. The size is set using [enum TextureSize].
</member>
</members>
<constants>
@@ -73,6 +73,7 @@
<constant name="TEXTURE_SIZE_4096" value="4" enum="TextureSize">
</constant>
<constant name="TEXTURE_SIZE_MAX" value="5" enum="TextureSize">
+ Represents the size of the [enum TextureSize] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml
index bc24483367..9e6c403873 100644
--- a/doc/classes/Reference.xml
+++ b/doc/classes/Reference.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Reference" inherits="Object" category="Core" version="3.2">
<brief_description>
- Base class for anything that keeps a reference count.
+ Base class for reference-counted objects.
</brief_description>
<description>
- Base class for anything that keeps a reference count. Resource and many other helper objects inherit this. References keep an internal reference counter so they are only released when no longer in use.
+ Base class for any object that keeps a reference count. [Resource] and many other helper objects inherit this class.
+ References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with [method Object.free].
+ In the vast majority of use cases, instantiating and using [Reference]-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused.
</description>
<tutorials>
</tutorials>
@@ -13,20 +15,24 @@
<return type="bool">
</return>
<description>
+ Initializes the internal reference counter. Use this only if you really know what you are doing.
+ Returns whether the initialization was successful.
</description>
</method>
<method name="reference">
<return type="bool">
</return>
<description>
- Increase the internal reference counter. Use this only if you really know what you are doing.
+ Increments the internal reference counter. Use this only if you really know what you are doing.
+ Returns whether the increment was successful.
</description>
</method>
<method name="unreference">
<return type="bool">
</return>
<description>
- Decrease the internal reference counter. Use this only if you really know what you are doing.
+ Decrements the internal reference counter. Use this only if you really know what you are doing.
+ Returns whether the decrement was successful.
</description>
</method>
</methods>
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index acd608de6a..d2315275b1 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -72,6 +72,7 @@
<signals>
<signal name="changed">
<description>
+ Emitted whenever the resource changes.
</description>
</signal>
</signals>
diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml
index f62191413a..ef44a826b9 100644
--- a/doc/classes/ResourceFormatLoader.xml
+++ b/doc/classes/ResourceFormatLoader.xml
@@ -55,7 +55,7 @@
<argument index="1" name="original_path" type="String">
</argument>
<description>
- Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [code]original_path[/code] will target the source file. Returns a [Resource] object on success, or an [enum @GlobalScope.Error] constant in case of failure.
+ Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [code]original_path[/code] will target the source file. Returns a [Resource] object on success, or an [enum Error] constant in case of failure.
</description>
</method>
<method name="rename_dependencies" qualifiers="virtual">
@@ -67,7 +67,7 @@
</argument>
<description>
If implemented, renames dependencies within the given resource and saves it. [code]renames[/code] is a dictionary [code]{ String =&gt; String }[/code] mapping old dependency paths to new paths.
- Returns [constant @GlobalScope.OK] on success, or an [enum @GlobalScope.Error] constant in case of failure.
+ Returns [constant OK] on success, or an [enum Error] constant in case of failure.
</description>
</method>
</methods>
diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml
index c40f614aa2..5ad5ab49b1 100644
--- a/doc/classes/ResourceFormatSaver.xml
+++ b/doc/classes/ResourceFormatSaver.xml
@@ -39,7 +39,7 @@
</argument>
<description>
Saves the given resource object to a file at the target [code]path[/code]. [code]flags[/code] is a bitmask composed with [enum ResourceSaver.SaverFlags] constants.
- Returns [constant @GlobalScope.OK] on success, or an [enum @GlobalScope.Error] constant in case of failure.
+ Returns [constant OK] on success, or an [enum Error] constant in case of failure.
</description>
</method>
</methods>
diff --git a/doc/classes/ResourceImporter.xml b/doc/classes/ResourceImporter.xml
new file mode 100644
index 0000000000..e0c0aa9a47
--- /dev/null
+++ b/doc/classes/ResourceImporter.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ResourceImporter" inherits="Reference" category="Core" version="3.2">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/ResourceInteractiveLoader.xml b/doc/classes/ResourceInteractiveLoader.xml
index 9d5a52deb2..3c09959ff7 100644
--- a/doc/classes/ResourceInteractiveLoader.xml
+++ b/doc/classes/ResourceInteractiveLoader.xml
@@ -35,9 +35,9 @@
</return>
<description>
Polls the loading operation, i.e. loads a data chunk up to the next stage.
- Returns [constant @GlobalScope.OK] if the poll is successful but the load operation has not finished yet (intermediate stage). This means [method poll] will have to be called again until the last stage is completed.
- Returns [constant @GlobalScope.ERR_FILE_EOF] if the load operation has completed successfully. The loaded resource can be obtained by calling [method get_resource].
- Returns another [enum @GlobalScope.Error] code if the poll has failed.
+ Returns [constant OK] if the poll is successful but the load operation has not finished yet (intermediate stage). This means [method poll] will have to be called again until the last stage is completed.
+ Returns [constant ERR_FILE_EOF] if the load operation has completed successfully. The loaded resource can be obtained by calling [method get_resource].
+ Returns another [enum Error] code if the poll has failed.
</description>
</method>
<method name="wait">
@@ -45,8 +45,8 @@
</return>
<description>
Polls the loading operation successively until the resource is completely loaded or a [method poll] fails.
- Returns [constant @GlobalScope.ERR_FILE_EOF] if the load operation has completed successfully. The loaded resource can be obtained by calling [method get_resource].
- Returns another [enum @GlobalScope.Error] code if a poll has failed, aborting the operation.
+ Returns [constant ERR_FILE_EOF] if the load operation has completed successfully. The loaded resource can be obtained by calling [method get_resource].
+ Returns another [enum Error] code if a poll has failed, aborting the operation.
</description>
</method>
</methods>
diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml
index 778ba4293f..57d5bfae2f 100644
--- a/doc/classes/ResourceSaver.xml
+++ b/doc/classes/ResourceSaver.xml
@@ -31,7 +31,7 @@
<description>
Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object.
The [code]flags[/code] bitmask can be specified to customize the save behavior.
- Returns [constant @GlobalScope.OK] on success.
+ Returns [constant OK] on success.
</description>
</method>
</methods>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index c8dd7821a3..a097e2076f 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -35,7 +35,7 @@
<argument index="0" name="bbcode" type="String">
</argument>
<description>
- Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [code]OK[/code] if successful.
+ Parses [code]bbcode[/code] and adds tags to the tag stack as needed. Returns the result of the parsing, [constant OK] if successful.
</description>
</method>
<method name="clear">
@@ -93,7 +93,7 @@
<argument index="0" name="bbcode" type="String">
</argument>
<description>
- The assignment version of [method append_bbcode]. Clears the tag stack and inserts the new content. Returns [code]OK[/code] if parses [code]bbcode[/code] successfully.
+ The assignment version of [method append_bbcode]. Clears the tag stack and inserts the new content. Returns [constant OK] if parses [code]bbcode[/code] successfully.
</description>
</method>
<method name="pop">
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml
index 9a1802b515..3fdc367cc5 100644
--- a/doc/classes/RigidBody2D.xml
+++ b/doc/classes/RigidBody2D.xml
@@ -138,8 +138,8 @@
The maximum number of contacts to report. Default value: [code]0[/code].
</member>
<member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" enum="RigidBody2D.CCDMode">
- Continuous collision detection mode. Default value: [code]CCD_MODE_DISABLED[/code].
- Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [code]CCD_MODE_[/code] constants for details.
+ Continuous collision detection mode. Default value: [constant CCD_MODE_DISABLED].
+ Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details.
</member>
<member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator">
If [code]true[/code], internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the [method _integrate_forces] function.
@@ -163,7 +163,7 @@
The body's mass. Default value: [code]1[/code].
</member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="RigidBody2D.Mode">
- The body's mode. See [code]MODE_*[/code] constants. Default value: [code]MODE_RIGID[/code].
+ The body's mode. See [code]MODE_*[/code] constants. Default value: [constant MODE_RIGID].
</member>
<member name="physics_material_override" type="PhysicsMaterial" setter="set_physics_material_override" getter="get_physics_material_override">
</member>
@@ -229,7 +229,7 @@
Static mode. The body behaves like a [StaticBody2D] and does not move.
</constant>
<constant name="MODE_CHARACTER" value="2" enum="Mode">
- Character mode. Similar to [code]MODE_RIGID[/code], but the body can not rotate.
+ Character mode. Similar to [constant MODE_RIGID], but the body can not rotate.
</constant>
<constant name="MODE_KINEMATIC" value="3" enum="Mode">
Kinematic mode. The body behaves like a [KinematicBody2D], and must be moved by code.
diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml
index 34a28b5d1c..8cbc582bf5 100644
--- a/doc/classes/SceneState.xml
+++ b/doc/classes/SceneState.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Maintains a list of resources, nodes, exported, and overridden properties, and built-in scripts associated with a scene.
+ This class cannot be instantiated directly, it is retrieved for a given scene as the result of [method PackedScene.get_state].
</description>
<tutorials>
</tutorials>
@@ -23,6 +24,7 @@
</return>
<description>
Returns the number of signal connections in the scene.
+ The [code]idx[/code] argument used to query connection metadata in other [code]get_connection_*[/code] methods in the interval [code][0, get_connection_count() - 1][/code].
</description>
</method>
<method name="get_connection_flags" qualifiers="const">
@@ -31,7 +33,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the flags for the signal at [code]idx[/code]. See [Object]'s [code]CONNECT_*[/code] flags.
+ Returns the connection flags for the signal at [code]idx[/code]. See [enum Object.ConnectFlags] constants.
</description>
</method>
<method name="get_connection_method" qualifiers="const">
@@ -75,6 +77,7 @@
</return>
<description>
Returns the number of nodes in the scene.
+ The [code]idx[/code] argument used to query node data in other [code]get_node_*[/code] methods in the interval [code][0, get_node_count() - 1][/code].
</description>
</method>
<method name="get_node_groups" qualifiers="const">
@@ -92,6 +95,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods.
</description>
</method>
<method name="get_node_instance" qualifiers="const">
@@ -100,7 +104,7 @@
<argument index="0" name="idx" type="int">
</argument>
<description>
- Returns the scene for the node at [code]idx[/code] or [code]null[/code] if the node is not an instance.
+ Returns a [PackedScene] for the node at [code]idx[/code] (i.e. the whole branch starting at this node, with its child nodes and resources), or [code]null[/code] if the node is not an instance.
</description>
</method>
<method name="get_node_instance_placeholder" qualifiers="const">
@@ -139,6 +143,7 @@
</argument>
<description>
Returns the path to the node at [code]idx[/code].
+ If [code]for_parent[/code] is [code]true[/code], returns the path of the [code]idx[/code] node's parent instead.
</description>
</method>
<method name="get_node_property_count" qualifiers="const">
@@ -148,6 +153,7 @@
</argument>
<description>
Returns the number of exported or overridden properties for the node at [code]idx[/code].
+ The [code]prop_idx[/code] argument used to query node property data in other [code]get_node_property_*[/code] methods in the interval [code][0, get_node_property_count() - 1][/code].
</description>
</method>
<method name="get_node_property_name" qualifiers="const">
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index a236d776c7..25c129d1d4 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="SceneTree" inherits="MainLoop" category="Core" version="3.2">
<brief_description>
- SceneTree manages a hierarchy of nodes.
+ Manages the game loop via a hierarchy of nodes.
</brief_description>
<description>
- As one of the most important classes, the [SceneTree] manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. You can also use the SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. a "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once.
+ As one of the most important classes, the [SceneTree] manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
+ You can also use the [SceneTree] to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. a "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once.
+ [SceneTree] is the default [MainLoop] implementation used by scenes, and is thus in charge of the game loop.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link>
@@ -41,7 +43,8 @@
<argument index="0" name="path" type="String">
</argument>
<description>
- Changes to the scene at the given [code]path[/code].
+ Changes the running scene to the one at the given [code]path[/code], after loading it into a [PackedScene] and creating a new instance.
+ Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [code]path[/code] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated.
</description>
</method>
<method name="change_scene_to">
@@ -50,7 +53,8 @@
<argument index="0" name="packed_scene" type="PackedScene">
</argument>
<description>
- Changes to the given [PackedScene].
+ Changes the running scene to a new instance of the given [PackedScene].
+ Returns [constant OK] on success or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
</description>
</method>
<method name="create_timer">
@@ -61,7 +65,7 @@
<argument index="1" name="pause_mode_process" type="bool" default="true">
</argument>
<description>
- Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this SceneTree. If [code]pause_mode_process[/code] is set to [code]false[/code], pausing the SceneTree will also pause the timer.
+ Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]pause_mode_process[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer.
Commonly used to create a one-shot delay timer as in the following example:
[codeblock]
func some_function():
@@ -75,28 +79,28 @@
<return type="int">
</return>
<description>
- Returns the current frame, i.e. number of frames since the application started.
+ Returns the current frame number, i.e. the total frame count since the application started.
</description>
</method>
<method name="get_network_connected_peers" qualifiers="const">
<return type="PoolIntArray">
</return>
<description>
- Returns the peer IDs of all connected peers of this SceneTree's [member network_peer].
+ Returns the peer IDs of all connected peers of this [SceneTree]'s [member network_peer].
</description>
</method>
<method name="get_network_unique_id" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the unique peer ID of this SceneTree's [member network_peer].
+ Returns the unique peer ID of this [SceneTree]'s [member network_peer].
</description>
</method>
<method name="get_node_count" qualifiers="const">
<return type="int">
</return>
<description>
- Returns the number of nodes in this SceneTree.
+ Returns the number of nodes in this [SceneTree].
</description>
</method>
<method name="get_nodes_in_group">
@@ -105,7 +109,7 @@
<argument index="0" name="group" type="String">
</argument>
<description>
- Returns all nodes assigned to the given group.
+ Returns a list of all nodes assigned to the given group.
</description>
</method>
<method name="get_rpc_sender_id" qualifiers="const">
@@ -135,14 +139,14 @@
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if the most recent InputEvent was marked as handled with [method set_input_as_handled].
+ Returns [code]true[/code] if the most recent [InputEvent] was marked as handled with [method set_input_as_handled].
</description>
</method>
<method name="is_network_server" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns [code]true[/code] if this SceneTree's [member network_peer] is in server mode (listening for connections).
+ Returns [code]true[/code] if this [SceneTree]'s [member network_peer] is in server mode (listening for connections).
</description>
</method>
<method name="notify_group">
@@ -190,6 +194,7 @@
</return>
<description>
Reloads the currently active scene.
+ Returns an [enum Error] code as described in [method change_scene], with the addition of [constant ERR_UNCONFIGURED] if no [member current_scene] was defined yet.
</description>
</method>
<method name="set_auto_accept_quit">
@@ -198,7 +203,7 @@
<argument index="0" name="enabled" type="bool">
</argument>
<description>
- If [code]true[/code], the application automatically accepts quitting.
+ If [code]true[/code], the application automatically accepts quitting. Defaults to [code]true[/code].
</description>
</method>
<method name="set_group">
@@ -233,7 +238,7 @@
<return type="void">
</return>
<description>
- Marks the most recent input event as handled.
+ Marks the most recent [InputEvent] as handled.
</description>
</method>
<method name="set_quit_on_go_back">
@@ -242,7 +247,7 @@
<argument index="0" name="enabled" type="bool">
</argument>
<description>
- If [code]true[/code], the application quits automatically on going back (e.g. on Android).
+ If [code]true[/code], the application quits automatically on going back (e.g. on Android). Defaults to [code]true[/code].
</description>
</method>
<method name="set_screen_stretch">
@@ -257,7 +262,7 @@
<argument index="3" name="shrink" type="float" default="1">
</argument>
<description>
- Configures screen stretching to the given [enum StretchMode], [enum StretchAspect], minimum size and [code]shrink[/code].
+ Configures screen stretching to the given [enum StretchMode], [enum StretchAspect], minimum size and [code]shrink[/code] ratio.
</description>
</method>
</methods>
@@ -266,34 +271,34 @@
The current scene.
</member>
<member name="debug_collisions_hint" type="bool" setter="set_debug_collisions_hint" getter="is_debugging_collisions_hint">
+ If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes.
</member>
<member name="debug_navigation_hint" type="bool" setter="set_debug_navigation_hint" getter="is_debugging_navigation_hint">
+ If [code]true[/code], navigation polygons will be visible when running the game from the editor for debugging purposes.
</member>
<member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root">
The root of the edited scene.
</member>
<member name="multiplayer" type="MultiplayerAPI" setter="set_multiplayer" getter="get_multiplayer">
- The default [MultiplayerAPI] instance for this SceneTree.
+ The default [MultiplayerAPI] instance for this [SceneTree].
</member>
<member name="multiplayer_poll" type="bool" setter="set_multiplayer_poll_enabled" getter="is_multiplayer_poll_enabled">
- If [code]true[/code], (default) enable the automatic polling of the [MultiplayerAPI] for this SceneTree during [signal idle_frame].
+ If [code]true[/code] (default value), enable the automatic polling of the [MultiplayerAPI] for this [SceneTree] during [signal idle_frame].
When [code]false[/code] you need to manually call [method MultiplayerAPI.poll] for processing network packets and delivering RPCs/RSETs. This allows to run RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
</member>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the [SceneTree] will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to [SceneTree]'s signals.
</member>
<member name="paused" type="bool" setter="set_pause" getter="is_paused">
- If [code]true[/code], the SceneTree is paused.
- Doing so will have the following behavior:
- * 2D and 3D physics will be stopped.
- * _process and _physics_process will not be called anymore in nodes.
- * _input and _input_event will not be called anymore either.
+ If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior:
+ - 2D and 3D physics will be stopped.
+ - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes.
</member>
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections">
- If [code]true[/code], the SceneTree's [member network_peer] refuses new incoming connections.
+ If [code]true[/code], the [SceneTree]'s [member network_peer] refuses new incoming connections.
</member>
<member name="root" type="Viewport" setter="" getter="get_root">
- The SceneTree's [Viewport].
+ The [SceneTree]'s root [Viewport].
</member>
<member name="use_font_oversampling" type="bool" setter="set_use_font_oversampling" getter="is_using_font_oversampling">
If [code]true[/code], font oversampling is used.
@@ -302,12 +307,12 @@
<signals>
<signal name="connected_to_server">
<description>
- Emitted whenever this SceneTree's [member network_peer] successfully connected to a server. Only emitted on clients.
+ Emitted whenever this [SceneTree]'s [member network_peer] successfully connected to a server. Only emitted on clients.
</description>
</signal>
<signal name="connection_failed">
<description>
- Emitted whenever this SceneTree's [member network_peer] fails to establish a connection to a server. Only emitted on clients.
+ Emitted whenever this [SceneTree]'s [member network_peer] fails to establish a connection to a server. Only emitted on clients.
</description>
</signal>
<signal name="files_dropped">
@@ -316,33 +321,33 @@
<argument index="1" name="screen" type="int">
</argument>
<description>
- Emitted whenever files are drag-and-dropped onto the window.
+ Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.
</description>
</signal>
<signal name="idle_frame">
<description>
- Emitted immediately before [method Node._process] is called on every node in the SceneTree.
+ Emitted immediately before [method Node._process] is called on every node in the [SceneTree].
</description>
</signal>
<signal name="network_peer_connected">
<argument index="0" name="id" type="int">
</argument>
<description>
- Emitted whenever this SceneTree's [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
+ Emitted whenever this [SceneTree]'s [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
</description>
</signal>
<signal name="network_peer_disconnected">
<argument index="0" name="id" type="int">
</argument>
<description>
- Emitted whenever this SceneTree's [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server.
+ Emitted whenever this [SceneTree]'s [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server.
</description>
</signal>
<signal name="node_added">
<argument index="0" name="node" type="Node">
</argument>
<description>
- Emitted whenever a node is added to the SceneTree.
+ Emitted whenever a node is added to the [SceneTree].
</description>
</signal>
<signal name="node_configuration_warning_changed">
@@ -356,18 +361,19 @@
<argument index="0" name="node" type="Node">
</argument>
<description>
- Emitted whenever a node is removed from the SceneTree.
+ Emitted whenever a node is removed from the [SceneTree].
</description>
</signal>
<signal name="node_renamed">
<argument index="0" name="node" type="Node">
</argument>
<description>
+ Emitted whenever a node is renamed.
</description>
</signal>
<signal name="physics_frame">
<description>
- Emitted immediately before [method Node._physics_process] is called on every node in the SceneTree.
+ Emitted immediately before [method Node._physics_process] is called on every node in the [SceneTree].
</description>
</signal>
<signal name="screen_resized">
@@ -377,12 +383,12 @@
</signal>
<signal name="server_disconnected">
<description>
- Emitted whenever this SceneTree's [member network_peer] disconnected from server. Only emitted on clients.
+ Emitted whenever this [SceneTree]'s [member network_peer] disconnected from server. Only emitted on clients.
</description>
</signal>
<signal name="tree_changed">
<description>
- Emitted whenever the SceneTree hierarchy changed (children being moved or renamed, etc.).
+ Emitted whenever the [SceneTree] hierarchy changed (children being moved or renamed, etc.).
</description>
</signal>
</signals>
diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml
index dadb445d4b..412913807d 100644
--- a/doc/classes/Semaphore.xml
+++ b/doc/classes/Semaphore.xml
@@ -13,14 +13,14 @@
<return type="int" enum="Error">
</return>
<description>
- Lowers the [Semaphore], allowing one more thread in. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise.
+ Lowers the [Semaphore], allowing one more thread in. Returns [constant OK] on success, [constant ERR_BUSY] otherwise.
</description>
</method>
<method name="wait">
<return type="int" enum="Error">
</return>
<description>
- Tries to wait for the [Semaphore], if its value is zero, blocks until non-zero. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise.
+ Tries to wait for the [Semaphore], if its value is zero, blocks until non-zero. Returns [constant OK] on success, [constant ERR_BUSY] otherwise.
</description>
</method>
</methods>
diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml
index 668fb6bafa..b14351ee28 100644
--- a/doc/classes/Shader.xml
+++ b/doc/classes/Shader.xml
@@ -22,7 +22,7 @@
<return type="int" enum="Shader.Mode">
</return>
<description>
- Returns the shader mode for the shader, either [code]MODE_CANVAS_ITEM[/code], [code]MODE_SPATIAL[/code] or [code]MODE_PARTICLES[/code]
+ Returns the shader mode for the shader, either [constant MODE_CANVAS_ITEM], [constant MODE_SPATIAL] or [constant MODE_PARTICLES]
</description>
</method>
<method name="has_param" qualifiers="const">
diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml
index ffd8c3fdee..a5e065203e 100644
--- a/doc/classes/Sky.xml
+++ b/doc/classes/Sky.xml
@@ -12,9 +12,9 @@
</methods>
<members>
<member name="radiance_size" type="int" setter="set_radiance_size" getter="get_radiance_size" enum="Sky.RadianceSize">
- The Sky's radiance map size.
- The higher the radiance map size, the more detailed the lighting from the Sky will be.
- See RADIANCE_SIZE_* constants for values. Default size is RADIANCE_SIZE_512.
+ The [Sky]'s radiance map size.
+ The higher the radiance map size, the more detailed the lighting from the [Sky] will be.
+ See [enum RadianceSize] constants for values. Default size is [constant RADIANCE_SIZE_512].
</member>
</members>
<constants>
@@ -40,7 +40,7 @@
Radiance texture size is 2048x2048 pixels.
</constant>
<constant name="RADIANCE_SIZE_MAX" value="7" enum="RadianceSize">
- Radiance texture size is the largest size it can be.
+ Represents the size of the [enum RadianceSize] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/SliderJoint.xml b/doc/classes/SliderJoint.xml
index 997930eaa3..75406df39f 100644
--- a/doc/classes/SliderJoint.xml
+++ b/doc/classes/SliderJoint.xml
@@ -149,7 +149,7 @@
The amount of damping of the rotation across axes orthogonal to the slider.
</constant>
<constant name="PARAM_MAX" value="22" enum="Param">
- End flag of PARAM_* constants, used internally.
+ Represents the size of the [enum Param] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml
index 9d1761ba9f..f4c0134471 100644
--- a/doc/classes/Spatial.xml
+++ b/doc/classes/Spatial.xml
@@ -329,7 +329,7 @@
<constants>
<constant name="NOTIFICATION_TRANSFORM_CHANGED" value="2000">
Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform.
- In order for [code]NOTIFICATION_TRANSFORM_CHANGED[/code] to work, users first need to ask for it, with [method set_notify_transform].
+ In order for [constant NOTIFICATION_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_transform].
</constant>
<constant name="NOTIFICATION_ENTER_WORLD" value="41">
Spatial nodes receives this notification when they are registered to new [World] resource.
diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml
index f0df5fac4a..45d92aa0c3 100644
--- a/doc/classes/SpatialMaterial.xml
+++ b/doc/classes/SpatialMaterial.xml
@@ -295,6 +295,7 @@
<constant name="TEXTURE_DETAIL_NORMAL" value="15" enum="TextureParam">
</constant>
<constant name="TEXTURE_MAX" value="16" enum="TextureParam">
+ Represents the size of the [enum TextureParam] enum.
</constant>
<constant name="DETAIL_UV_1" value="0" enum="DetailUV">
</constant>
@@ -325,6 +326,7 @@
<constant name="FEATURE_DETAIL" value="11" enum="Feature">
</constant>
<constant name="FEATURE_MAX" value="12" enum="Feature">
+ Represents the size of the [enum Feature] enum.
</constant>
<constant name="BLEND_MODE_MIX" value="0" enum="BlendMode">
Default blend mode.
@@ -395,6 +397,7 @@
<constant name="FLAG_USE_SHADOW_TO_OPACITY" value="18" enum="Flags">
</constant>
<constant name="FLAG_MAX" value="19" enum="Flags">
+ Represents the size of the [enum Flags] enum.
</constant>
<constant name="DIFFUSE_BURLEY" value="0" enum="DiffuseMode">
Default diffuse scattering algorithm.
diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml
index 50e00fe333..237a8c9d12 100644
--- a/doc/classes/SpriteBase3D.xml
+++ b/doc/classes/SpriteBase3D.xml
@@ -70,7 +70,7 @@
If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind.
</constant>
<constant name="FLAG_MAX" value="3" enum="DrawFlags">
- Used internally to mark the end of the Flags section.
+ Represents the size of the [enum DrawFlags] enum.
</constant>
<constant name="ALPHA_CUT_DISABLED" value="0" enum="AlphaCutMode">
</constant>
diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml
index 0edea42521..49c6272606 100644
--- a/doc/classes/StreamPeerTCP.xml
+++ b/doc/classes/StreamPeerTCP.xml
@@ -17,7 +17,7 @@
<argument index="1" name="port" type="int">
</argument>
<description>
- Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [code]OK[/code] on success or [code]FAILED[/code] on failure.
+ Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [constant OK] on success or [constant FAILED] on failure.
</description>
</method>
<method name="disconnect_from_host">
@@ -45,7 +45,7 @@
<return type="int" enum="StreamPeerTCP.Status">
</return>
<description>
- Returns the status of the connection, see [enum StreamPeerTCP.Status].
+ Returns the status of the connection, see [enum Status].
</description>
</method>
<method name="is_connected_to_host" qualifiers="const">
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index e97f9995ee..ef8db3ca77 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -90,7 +90,7 @@
</argument>
<description>
Insert a triangle fan made of array data into [Mesh] being constructed.
- Requires primitive type be set to [code]PRIMITIVE_TRIANGLES[/code].
+ Requires primitive type be set to [constant Mesh.PRIMITIVE_TRIANGLES].
</description>
</method>
<method name="add_uv">
@@ -148,7 +148,7 @@
<argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType">
</argument>
<description>
- Called before adding any Vertices. Takes the primitive type as an argument (e.g. Mesh.PRIMITIVE_TRIANGLES).
+ Called before adding any Vertices. Takes the primitive type as an argument (e.g. [constant Mesh.PRIMITIVE_TRIANGLES]).
</description>
</method>
<method name="clear">
@@ -212,8 +212,8 @@
</argument>
<description>
Generates normals from Vertices so you do not have to do it manually.
- Setting "flip" [code]true[/code] inverts resulting normals.
- Requires primitive type to be set to [code]PRIMITIVE_TRIANGLES[/code].
+ Setting [code]flip[/code] to [code]true[/code] inverts the resulting normals.
+ Requires primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES].
</description>
</method>
<method name="generate_tangents">
diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml
index 8c7d657b4a..b1105f231d 100644
--- a/doc/classes/Tabs.xml
+++ b/doc/classes/Tabs.xml
@@ -234,6 +234,7 @@
Align the tabs to the right.
</constant>
<constant name="ALIGN_MAX" value="3" enum="TabAlign">
+ Represents the size of the [enum TabAlign] enum.
</constant>
<constant name="CLOSE_BUTTON_SHOW_NEVER" value="0" enum="CloseButtonDisplayPolicy">
</constant>
@@ -242,6 +243,7 @@
<constant name="CLOSE_BUTTON_SHOW_ALWAYS" value="2" enum="CloseButtonDisplayPolicy">
</constant>
<constant name="CLOSE_BUTTON_MAX" value="3" enum="CloseButtonDisplayPolicy">
+ Represents the size of the [enum CloseButtonDisplayPolicy] enum.
</constant>
</constants>
<theme_items>
diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml
index ae306c6862..3bbc05dfe7 100644
--- a/doc/classes/TextureProgress.xml
+++ b/doc/classes/TextureProgress.xml
@@ -18,14 +18,14 @@
If [code]true[/code], Godot treats the bar's textures like [NinePatchRect]. Use [code]stretch_margin_*[/code], like [member stretch_margin_bottom], to set up the nine patch's 3x3 grid. Default value: [code]false[/code].
</member>
<member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset">
- Offsets [member texture_progress] if [member fill_mode] is [code]FILL_CLOCKWISE[/code] or [code]FILL_COUNTER_CLOCKWISE[/code].
+ Offsets [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE].
</member>
<member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees">
- Upper limit for the fill of [member texture_progress] if [member fill_mode] is [code]FILL_CLOCKWISE[/code] or [code]FILL_COUNTER_CLOCKWISE[/code]. When the node's [code]value[/code] is equal to its [code]max_value[/code], the texture fills up to this angle.
+ Upper limit for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]max_value[/code], the texture fills up to this angle.
See [member Range.value], [member Range.max_value].
</member>
<member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle">
- Starting angle for the fill of [member texture_progress] if [member fill_mode] is [code]FILL_CLOCKWISE[/code] or [code]FILL_COUNTER_CLOCKWISE[/code]. When the node's [code]value[/code] is equal to its [code]min_value[/code], the texture doesn't show up at all. When the [code]value[/code] increases, the texture fills and tends towards [member radial_fill_degrees].
+ Starting angle for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]min_value[/code], the texture doesn't show up at all. When the [code]value[/code] increases, the texture fills and tends towards [member radial_fill_degrees].
</member>
<member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin">
The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index 829105d561..b0b786a722 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -29,7 +29,7 @@
</members>
<constants>
<constant name="STRETCH_SCALE_ON_EXPAND" value="0" enum="StretchMode">
- Scale to fit the node's bounding rectangle, only if [code]expand[/code] is [code]true[/code]. Default [code]stretch_mode[/code], for backwards compatibility. Until you set [code]expand[/code] to [code]true[/code], the texture will behave like [code]STRETCH_KEEP[/code].
+ Scale to fit the node's bounding rectangle, only if [code]expand[/code] is [code]true[/code]. Default [code]stretch_mode[/code], for backwards compatibility. Until you set [code]expand[/code] to [code]true[/code], the texture will behave like [constant STRETCH_KEEP].
</constant>
<constant name="STRETCH_SCALE" value="1" enum="StretchMode">
Scale to fit the node's bounding rectangle.
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index f29a7990ed..d5e2fd31f8 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -64,7 +64,7 @@
</argument>
<description>
Returns the bitmask of the subtile from an autotile given its coordinates.
- The value is the sum of the values in [enum TileSet.AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
+ The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
</description>
</method>
<method name="autotile_get_bitmask_mode" qualifiers="const">
@@ -73,7 +73,7 @@
<argument index="0" name="id" type="int">
</argument>
<description>
- Returns the [enum TileSet.BitmaskMode] of the autotile.
+ Returns the [enum BitmaskMode] of the autotile.
</description>
</method>
<method name="autotile_get_icon_coordinate" qualifiers="const">
@@ -160,7 +160,7 @@
</argument>
<description>
Sets the bitmask of the subtile from an autotile given its coordinates.
- The value is the sum of the values in [enum TileSet.AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
+ The value is the sum of the values in [enum AutotileBindings] present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right).
</description>
</method>
<method name="autotile_set_bitmask_mode">
@@ -171,7 +171,7 @@
<argument index="1" name="mode" type="int" enum="TileSet.BitmaskMode">
</argument>
<description>
- Sets the [enum TileSet.BitmaskMode] of the autotile.
+ Sets the [enum BitmaskMode] of the autotile.
</description>
</method>
<method name="autotile_set_icon_coordinate">
@@ -503,7 +503,7 @@
<argument index="0" name="id" type="int">
</argument>
<description>
- Returns the tile's [enum TileSet.TileMode].
+ Returns the tile's [enum TileMode].
</description>
</method>
<method name="tile_get_z_index" qualifiers="const">
@@ -719,7 +719,7 @@
<argument index="1" name="tilemode" type="int" enum="TileSet.TileMode">
</argument>
<description>
- Sets the tile's [enum TileSet.TileMode].
+ Sets the tile's [enum TileMode].
</description>
</method>
<method name="tile_set_z_index">
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 0272efeecb..aa287b1ed0 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -92,7 +92,7 @@
<argument index="0" name="position" type="Vector2">
</argument>
<description>
- If [member drop_mode_flags] includes [code]DROP_MODE_INBETWEEN[/code], returns -1 if [code]position[/code] is the upper part of a tree item at that position, 1 for the lower part, and additionally 0 for the middle part if [member drop_mode_flags] includes [code]DROP_MODE_ON_ITEM[/code].
+ If [member drop_mode_flags] includes [constant DROP_MODE_INBETWEEN], returns -1 if [code]position[/code] is the upper part of a tree item at that position, 1 for the lower part, and additionally 0 for the middle part if [member drop_mode_flags] includes [constant DROP_MODE_ON_ITEM].
Otherwise, returns 0. If there are no tree item at [code]position[/code], returns -100.
</description>
</method>
@@ -228,7 +228,7 @@
The amount of columns.
</member>
<member name="drop_mode_flags" type="int" setter="set_drop_mode_flags" getter="get_drop_mode_flags">
- The drop mode as an OR combination of flags. See [code]DROP_MODE_*[/code] constants. Once dropping is done, reverts to [code]DROP_MODE_DISABLED[/code]. Setting this during [method Control.can_drop_data] is recommended.
+ The drop mode as an OR combination of flags. See [code]DROP_MODE_*[/code] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended.
</member>
<member name="hide_folding" type="bool" setter="set_hide_folding" getter="is_folding_hidden">
If [code]true[/code], the folding arrow is hidden.
@@ -268,7 +268,7 @@
<argument index="0" name="arrow_clicked" type="bool">
</argument>
<description>
- Emitted when a cell with the [code]CELL_MODE_CUSTOM[/code] is clicked to be edited.
+ Emitted when a cell with the [constant TreeItem.CELL_MODE_CUSTOM] is clicked to be edited.
</description>
</signal>
<signal name="empty_rmb">
@@ -335,7 +335,7 @@
<argument index="2" name="selected" type="bool">
</argument>
<description>
- Emitted instead of [code]item_selected[/code] when [code]select_mode[/code] is [code]SELECT_MULTI[/code].
+ Emitted instead of [code]item_selected[/code] when [code]select_mode[/code] is [constant SELECT_MULTI].
</description>
</signal>
<signal name="nothing_selected">
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index d121fdc125..ff1413cb94 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -14,7 +14,7 @@
tween.start()
[/codeblock]
Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using "property:component" (eg. [code]position:x[/code]), where it would only apply to that particular component.
- Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [code]EASE_IN_OUT[/code], and use the one that looks best.
+ Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml
index c0b73cd8e3..71da4c684c 100644
--- a/doc/classes/UndoRedo.xml
+++ b/doc/classes/UndoRedo.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="UndoRedo" inherits="Object" category="Core" version="3.2">
<brief_description>
- Helper to manage UndoRedo in the editor or custom tools.
+ Helper to manage undo/redo operations in the editor or custom tools.
</brief_description>
<description>
- Helper to manage UndoRedo in the editor or custom tools. It works by registering methods and property changes inside 'actions'.
+ Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside 'actions'.
Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action.
- Here's an example on how to add an action to Godot editor's own 'undoredo':
+ Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin:
[codeblock]
var undo_redo = get_undo_redo() # Method of EditorPlugin.
@@ -137,37 +137,59 @@
<return type="int">
</return>
<description>
- Get the version, each time a new action is committed, the version number of the UndoRedo is increased automatically.
+ Get the version, each time a new action is committed, the version number of the [UndoRedo] is increased automatically.
This is useful mostly to check if something changed from a saved version.
</description>
</method>
+ <method name="has_redo">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if a 'redo' action is available.
+ </description>
+ </method>
+ <method name="has_undo">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if an 'undo' action is available.
+ </description>
+ </method>
<method name="is_commiting_action" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if the [UndoRedo] is currently committing the action, i.e. running its 'do' method or property change (see [method commit_action]).
</description>
</method>
<method name="redo">
<return type="bool">
</return>
<description>
- Redo last action.
+ Redo the last action.
</description>
</method>
<method name="undo">
<return type="bool">
</return>
<description>
- Undo last action.
+ Undo the last action.
</description>
</method>
</methods>
+ <signals>
+ <signal name="version_changed">
+ <description>
+ Called when [method undo] or [method redo] was called.
+ </description>
+ </signal>
+ </signals>
<constants>
<constant name="MERGE_DISABLE" value="0" enum="MergeMode">
- Makes [code]do[/code]/[code]undo[/code] operations stay in separate actions.
+ Makes 'do'/'undo' operations stay in separate actions.
</constant>
<constant name="MERGE_ENDS" value="1" enum="MergeMode">
- Makes so that the action's [code]do[/code] operation is from the first action created and the [code]undo[/code] operation is from the last subsequent action with the same name.
+ Makes so that the action's 'do' operation is from the first action created and the 'undo' operation is from the last subsequent action with the same name.
</constant>
<constant name="MERGE_ALL" value="2" enum="MergeMode">
Makes subsequent actions with the same name be merged into one.
diff --git a/doc/classes/VehicleBody.xml b/doc/classes/VehicleBody.xml
index ab821aafdc..f5b26e4f11 100644
--- a/doc/classes/VehicleBody.xml
+++ b/doc/classes/VehicleBody.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VehicleBody" inherits="RigidBody" category="Core" version="3.2">
<brief_description>
- Physics body that simulates the behaviour of a car.
+ Physics body that simulates the behavior of a car.
</brief_description>
<description>
This nodes implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape] for the main body of your vehicle and add [VehicleWheel] nodes for the wheels. You should also add a [MeshInstance] to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [member brake], [member engine_force], and [member steering] properties and not change the position or orientation of this node directly.
diff --git a/doc/classes/VehicleWheel.xml b/doc/classes/VehicleWheel.xml
index 0bc0e351e4..eee72db48e 100644
--- a/doc/classes/VehicleWheel.xml
+++ b/doc/classes/VehicleWheel.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VehicleWheel" inherits="Spatial" category="Core" version="3.2">
<brief_description>
- Physics object that simulates the behaviour of a wheel.
+ Physics object that simulates the behavior of a wheel.
</brief_description>
<description>
- This node needs to be used as a child node of [VehicleBody] and simulates the behaviour of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
+ This node needs to be used as a child node of [VehicleBody] and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 53e66cee74..caaaf662dc 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -222,7 +222,7 @@
The canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem]s. This is relative to the global canvas transform of the viewport.
</member>
<member name="debug_draw" type="int" setter="set_debug_draw" getter="get_debug_draw" enum="Viewport.DebugDraw">
- The overlay mode for test rendered geometry in debug purposes. Default value: [code]DEBUG_DRAW_DISABLED[/code].
+ The overlay mode for test rendered geometry in debug purposes. Default value: [constant DEBUG_DRAW_DISABLED].
</member>
<member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled">
If [code]true[/code], the viewport will disable 3D rendering. For actual disabling use [code]usage[/code]. Default value: [code]false[/code].
@@ -245,7 +245,7 @@
If [code]true[/code], the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output.
</member>
<member name="msaa" type="int" setter="set_msaa" getter="get_msaa" enum="Viewport.MSAA">
- The multisample anti-aliasing mode. Default value: [code]MSAA_DISABLED[/code].
+ The multisample anti-aliasing mode. Default value: [constant MSAA_DISABLED].
</member>
<member name="own_world" type="bool" setter="set_use_own_world" getter="is_using_own_world">
If [code]true[/code], the viewport will use [World] defined in [code]world[/code] property. Default value: [code]false[/code].
@@ -257,10 +257,10 @@
If [code]true[/code], renders the Viewport directly to the screen instead of to the root viewport. Only available in GLES2. This is a low-level optimization and should not be used in most cases. If used, reading from the Viewport or from [code]SCREEN_TEXTURE[/code] becomes unavailable. For more information see [method VisualServer.viewport_set_render_direct_to_screen]. Default value: [code]false[/code].
</member>
<member name="render_target_clear_mode" type="int" setter="set_clear_mode" getter="get_clear_mode" enum="Viewport.ClearMode">
- The clear mode when viewport used as a render target. Default value: [code]CLEAR_MODE_ALWAYS[/code].
+ The clear mode when viewport used as a render target. Default value: [constant CLEAR_MODE_ALWAYS].
</member>
<member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="Viewport.UpdateMode">
- The update mode when viewport used as a render target. Default value: [code]UPDATE_WHEN_VISIBLE[/code].
+ The update mode when viewport used as a render target. Default value: [constant UPDATE_WHEN_VISIBLE].
</member>
<member name="render_target_v_flip" type="bool" setter="set_vflip" getter="get_vflip">
If [code]true[/code], the result of rendering will be flipped vertically. Default value: [code]false[/code].
@@ -308,7 +308,7 @@
Do not update the render target.
</constant>
<constant name="UPDATE_ONCE" value="1" enum="UpdateMode">
- Update the render target once, then switch to [code]UPDATE_DISABLED[/code].
+ Update the render target once, then switch to [constant UPDATE_DISABLED].
</constant>
<constant name="UPDATE_WHEN_VISIBLE" value="2" enum="UpdateMode">
Update the render target only when it is visible. This is the default value.
@@ -331,7 +331,7 @@
<constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_1024" value="6" enum="ShadowAtlasQuadrantSubdiv">
</constant>
<constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_MAX" value="7" enum="ShadowAtlasQuadrantSubdiv">
- Enum limiter. Do not use it directly.
+ Represents the size of the [enum ShadowAtlasQuadrantSubdiv] enum.
</constant>
<constant name="RENDER_INFO_OBJECTS_IN_FRAME" value="0" enum="RenderInfo">
Amount of objects in frame.
@@ -352,7 +352,7 @@
Amount of draw calls in frame.
</constant>
<constant name="RENDER_INFO_MAX" value="6" enum="RenderInfo">
- Enum limiter. Do not use it directly.
+ Represents the size of the [enum RenderInfo] enum.
</constant>
<constant name="DEBUG_DRAW_DISABLED" value="0" enum="DebugDraw">
Objects are displayed normally.
@@ -392,7 +392,7 @@
Never clear the render target.
</constant>
<constant name="CLEAR_MODE_ONLY_NEXT_FRAME" value="2" enum="ClearMode">
- Clear the render target next frame, then switch to [code]CLEAR_MODE_NEVER[/code].
+ Clear the render target next frame, then switch to [constant CLEAR_MODE_NEVER].
</constant>
</constants>
</class>
diff --git a/doc/classes/VisibilityEnabler.xml b/doc/classes/VisibilityEnabler.xml
index 910ca033d1..4b33d1ebce 100644
--- a/doc/classes/VisibilityEnabler.xml
+++ b/doc/classes/VisibilityEnabler.xml
@@ -26,6 +26,7 @@
This enabler will freeze [RigidBody] nodes.
</constant>
<constant name="ENABLER_MAX" value="2" enum="Enabler">
+ Represents the size of the [enum Enabler] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibilityEnabler2D.xml
index 3943eca7f5..b3d41d1fce 100644
--- a/doc/classes/VisibilityEnabler2D.xml
+++ b/doc/classes/VisibilityEnabler2D.xml
@@ -49,6 +49,7 @@
<constant name="ENABLER_PAUSE_ANIMATED_SPRITES" value="5" enum="Enabler">
</constant>
<constant name="ENABLER_MAX" value="6" enum="Enabler">
+ Represents the size of the [enum Enabler] enum.
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml
index f9b668b38a..565d8b3ae0 100644
--- a/doc/classes/VisualServer.xml
+++ b/doc/classes/VisualServer.xml
@@ -1951,6 +1951,8 @@
<argument index="2" name="scenario" type="RID">
</argument>
<description>
+ Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance] or [DirectionalLight]. Use [method @GDScript.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World] you want to query.
+ Warning: this function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
</description>
</method>
<method name="light_directional_set_blend_splits">
@@ -3708,7 +3710,7 @@
<argument index="1" name="clear_mode" type="int" enum="VisualServer.ViewportClearMode">
</argument>
<description>
- Sets the clear mode of a viewport. See [enum VisualServer.ViewportClearMode] for options.
+ Sets the clear mode of a viewport. See [enum ViewportClearMode] for options.
</description>
</method>
<method name="viewport_set_debug_draw">
@@ -3719,7 +3721,7 @@
<argument index="1" name="draw" type="int" enum="VisualServer.ViewportDebugDraw">
</argument>
<description>
- Sets the debug draw mode of a viewport. See [enum VisualServer.ViewportDebugDraw] for options.
+ Sets the debug draw mode of a viewport. See [enum ViewportDebugDraw] for options.
</description>
</method>
<method name="viewport_set_disable_3d">
@@ -4018,7 +4020,7 @@
Shader is a particle shader.
</constant>
<constant name="SHADER_MAX" value="3" enum="ShaderMode">
- Marks maximum of the shader types array. used internally.
+ Represents the size of the [enum ShaderMode] enum.
</constant>
<constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
Array is a vertex array.
@@ -4048,7 +4050,7 @@
Array is index array.
</constant>
<constant name="ARRAY_MAX" value="9" enum="ArrayType">
- Marks the maximum of the array types. Used internally.
+ Represents the size of the [enum ArrayType] enum.
</constant>
<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
Flag used to mark a vertex array.
@@ -4133,7 +4135,7 @@
Primitive to draw consists of a triangle strip (the last 2 vertices are always combined with the first to make a triangle).
</constant>
<constant name="PRIMITIVE_MAX" value="7" enum="PrimitiveType">
- Marks the primitive types endpoint. used internally.
+ Represents the size of the [enum PrimitiveType] enum.
</constant>
<constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
</constant>
@@ -4184,7 +4186,7 @@
<constant name="LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE" value="14" enum="LightParam">
</constant>
<constant name="LIGHT_PARAM_MAX" value="15" enum="LightParam">
- The light parameters endpoint. Used internally.
+ Represents the size of the [enum LightParam] enum.
</constant>
<constant name="LIGHT_OMNI_SHADOW_DUAL_PARABOLOID" value="0" enum="LightOmniShadowMode">
</constant>
@@ -4219,7 +4221,7 @@
The viewport is never cleared before drawing.
</constant>
<constant name="VIEWPORT_CLEAR_ONLY_NEXT_FRAME" value="2" enum="ViewportClearMode">
- The viewport is cleared once, then the clear mode is set to [code]VIEWPORT_CLEAR_NEVER[/code].
+ The viewport is cleared once, then the clear mode is set to [constant VIEWPORT_CLEAR_NEVER].
</constant>
<constant name="VIEWPORT_MSAA_DISABLED" value="0" enum="ViewportMSAA">
Multisample antialiasing is disabled.
@@ -4261,7 +4263,7 @@
<constant name="VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME" value="5" enum="ViewportRenderInfo">
</constant>
<constant name="VIEWPORT_RENDER_INFO_MAX" value="6" enum="ViewportRenderInfo">
- Marks end of VIEWPORT_RENDER_INFO* constants. Used internally.
+ Represents the size of the [enum ViewportRenderInfo] enum.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_DISABLED" value="0" enum="ViewportDebugDraw">
Debug draw is disabled. Default setting.
@@ -4308,7 +4310,7 @@
<constant name="INSTANCE_LIGHTMAP_CAPTURE" value="8" enum="InstanceType">
</constant>
<constant name="INSTANCE_MAX" value="9" enum="InstanceType">
- The max value for INSTANCE_* constants, used internally.
+ Represents the size of the [enum InstanceType] enum.
</constant>
<constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType">
A combination of the flags of geometry instances (mesh, multimesh, immediate and particles).
@@ -4318,6 +4320,7 @@
<constant name="INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE" value="1" enum="InstanceFlags">
</constant>
<constant name="INSTANCE_FLAG_MAX" value="2" enum="InstanceFlags">
+ Represents the size of the [enum InstanceFlags] enum.
</constant>
<constant name="SHADOW_CASTING_SETTING_OFF" value="0" enum="ShadowCastingSetting">
</constant>
@@ -4388,9 +4391,10 @@
The amount of draw calls in frame.
</constant>
<constant name="INFO_USAGE_VIDEO_MEM_TOTAL" value="6" enum="RenderInfo">
+ Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
</constant>
<constant name="INFO_VIDEO_MEM_USED" value="7" enum="RenderInfo">
- The amount of vertex memory and texture memory used.
+ The amount of video memory used, i.e. texture and vertex memory combined.
</constant>
<constant name="INFO_TEXTURE_MEM_USED" value="8" enum="RenderInfo">
The amount of texture memory used.
@@ -4441,6 +4445,7 @@
<constant name="ENV_BG_KEEP" value="5" enum="EnvironmentBG">
</constant>
<constant name="ENV_BG_MAX" value="7" enum="EnvironmentBG">
+ Represents the size of the [enum EnvironmentBG] enum.
</constant>
<constant name="ENV_DOF_BLUR_QUALITY_LOW" value="0" enum="EnvironmentDOFBlurQuality">
</constant>
diff --git a/doc/classes/VisualShader.xml b/doc/classes/VisualShader.xml
index 6d5f53d992..0c9292930d 100644
--- a/doc/classes/VisualShader.xml
+++ b/doc/classes/VisualShader.xml
@@ -194,6 +194,7 @@
<constant name="TYPE_LIGHT" value="2" enum="Type">
</constant>
<constant name="TYPE_MAX" value="3" enum="Type">
+ Represents the size of the [enum Type] enum.
</constant>
<constant name="NODE_ID_INVALID" value="-1">
</constant>
diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml
index a11e95db79..55dfb5d489 100644
--- a/doc/classes/XMLParser.xml
+++ b/doc/classes/XMLParser.xml
@@ -70,7 +70,7 @@
<return type="String">
</return>
<description>
- Get the name of the current element node. This will raise an error if the current node type is not [code]NODE_ELEMENT[/code] nor [code]NODE_ELEMENT_END[/code]
+ Get the name of the current element node. This will raise an error if the current node type is not [constant NODE_ELEMENT] nor [constant NODE_ELEMENT_END]
</description>
</method>
<method name="get_node_offset" qualifiers="const">
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 9fe7e43b43..b08202ae45 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -811,7 +811,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer)
data.resize(data_size);
- Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1 ? true : false, real_format, data));
+ Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1, real_format, data));
return Ref<Image>(img);
#else
diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp
index df7b170bf4..58eff791ca 100644
--- a/drivers/gles2/shader_gles2.cpp
+++ b/drivers/gles2/shader_gles2.cpp
@@ -182,14 +182,11 @@ ShaderGLES2::Version *ShaderGLES2::get_current_version() {
#endif
- int define_line_ofs = 1;
-
for (int j = 0; j < conditional_count; j++) {
bool enable = (conditional_version.version & (1 << j)) > 0;
if (enable) {
strings.push_back(conditional_defines[j]);
- define_line_ofs++;
DEBUG_PRINT(conditional_defines[j]);
}
}
@@ -206,7 +203,6 @@ ShaderGLES2::Version *ShaderGLES2::get_current_version() {
ERR_FAIL_COND_V(!cc, NULL);
v.code_version = cc->version;
- define_line_ofs += 2;
}
// program
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 1f3af2f885..eb5ab53421 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -691,7 +691,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
state.canvas_shader.set_uniform(CanvasShaderGLES3::DST_RECT, Color(dst_rect.position.x, dst_rect.position.y, dst_rect.size.x, dst_rect.size.y));
state.canvas_shader.set_uniform(CanvasShaderGLES3::SRC_RECT, Color(src_rect.position.x, src_rect.position.y, src_rect.size.x, src_rect.size.y));
- state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, (rect->flags & CANVAS_RECT_CLIP_UV) ? true : false);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::CLIP_RECT_UV, rect->flags & CANVAS_RECT_CLIP_UV);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
@@ -1932,7 +1932,7 @@ void RasterizerCanvasGLES3::draw_window_margins(int *black_margin, RID *black_im
int window_h = window_size.height;
int window_w = window_size.width;
- glBindFramebuffer(GL_FRAMEBUFFER, storage->system_fbo);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
glViewport(0, 0, window_size.width, window_size.height);
canvas_begin();
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index b3a1d32bf4..91c0693538 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2426,7 +2426,7 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
e->sort_key |= SORT_KEY_LIGHTMAP_CAPTURE_FLAG;
}
- e->sort_key |= uint64_t(p_material->render_priority + 128) << RenderList::SORT_KEY_PRIORITY_SHIFT;
+ e->sort_key |= (uint64_t(p_material->render_priority) + 128) << RenderList::SORT_KEY_PRIORITY_SHIFT;
}
/*
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 96094dd0ad..0f6db2dfb8 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1252,7 +1252,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
data.resize(data_size);
- Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1 ? true : false, img_format, data));
+ Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1, img_format, data));
return Ref<Image>(img);
#else
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index badb656e96..0a7e47e304 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -816,7 +816,7 @@ public:
virtual void multimesh_instance_set_transform(RID p_multimesh, int p_index, const Transform &p_transform);
virtual void multimesh_instance_set_transform_2d(RID p_multimesh, int p_index, const Transform2D &p_transform);
virtual void multimesh_instance_set_color(RID p_multimesh, int p_index, const Color &p_color);
- virtual void multimesh_instance_set_custom_data(RID p_multimesh, int p_index, const Color &p_color);
+ virtual void multimesh_instance_set_custom_data(RID p_multimesh, int p_index, const Color &p_custom_data);
virtual RID multimesh_get_mesh(RID p_multimesh) const;
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index fa7cc00230..ac911993be 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -478,7 +478,7 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
glDeleteShader(v.vert_id);
glDeleteProgram(v.id);
v.id = 0;
- ERR_FAIL_COND_V(iloglen <= 0, NULL);
+ ERR_FAIL_COND_V(iloglen < 0, NULL);
}
if (iloglen == 0) {
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index e011176806..950979a78e 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -100,10 +100,7 @@ bool DirAccessUnix::dir_exists(String p_dir) {
struct stat flags;
bool success = (stat(p_dir.utf8().get_data(), &flags) == 0);
- if (success && S_ISDIR(flags.st_mode))
- return true;
-
- return false;
+ return (success && S_ISDIR(flags.st_mode));
}
uint64_t DirAccessUnix::get_modified_time(String p_file) {
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp
index 4bde7789e2..c10443acde 100644
--- a/drivers/unix/net_socket_posix.cpp
+++ b/drivers/unix/net_socket_posix.cpp
@@ -229,10 +229,7 @@ bool NetSocketPosix::_can_use_ip(const IP_Address p_ip, const bool p_for_bind) c
}
// Check if socket support this IP type.
IP::Type type = p_ip.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6;
- if (_ip_type != IP::TYPE_ANY && !p_ip.is_wildcard() && _ip_type != type) {
- return false;
- }
- return true;
+ return !(_ip_type != IP::TYPE_ANY && !p_ip.is_wildcard() && _ip_type != type);
}
_FORCE_INLINE_ Error NetSocketPosix::_change_multicast_group(IP_Address p_ip, String p_if_name, bool p_add) {
diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h
index cf0412311d..ce6dc00d42 100644
--- a/drivers/unix/net_socket_posix.h
+++ b/drivers/unix/net_socket_posix.h
@@ -77,7 +77,7 @@ public:
virtual void close();
virtual Error bind(IP_Address p_addr, uint16_t p_port);
virtual Error listen(int p_max_pending);
- virtual Error connect_to_host(IP_Address p_addr, uint16_t p_port);
+ virtual Error connect_to_host(IP_Address p_host, uint16_t p_port);
virtual Error poll(PollType p_type, int timeout) const;
virtual Error recv(uint8_t *p_buffer, int p_len, int &r_read);
virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port);
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 1bed5a9524..721ed23d8a 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -286,7 +286,7 @@ public:
if (name == "value") {
- Variant value = p_value;
+ const Variant &value = p_value;
setting = true;
undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS);
@@ -302,7 +302,7 @@ public:
}
if (name == "in_handle") {
- Variant value = p_value;
+ const Variant &value = p_value;
setting = true;
undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS);
@@ -318,7 +318,7 @@ public:
}
if (name == "out_handle") {
- Variant value = p_value;
+ const Variant &value = p_value;
setting = true;
undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS);
@@ -4894,7 +4894,7 @@ void AnimationTrackEditor::_cleanup_animation(Ref<Animation> p_animation) {
continue;
}
- if (!prop_exists || p_animation->track_get_type(i) != Animation::TYPE_VALUE || cleanup_keys->is_pressed() == false)
+ if (!prop_exists || p_animation->track_get_type(i) != Animation::TYPE_VALUE || !cleanup_keys->is_pressed())
continue;
for (int j = 0; j < p_animation->track_get_key_count(i); j++) {
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 5f05c1de8c..0d5a621e07 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -332,7 +332,7 @@ class AnimationTrackEditor : public VBoxContainer {
void _update_scroll(double);
void _update_step(double p_new_step);
- void _update_length(double p_new_step);
+ void _update_length(double p_new_len);
void _dropped_track(int p_from_track, int p_to_track);
void _add_track(int p_type);
diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp
index 72beeaaf45..f2471e80d4 100644
--- a/editor/array_property_edit.cpp
+++ b/editor/array_property_edit.cpp
@@ -93,7 +93,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) {
if (newsize == size)
return true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Resize Array"));
ur->add_do_method(this, "_set_size", newsize);
ur->add_undo_method(this, "_set_size", size);
@@ -141,7 +141,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) {
if (value.get_type() != type && type >= 0 && type < Variant::VARIANT_MAX) {
Variant::CallError ce;
Variant new_value = Variant::construct(Variant::Type(type), NULL, 0, ce);
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Array Value Type"));
ur->add_do_method(this, "_set_value", idx, new_value);
@@ -157,7 +157,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) {
Variant arr = get_array();
Variant value = arr.get(idx);
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Array Value"));
ur->add_do_method(this, "_set_value", idx, p_value);
diff --git a/editor/audio_stream_preview.h b/editor/audio_stream_preview.h
index fca0aabac1..90b59cf8c1 100644
--- a/editor/audio_stream_preview.h
+++ b/editor/audio_stream_preview.h
@@ -78,7 +78,7 @@ protected:
public:
static AudioStreamPreviewGenerator *get_singleton() { return singleton; }
- Ref<AudioStreamPreview> generate_preview(const Ref<AudioStream> &p_preview);
+ Ref<AudioStreamPreview> generate_preview(const Ref<AudioStream> &p_stream);
AudioStreamPreviewGenerator();
};
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index a0d319c81b..4bc9dff26c 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -48,7 +48,7 @@
String Collada::Effect::get_texture_path(const String &p_source, Collada &state) const {
- String image = p_source;
+ const String &image = p_source;
ERR_FAIL_COND_V(!state.state.image_map.has(image), "");
return state.state.image_map[image].path;
}
@@ -1101,6 +1101,7 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name
Vector<float> values = _read_float_array(parser);
if (polygons) {
+ ERR_CONTINUE(prim.vertex_size == 0);
prim.polygons.push_back(values.size() / prim.vertex_size);
int from = prim.indices.size();
prim.indices.resize(from + values.size());
@@ -2522,7 +2523,6 @@ Error Collada::load(const String &p_path, int p_flags) {
state.local_path = ProjectSettings::get_singleton()->localize_path(p_path);
state.import_flags = p_flags;
/* Skip headers */
- err = OK;
while ((err = parser.read()) == OK) {
if (parser.get_node_type() == XMLParser::NODE_ELEMENT) {
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 6d3603f31b..d04392dabf 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -649,7 +649,7 @@ Open connection dialog with TreeItem data to CREATE a brand-new connection.
void ConnectionsDock::_open_connection_dialog(TreeItem &item) {
String signal = item.get_metadata(0).operator Dictionary()["name"];
- String signalname = signal;
+ const String &signalname = signal;
String midname = selectedNode->get_name();
for (int i = 0; i < midname.length(); i++) { //TODO: Regex filter may be cleaner.
CharType c = midname[i];
diff --git a/editor/dictionary_property_edit.cpp b/editor/dictionary_property_edit.cpp
index 9f4096ca02..62b50b16f2 100644
--- a/editor/dictionary_property_edit.cpp
+++ b/editor/dictionary_property_edit.cpp
@@ -42,7 +42,6 @@ void DictionaryPropertyEdit::_notif_changev(const String &p_v) {
void DictionaryPropertyEdit::_set_key(const Variant &p_old_key, const Variant &p_new_key) {
// TODO: Set key of a dictionary is not allowed yet
- return;
}
void DictionaryPropertyEdit::_set_value(const Variant &p_key, const Variant &p_value) {
@@ -129,7 +128,7 @@ bool DictionaryPropertyEdit::_set(const StringName &p_name, const Variant &p_val
if (type == "key" && index < keys.size()) {
const Variant &key = keys[index];
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Dictionary Key"));
ur->add_do_method(this, "_set_key", key, p_value);
@@ -144,7 +143,7 @@ bool DictionaryPropertyEdit::_set(const StringName &p_name, const Variant &p_val
if (dict.has(key)) {
Variant value = dict[key];
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Dictionary Value"));
ur->add_do_method(this, "_set_value", key, p_value);
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 57fac241b0..b9fb532c4a 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -288,7 +288,7 @@ void EditorAudioBus::_name_changed(const String &p_new_name) {
}
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
StringName current = AudioServer::get_singleton()->get_bus_name(get_index());
ur->create_action(TTR("Rename Audio Bus"));
@@ -323,7 +323,7 @@ void EditorAudioBus::_volume_changed(float p_normalized) {
float p_db = this->_normalized_volume_to_scaled_db(p_normalized);
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Audio Bus Volume"), UndoRedo::MERGE_ENDS);
ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", get_index(), p_db);
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_volume_db", get_index(), AudioServer::get_singleton()->get_bus_volume_db(get_index()));
@@ -400,7 +400,7 @@ void EditorAudioBus::_solo_toggled() {
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Toggle Audio Bus Solo"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), solo->is_pressed());
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), AudioServer::get_singleton()->is_bus_solo(get_index()));
@@ -414,7 +414,7 @@ void EditorAudioBus::_mute_toggled() {
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Toggle Audio Bus Mute"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), mute->is_pressed());
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), AudioServer::get_singleton()->is_bus_mute(get_index()));
@@ -428,7 +428,7 @@ void EditorAudioBus::_bypass_toggled() {
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Toggle Audio Bus Bypass Effects"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), bypass->is_pressed());
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), AudioServer::get_singleton()->is_bus_bypassing_effects(get_index()));
@@ -443,7 +443,7 @@ void EditorAudioBus::_send_selected(int p_which) {
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Select Audio Bus Send"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_send", get_index(), send->get_item_text(p_which));
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_send", get_index(), AudioServer::get_singleton()->get_bus_send(get_index()));
@@ -492,7 +492,7 @@ void EditorAudioBus::_effect_edited() {
int index = effect->get_metadata(0);
updating_bus = true;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Select Audio Bus Send"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, effect->is_checked(0));
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, AudioServer::get_singleton()->is_bus_effect_enabled(get_index(), index));
@@ -519,7 +519,7 @@ void EditorAudioBus::_effect_add(int p_which) {
afxr->set_name(effect_options->get_item_text(p_which));
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Add Audio Bus Effect"));
ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), afxr, -1);
ur->add_undo_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect_count(get_index()));
@@ -671,7 +671,7 @@ void EditorAudioBus::drop_data_fw(const Point2 &p_point, const Variant &p_data,
bool enabled = AudioServer::get_singleton()->is_bus_effect_enabled(bus, effect);
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Move Bus Effect"));
ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", bus, effect);
ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(bus, effect), paste_at);
@@ -712,7 +712,7 @@ void EditorAudioBus::_delete_effect_pressed(int p_option) {
int index = item->get_metadata(0);
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Delete Bus Effect"));
ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), index);
ur->add_undo_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(get_index(), index), index);
@@ -980,11 +980,7 @@ void EditorAudioBusDrop::_notification(int p_what) {
bool EditorAudioBusDrop::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
Dictionary d = p_data;
- if (d.has("type") && String(d["type"]) == "move_audio_bus") {
- return true;
- }
-
- return false;
+ return (d.has("type") && String(d["type"]) == "move_audio_bus");
}
void EditorAudioBusDrop::drop_data(const Point2 &p_point, const Variant &p_data) {
@@ -1013,7 +1009,7 @@ void EditorAudioBuses::_update_buses() {
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
- bool is_master = i == 0 ? true : false;
+ bool is_master = (i == 0);
EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master));
bus_hb->add_child(audio_bus);
audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED);
@@ -1075,7 +1071,7 @@ void EditorAudioBuses::_notification(int p_what) {
void EditorAudioBuses::_add_bus() {
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Add Audio Bus"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_count", AudioServer::get_singleton()->get_bus_count() + 1);
@@ -1109,7 +1105,7 @@ void EditorAudioBuses::_delete_bus(Object *p_which) {
return;
}
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Delete Audio Bus"));
ur->add_do_method(AudioServer::get_singleton(), "remove_bus", index);
@@ -1133,7 +1129,7 @@ void EditorAudioBuses::_delete_bus(Object *p_which) {
void EditorAudioBuses::_duplicate_bus(int p_which) {
int add_at_pos = p_which + 1;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Duplicate Audio Bus"));
ur->add_do_method(AudioServer::get_singleton(), "add_bus", add_at_pos);
ur->add_do_method(AudioServer::get_singleton(), "set_bus_name", add_at_pos, AudioServer::get_singleton()->get_bus_name(p_which) + " Copy");
@@ -1158,7 +1154,7 @@ void EditorAudioBuses::_reset_bus_volume(Object *p_which) {
EditorAudioBus *bus = Object::cast_to<EditorAudioBus>(p_which);
int index = bus->get_index();
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Reset Bus Volume"));
ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", index, 0.f);
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_volume_db", index, AudioServer::get_singleton()->get_bus_volume_db(index));
@@ -1180,7 +1176,7 @@ void EditorAudioBuses::_request_drop_end() {
void EditorAudioBuses::_drop_at_index(int p_bus, int p_index) {
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Move Audio Bus"));
ur->add_do_method(AudioServer::get_singleton(), "move_bus", p_bus, p_index);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 9f0b4250a3..7210211d90 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -545,10 +545,7 @@ bool EditorAutoloadSettings::can_drop_data_fw(const Point2 &p_point, const Varia
int section = tree->get_drop_section_at_position(p_point);
- if (section < -1)
- return false;
-
- return true;
+ return section >= -1;
}
return false;
@@ -650,7 +647,7 @@ bool EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_
return false;
}
- String path = p_path;
+ const String &path = p_path;
if (!FileAccess::exists(path)) {
EditorNode::get_singleton()->show_warning(TTR("Invalid path.") + "\n" + TTR("File does not exist."));
return false;
@@ -663,7 +660,7 @@ bool EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_
name = "autoload/" + name;
- UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *undo_redo = EditorNode::get_undo_redo();
undo_redo->create_action(TTR("Add AutoLoad"));
// Singleton autoloads are represented with a leading "*" in their path.
@@ -690,7 +687,7 @@ void EditorAutoloadSettings::autoload_remove(const String &p_name) {
String name = "autoload/" + p_name;
- UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *undo_redo = EditorNode::get_undo_redo();
int order = ProjectSettings::get_singleton()->get_order(name);
diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp
index e04bca2a9e..7733ecb9da 100644
--- a/editor/editor_dir_dialog.cpp
+++ b/editor/editor_dir_dialog.cpp
@@ -186,7 +186,7 @@ EditorDirDialog::EditorDirDialog() {
tree->connect("item_activated", this, "_ok");
- makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel() ? true : false, "makedir");
+ makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir");
makedir->connect("pressed", this, "_make_dir");
makedialog = memnew(ConfirmationDialog);
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index b5325a07a5..bebd5b2412 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -977,7 +977,8 @@ Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, c
ftmp = FileAccess::open(tmppath, FileAccess::READ);
if (!ftmp) {
memdelete(f);
- ERR_FAIL_COND_V(!ftmp, ERR_CANT_CREATE);
+ ERR_EXPLAIN("Can't open file to read from path: " + String(tmppath));
+ ERR_FAIL_V(ERR_CANT_CREATE);
}
const int bufsize = 16384;
@@ -1455,10 +1456,7 @@ bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset,
err += TTR("Custom release template not found.") + "\n";
}
- if (dvalid || rvalid)
- valid = true;
- else
- valid = false;
+ valid = dvalid || rvalid;
if (!err.empty())
r_error = err;
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 4ddb28b440..3c7c6ec9ed 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1290,13 +1290,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
r_file_pos = cpos;
*r_d = fs;
- if (cpos != -1) {
-
- return true;
- } else {
-
- return false;
- }
+ return cpos != -1;
}
String EditorFileSystem::get_file_type(const String &p_file) const {
@@ -1604,7 +1598,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
//all went well, overwrite config files with proper remaps and md5s
for (Map<String, Map<StringName, Variant> >::Element *E = source_file_options.front(); E; E = E->next()) {
- String file = E->key();
+ const String &file = E->key();
String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(file);
FileAccessRef f = FileAccess::open(file + ".import", FileAccess::WRITE);
ERR_FAIL_COND_V(!f, ERR_FILE_CANT_OPEN);
@@ -1939,7 +1933,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
if (err) {
memdelete(da);
ERR_EXPLAIN("Failed to create 'res://.import' folder.");
- ERR_FAIL_COND(err != OK);
+ ERR_FAIL();
}
}
memdelete(da);
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 4bfb967351..9918b655fb 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -389,7 +389,6 @@ void EditorHelp::_update_doc() {
if (prev) {
class_desc->add_text(" , ");
- prev = false;
}
_add_type(E->get().name);
@@ -544,7 +543,6 @@ void EditorHelp::_update_doc() {
class_desc->pop(); //cell
class_desc->push_cell();
class_desc->pop(); //cell
- any_previous = false;
}
String group_prefix;
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index 0550509ba2..117a63699e 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -139,7 +139,7 @@ public:
bool is_selected() const;
void set_label_reference(Control *p_control);
- void set_bottom_editor(Control *p_editor);
+ void set_bottom_editor(Control *p_control);
void set_use_folding(bool p_use_folding);
bool is_using_folding() const;
@@ -317,7 +317,7 @@ class EditorInspector : public ScrollContainer {
void _node_removed(Node *p_node);
void _changed_callback(Object *p_changed, const char *p_prop);
- void _edit_request_change(Object *p_changed, const String &p_prop);
+ void _edit_request_change(Object *p_object, const String &p_prop);
void _filter_changed(const String &p_text);
void _parse_added_editors(VBoxContainer *current_vbox, Ref<EditorInspectorPlugin> ped);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 055e1338dd..78c38af555 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -184,7 +184,7 @@ Node *EditorInterface::get_edited_scene_root() {
Array EditorInterface::get_open_scenes() const {
Array ret;
- Vector<EditorData::EditedScene> scenes = EditorNode::get_singleton()->get_editor_data().get_edited_scenes();
+ Vector<EditorData::EditedScene> scenes = EditorNode::get_editor_data().get_edited_scenes();
int scns_amount = scenes.size();
for (int idx_scn = 0; idx_scn < scns_amount; idx_scn++) {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 0d700cd9b6..ec369bbdbb 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -101,7 +101,7 @@ public:
Error save_scene();
void save_scene_as(const String &p_scene, bool p_with_preview = true);
- Vector<Ref<Texture> > make_mesh_previews(const Vector<Ref<Mesh> > &p_meshes, Vector<Transform> *p_trnasforms, int p_preview_size);
+ Vector<Ref<Texture> > make_mesh_previews(const Vector<Ref<Mesh> > &p_meshes, Vector<Transform> *p_transforms, int p_preview_size);
EditorInterface();
};
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp
index f73cd0beb5..9cf36f162d 100644
--- a/editor/editor_profiler.cpp
+++ b/editor/editor_profiler.cpp
@@ -227,8 +227,6 @@ void EditorProfiler::_update_plot() {
Map<StringName, int> plot_prev;
//Map<StringName,int> plot_max;
- uint64_t time = OS::get_singleton()->get_ticks_usec();
-
for (int i = 0; i < w; i++) {
for (int j = 0; j < h * 4; j++) {
@@ -340,8 +338,6 @@ void EditorProfiler::_update_plot() {
wr[widx + 3] = 255;
}
}
-
- time = OS::get_singleton()->get_ticks_usec() - time;
}
wr = PoolVector<uint8_t>::Write();
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index d5f4d54e5c..8e4ec47435 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -2303,7 +2303,7 @@ void EditorPropertyResource::_update_menu_items() {
}
for (Set<String>::Element *F = valid_inheritors.front(); F; F = F->next()) {
- String t = F->get();
+ const String &t = F->get();
bool is_custom_resource = false;
Ref<Texture> icon;
@@ -2469,8 +2469,8 @@ void EditorPropertyResource::_fold_other_editors(Object *p_self) {
if (!res.is_valid())
return;
bool use_editor = false;
- for (int i = 0; i < EditorNode::get_singleton()->get_editor_data().get_editor_plugin_count(); i++) {
- EditorPlugin *ep = EditorNode::get_singleton()->get_editor_data().get_editor_plugin(i);
+ for (int i = 0; i < EditorNode::get_editor_data().get_editor_plugin_count(); i++) {
+ EditorPlugin *ep = EditorNode::get_editor_data().get_editor_plugin(i);
if (ep->handles(res.ptr())) {
use_editor = true;
}
@@ -2516,7 +2516,7 @@ void EditorPropertyResource::update_property() {
sub_inspector->set_keying(is_keying());
sub_inspector->set_read_only(is_read_only());
sub_inspector->set_use_folding(is_using_folding());
- sub_inspector->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
+ sub_inspector->set_undo_redo(EditorNode::get_undo_redo());
sub_inspector_vbox = memnew(VBoxContainer);
add_child(sub_inspector_vbox);
@@ -2526,8 +2526,8 @@ void EditorPropertyResource::update_property() {
assign->set_pressed(true);
bool use_editor = false;
- for (int i = 0; i < EditorNode::get_singleton()->get_editor_data().get_editor_plugin_count(); i++) {
- EditorPlugin *ep = EditorNode::get_singleton()->get_editor_data().get_editor_plugin(i);
+ for (int i = 0; i < EditorNode::get_editor_data().get_editor_plugin_count(); i++) {
+ EditorPlugin *ep = EditorNode::get_editor_data().get_editor_plugin(i);
if (ep->handles(res.ptr())) {
use_editor = true;
}
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 5f18959689..a49f9489e1 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -791,7 +791,7 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::_RID: {
- prop = memnew(EditorPropertyNil);
+ prop = memnew(EditorPropertyRID);
} break;
case Variant::OBJECT: {
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index 0ba32395ec..4bd68a593f 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -50,10 +50,8 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
args.push_back(resource_path.replace(" ", "%20"));
}
- if (true) {
- args.push_back("--remote-debug");
- args.push_back(remote_host + ":" + String::num(remote_port));
- }
+ args.push_back("--remote-debug");
+ args.push_back(remote_host + ":" + String::num(remote_port));
args.push_back("--allow_focus_steal_pid");
args.push_back(itos(OS::get_singleton()->get_process_id()));
diff --git a/editor/editor_run_native.h b/editor/editor_run_native.h
index d62c982725..a5c28b0cb4 100644
--- a/editor/editor_run_native.h
+++ b/editor/editor_run_native.h
@@ -36,7 +36,7 @@
class EditorRunNative : public HBoxContainer {
- GDCLASS(EditorRunNative, BoxContainer);
+ GDCLASS(EditorRunNative, HBoxContainer);
Map<int, MenuButton *> menus;
bool first;
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index f05a75ed90..8521c0c723 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -107,7 +107,7 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value)
}
if (save_changed_setting) {
- if (props[p_name].save != true) {
+ if (!props[p_name].save) {
props[p_name].save = true;
changed = true;
}
@@ -692,7 +692,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
keys.sort();
for (const List<String>::Element *E = keys.front(); E; E = E->next()) {
- String key = E->get();
+ const String &key = E->get();
if (key.begins_with("text_editor/highlighting/") && key.find("color") >= 0) {
cf->set_value(theme_section, key.replace("text_editor/highlighting/", ""), ((Color)props[key].variant).to_html());
}
@@ -700,10 +700,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
Error err = cf->save(p_file);
- if (err == OK) {
- return true;
- }
- return false;
+ return err == OK;
}
bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) {
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 2ee8dd805b..890850629e 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -73,8 +73,6 @@ private:
bool restart_if_changed;
VariantContainer() :
order(0),
- variant(Variant()),
- initial(Variant()),
has_default_value(false),
hide_from_editor(false),
save(false),
@@ -83,7 +81,6 @@ private:
VariantContainer(const Variant &p_variant, int p_order) :
order(p_order),
variant(p_variant),
- initial(Variant()),
has_default_value(false),
hide_from_editor(false),
save(false),
@@ -123,7 +120,7 @@ private:
void _load_defaults(Ref<ConfigFile> p_extra_config = NULL);
void _load_default_text_editor_theme();
bool _save_text_editor_theme(String p_file);
- bool _is_default_text_editor_theme(String p_file);
+ bool _is_default_text_editor_theme(String p_theme_name);
protected:
static void _bind_methods();
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index 4e499021f9..bd61e6182c 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -314,7 +314,8 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
if (!f) {
ret = unzGoToNextFile(pkg);
fc++;
- ERR_CONTINUE(!f);
+ ERR_EXPLAIN("Can't open file from path: " + String(to_write));
+ ERR_CONTINUE(true);
}
f->store_buffer(data.ptr(), data.size());
@@ -406,9 +407,7 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int
} break;
case HTTPRequest::RESULT_BODY_SIZE_LIMIT_EXCEEDED:
case HTTPRequest::RESULT_CONNECTION_ERROR:
- case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH: {
- template_list_state->set_text(TTR("Can't connect."));
- } break;
+ case HTTPRequest::RESULT_CHUNKED_BODY_SIZE_MISMATCH:
case HTTPRequest::RESULT_SSL_HANDSHAKE_ERROR:
case HTTPRequest::RESULT_CANT_CONNECT: {
template_list_state->set_text(TTR("Can't connect."));
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index e57217bb11..83e529ac35 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -244,7 +244,7 @@ void FileSystemDock::set_display_mode(DisplayMode p_display_mode) {
void FileSystemDock::_update_display_mode(bool p_force) {
// Compute the new display mode
if (p_force || old_display_mode != display_mode) {
- button_toggle_display_mode->set_pressed(display_mode == DISPLAY_MODE_SPLIT ? true : false);
+ button_toggle_display_mode->set_pressed(display_mode == DISPLAY_MODE_SPLIT);
switch (display_mode) {
case DISPLAY_MODE_TREE_ONLY:
tree->show();
@@ -2063,8 +2063,6 @@ void FileSystemDock::_get_drag_target_folder(String &target, bool &target_favori
}
}
}
-
- return;
}
void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<String> p_paths, bool p_display_path_dependent_options) {
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index 46eaf71a8a..76f92665db 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -204,7 +204,7 @@ private:
void _update_resource_paths_after_move(const Map<String, String> &p_renames) const;
void _save_scenes_after_move(const Map<String, String> &p_renames) const;
void _update_favorites_list_after_move(const Map<String, String> &p_files_renames, const Map<String, String> &p_folders_renames) const;
- void _update_project_settings_after_move(const Map<String, String> &p_folders_renames) const;
+ void _update_project_settings_after_move(const Map<String, String> &p_renames) const;
void _file_deleted(String p_file);
void _folder_deleted(String p_folder);
diff --git a/editor/import/editor_import_plugin.h b/editor/import/editor_import_plugin.h
index b3eb7ae83b..eb119b4ba3 100644
--- a/editor/import/editor_import_plugin.h
+++ b/editor/import/editor_import_plugin.h
@@ -34,7 +34,7 @@
#include "core/io/resource_importer.h"
class EditorImportPlugin : public ResourceImporter {
- GDCLASS(EditorImportPlugin, Reference);
+ GDCLASS(EditorImportPlugin, ResourceImporter);
protected:
static void _bind_methods();
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 0989a43705..a8197ec2a2 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -1135,7 +1135,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "nodes/storage", PROPERTY_HINT_ENUM, "Single Scene,Instanced Sub-Scenes"), scenes_out ? 1 : 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), (meshes_out || materials_out) ? 1 : 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/storage", PROPERTY_HINT_ENUM, "Built-In,Files", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), materials_out ? 1 : 0));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "materials/keep_on_reimport"), materials_out ? true : false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "materials/keep_on_reimport"), materials_out));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "meshes/compress"), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "meshes/ensure_tangents"), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "meshes/storage", PROPERTY_HINT_ENUM, "Built-In,Files"), meshes_out ? 1 : 0));
@@ -1145,8 +1145,8 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15));
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), ""));
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), animations_out ? true : false));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out ? true : false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), animations_out));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_angular_error"), 0.01));
@@ -1237,7 +1237,7 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito
Error ResourceImporterScene::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
- String src_path = p_source_file;
+ const String &src_path = p_source_file;
Ref<EditorSceneImporter> importer;
String ext = src_path.get_extension().to_lower();
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h
index e89f862c1b..498e0f6fb8 100644
--- a/editor/import/resource_importer_scene.h
+++ b/editor/import/resource_importer_scene.h
@@ -85,7 +85,7 @@ public:
String get_source_folder() const;
String get_source_file() const;
virtual Node *post_import(Node *p_scene);
- virtual void init(const String &p_scene_folder, const String &p_scene_path);
+ virtual void init(const String &p_source_folder, const String &p_source_file);
EditorScenePostImport();
};
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 5865ceb3af..25431179b5 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -205,11 +205,11 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options,
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Enabled,RGBA Only"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/normal_map", PROPERTY_HINT_ENUM, "Detect,Enable,Disabled"), 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/repeat", PROPERTY_HINT_ENUM, "Disabled,Enabled,Mirrored"), p_preset == PRESET_3D ? 1 : 0));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/filter"), p_preset == PRESET_2D_PIXEL ? false : true));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/mipmaps"), p_preset == PRESET_3D ? true : false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/filter"), p_preset != PRESET_2D_PIXEL));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/mipmaps"), p_preset == PRESET_3D));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "flags/anisotropic"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "flags/srgb", PROPERTY_HINT_ENUM, "Disable,Enable,Detect"), 2));
- r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/fix_alpha_border"), p_preset != PRESET_3D ? true : false));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/fix_alpha_border"), p_preset != PRESET_3D));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/premult_alpha"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/HDR_as_SRGB"), false));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "process/invert_color"), false));
diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp
index eca4e58abe..51a6cc6757 100644
--- a/editor/import/resource_importer_texture_atlas.cpp
+++ b/editor/import/resource_importer_texture_atlas.cpp
@@ -205,7 +205,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file
for (const Map<String, Map<StringName, Variant> >::Element *E = p_source_file_options.front(); E; E = E->next(), idx++) {
PackData &pack_data = pack_data_files.write[idx];
- String source = E->key();
+ const String &source = E->key();
const Map<StringName, Variant> &options = E->get();
Ref<Image> image;
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp
index e39f2dabaa..1787a3b88d 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -210,12 +210,6 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
print_line("bits: "+itos(format_bits));
*/
- int len = frames;
- if (format_channels == 2)
- len *= 2;
- if (format_bits > 8)
- len *= 2;
-
data.resize(frames * format_channels);
if (format_bits == 8) {
diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp
index 56a04f615d..6af7e4bd00 100644
--- a/editor/multi_node_edit.cpp
+++ b/editor/multi_node_edit.cpp
@@ -50,7 +50,7 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
name = "script";
}
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("MultiNode Set") + " " + String(name), UndoRedo::MERGE_ENDS);
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp
index e3fb579667..1c0151ed0a 100644
--- a/editor/node_dock.cpp
+++ b/editor/node_dock.cpp
@@ -119,13 +119,13 @@ NodeDock::NodeDock() {
groups_button->connect("pressed", this, "show_groups");
connections = memnew(ConnectionsDock(EditorNode::get_singleton()));
- connections->set_undoredo(EditorNode::get_singleton()->get_undo_redo());
+ connections->set_undoredo(EditorNode::get_undo_redo());
add_child(connections);
connections->set_v_size_flags(SIZE_EXPAND_FILL);
connections->hide();
groups = memnew(GroupsEditor);
- groups->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
+ groups->set_undo_redo(EditorNode::get_undo_redo());
add_child(groups);
groups->set_v_size_flags(SIZE_EXPAND_FILL);
groups->hide();
diff --git a/editor/plugin_config_dialog.h b/editor/plugin_config_dialog.h
index 74febfe408..525b7755dd 100644
--- a/editor/plugin_config_dialog.h
+++ b/editor/plugin_config_dialog.h
@@ -62,7 +62,7 @@ protected:
static void _bind_methods();
public:
- void config(const String &p_plugin_dir_name);
+ void config(const String &p_config_path);
PluginConfigDialog();
~PluginConfigDialog();
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 1afd7df049..2931678c80 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -807,7 +807,7 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(EditorNode *p_editor, bool p_wi
canvas_item_editor = NULL;
editor = p_editor;
- undo_redo = editor->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
wip_active = false;
edited_point = PosVertex();
diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp
index 2ae39d90de..e07f041eb1 100644
--- a/editor/plugins/animation_blend_space_1d_editor.cpp
+++ b/editor/plugins/animation_blend_space_1d_editor.cpp
@@ -735,7 +735,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
error_panel->add_child(error_label);
error_label->set_text("hmmm");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
menu = memnew(PopupMenu);
add_child(menu);
@@ -751,7 +751,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
open_file->set_title(TTR("Open Animation Node"));
open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
open_file->connect("file_selected", this, "_file_opened");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
selected_point = -1;
dragging_selected = false;
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index 5e8fb8e059..b422e3e927 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -1043,7 +1043,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
error_panel->add_child(error_label);
error_label->set_text("eh");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
set_custom_minimum_size(Size2(0, 300 * EDSCALE));
@@ -1061,7 +1061,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
open_file->set_title(TTR("Open Animation Node"));
open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
open_file->connect("file_selected", this, "_file_opened");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
selected_point = -1;
selected_triangle = -1;
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index dff6eb5c5e..65282ccfc2 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -598,7 +598,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
Skeleton *skeleton = Object::cast_to<Skeleton>(node);
if (skeleton && skeleton->find_bone(concat) != -1) {
//path in skeleton
- String bone = concat;
+ const String &bone = concat;
int idx = skeleton->find_bone(bone);
List<String> bone_path;
while (idx != -1) {
@@ -796,7 +796,7 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<Anima
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_node(prev_name));
ERR_FAIL_COND(!gn);
- String new_name = p_text;
+ const String &new_name = p_text;
ERR_FAIL_COND(new_name == "" || new_name.find(".") != -1 || new_name.find("/") != -1);
@@ -804,7 +804,7 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<Anima
return; //nothing to do
}
- String base_name = new_name;
+ const String &base_name = new_name;
int base = 1;
String name = base_name;
while (blend_tree->has_node(name)) {
@@ -964,5 +964,5 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() {
open_file->set_title(TTR("Open Animation Node"));
open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
open_file->connect("file_selected", this, "_file_opened");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
}
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index a8866a1a87..5163b372b2 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1868,7 +1868,7 @@ AnimationPlayerEditorPlugin::AnimationPlayerEditorPlugin(EditorNode *p_node) {
editor = p_node;
anim_editor = memnew(AnimationPlayerEditor(editor, this));
- anim_editor->set_undo_redo(editor->get_undo_redo());
+ anim_editor->set_undo_redo(EditorNode::get_undo_redo());
editor->add_bottom_panel_item(TTR("Animation"), anim_editor);
}
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index e25e7ac7ed..bc22d9315e 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1094,7 +1094,7 @@ void AnimationNodeStateMachineEditor::_removed_from_graph() {
void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) {
- String new_name = p_text;
+ const String &new_name = p_text;
ERR_FAIL_COND(new_name == "" || new_name.find(".") != -1 || new_name.find("/") != -1);
@@ -1102,7 +1102,7 @@ void AnimationNodeStateMachineEditor::_name_edited(const String &p_text) {
return; // Nothing to do.
}
- String base_name = new_name;
+ const String &base_name = new_name;
int base = 1;
String name = base_name;
while (state_machine->has_node(name)) {
@@ -1365,7 +1365,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
error_panel->add_child(error_label);
error_panel->hide();
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
set_custom_minimum_size(Size2(0, 300 * EDSCALE));
@@ -1390,7 +1390,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
open_file->set_title(TTR("Open Animation Node"));
open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE);
open_file->connect("file_selected", this, "_file_opened");
- undo_redo = EditorNode::get_singleton()->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
over_text = false;
diff --git a/editor/plugins/animation_tree_player_editor_plugin.cpp b/editor/plugins/animation_tree_player_editor_plugin.cpp
index f5d21ffb26..c99ad7f441 100644
--- a/editor/plugins/animation_tree_player_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_player_editor_plugin.cpp
@@ -511,9 +511,7 @@ void AnimationTreePlayerEditor::_draw_node(const StringName &p_node) {
font->draw_halign(ci, ofs + ascofs, HALIGN_CENTER, w, p_node, font_color);
ofs.y += h;
- int count = 2; // title and name
int inputs = anim_tree->node_get_input_count(p_node);
- count += inputs ? inputs : 1;
float icon_h_ofs = Math::floor((font->get_height() - slot_icon->get_height()) / 2.0) + 1;
@@ -618,7 +616,7 @@ AnimationTreePlayerEditor::ClickType AnimationTreePlayerEditor::_locate_click(co
for (const List<StringName>::Element *E = order.back(); E; E = E->prev()) {
- StringName node = E->get();
+ const StringName &node = E->get();
AnimationTreePlayer::NodeType type = anim_tree->node_get_type(node);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 2d1ef3473b..e0e9d4af52 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -71,8 +71,7 @@ class SnapDialog : public ConfirmationDialog {
SpinBox *rotation_step;
public:
- SnapDialog() :
- ConfirmationDialog() {
+ SnapDialog() {
const int SPIN_BOX_GRID_RANGE = 256;
const int SPIN_BOX_ROTATION_RANGE = 360;
Label *label;
@@ -490,8 +489,6 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
r_items.push_back(res);
}
}
-
- return;
}
void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items) {
@@ -1999,11 +1996,7 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) {
return true;
}
- if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)) {
- // Accept the key event in any case
- return true;
- }
- return false;
+ return (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_LEFT || k->get_scancode() == KEY_RIGHT)); // Accept the key event in any case
}
bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
@@ -4343,7 +4336,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
continue;
if (!n2d->get_parent_item())
continue;
- if (n2d->has_meta("_edit_bone_") && (bool)n2d->get_meta("_edit_bone_") == true)
+ if (n2d->has_meta("_edit_bone_") && n2d->get_meta("_edit_bone_"))
continue;
undo_redo->add_do_method(n2d, "set_meta", "_edit_bone_", true);
@@ -4393,7 +4386,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
continue;
if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root())
continue;
- if (canvas_item->has_meta("_edit_ik_") && (bool)canvas_item->get_meta("_edit_ik_") == true)
+ if (canvas_item->has_meta("_edit_ik_") && canvas_item->get_meta("_edit_ik_"))
continue;
undo_redo->add_do_method(canvas_item, "set_meta", "_edit_ik_", true);
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index ff221eb758..a46682d494 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -425,7 +425,7 @@ private:
List<CanvasItem *> _get_edited_canvas_items(bool retreive_locked = false, bool remove_canvas_item_if_parent_in_selection = true);
Rect2 _get_encompassing_rect_from_list(List<CanvasItem *> p_list);
- void _expand_encompassing_rect_using_children(Rect2 &p_rect, const Node *p_node, bool &r_first, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D(), bool include_locked_nodes = true);
+ void _expand_encompassing_rect_using_children(Rect2 &r_rect, const Node *p_node, bool &r_first, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D(), bool include_locked_nodes = true);
Rect2 _get_encompassing_rect(const Node *p_node);
Object *_get_editor_data(Object *p_what);
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 6ab554cb05..87cb0d04a2 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -527,7 +527,7 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) {
node = NULL;
editor = p_editor;
- undo_redo = editor->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
add_child(memnew(VSeparator));
button_create = memnew(ToolButton);
diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp
index a10eddb131..b87bd29cbd 100644
--- a/editor/plugins/path_2d_editor_plugin.cpp
+++ b/editor/plugins/path_2d_editor_plugin.cpp
@@ -179,7 +179,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
}
// Check for segment split.
- if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && mode == MODE_EDIT && on_edge == true) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && mode == MODE_EDIT && on_edge) {
Vector2 gpoint2 = mb->get_position();
Ref<Curve2D> curve = node->get_curve();
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index 53300f45ec..b8d95efd49 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -293,10 +293,7 @@ bool ResourcePreloaderEditor::can_drop_data_fw(const Point2 &p_point, const Vari
Vector<String> files = d["files"];
- if (files.size() == 0)
- return false;
-
- return true;
+ return files.size() != 0;
}
return false;
}
diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp
index 326e8394a0..05f682f469 100644
--- a/editor/plugins/root_motion_editor_plugin.cpp
+++ b/editor/plugins/root_motion_editor_plugin.cpp
@@ -131,7 +131,7 @@ void EditorPropertyRootMotion::_node_assign() {
Skeleton *skeleton = Object::cast_to<Skeleton>(node);
if (skeleton && skeleton->find_bone(concat) != -1) {
//path in skeleton
- String bone = concat;
+ const String &bone = concat;
int idx = skeleton->find_bone(bone);
List<String> bone_path;
while (idx != -1) {
diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_editor_plugin.h
index 33a9128a11..558e954815 100644
--- a/editor/plugins/skeleton_editor_plugin.h
+++ b/editor/plugins/skeleton_editor_plugin.h
@@ -69,7 +69,7 @@ protected:
PhysicalBone *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos);
public:
- void edit(Skeleton *p_mesh);
+ void edit(Skeleton *p_node);
SkeletonEditor();
~SkeletonEditor();
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 701b9e8144..3bddc6d6d4 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -133,7 +133,7 @@ public:
virtual bool is_editable() const;
void set_hidden(bool p_hidden);
- void set_plugin(EditorSpatialGizmoPlugin *p_gizmo);
+ void set_plugin(EditorSpatialGizmoPlugin *p_plugin);
EditorSpatialGizmo();
~EditorSpatialGizmo();
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 16f93b8fd3..82e8248216 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -1848,7 +1848,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
manual_position = Vector2(0, 0);
canvas_item_editor_viewport = NULL;
editor = p_editor;
- undo_redo = editor->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
tool = TOOL_NONE;
selection_active = false;
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 4b225fddf5..069d9d25ee 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -263,7 +263,7 @@ void TileSetEditor::_notification(int p_what) {
TileSetEditor::TileSetEditor(EditorNode *p_editor) {
editor = p_editor;
- undo_redo = editor->get_undo_redo();
+ undo_redo = EditorNode::get_undo_redo();
current_tile = -1;
VBoxContainer *left_container = memnew(VBoxContainer);
@@ -829,8 +829,8 @@ void TileSetEditor::_on_workspace_draw() {
case EDITMODE_BITMASK: {
Color c(1, 0, 0, 0.5);
Color ci(0.3, 0.6, 1, 0.5);
- for (float x = 0; x < region.size.x / (spacing + size.x); x++) {
- for (float y = 0; y < region.size.y / (spacing + size.y); y++) {
+ for (int x = 0; x < region.size.x / (spacing + size.x); x++) {
+ for (int y = 0; y < region.size.y / (spacing + size.y); y++) {
Vector2 coord(x, y);
Point2 anchor(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
anchor += WORKSPACE_MARGIN;
@@ -2009,11 +2009,7 @@ bool TileSetEditor::_sort_tiles(Variant p_a, Variant p_b) {
return true;
} else if (pos_a.y == pos_b.y) {
- if (pos_a.x < pos_b.x) {
- return true;
- } else {
- return false;
- }
+ return (pos_a.x < pos_b.x);
} else {
return false;
}
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index bfb005cd0b..ddf49aa9ea 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -158,10 +158,7 @@ bool VisualShaderEditor::_is_available(int p_mode) {
p_mode = temp_mode;
}
- if (p_mode != -1 && ((p_mode & current_mode) == 0)) {
- return false;
- }
- return true;
+ return (p_mode == -1 || (p_mode & current_mode) != 0);
}
void VisualShaderEditor::_update_options_menu() {
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h
index 567706b808..e89814df3d 100644
--- a/editor/plugins/visual_shader_editor_plugin.h
+++ b/editor/plugins/visual_shader_editor_plugin.h
@@ -176,12 +176,12 @@ class VisualShaderEditor : public VBoxContainer {
void _input_select_item(Ref<VisualShaderNodeInput> input, String name);
- void _add_input_port(int p_node, int p_port, int p_type, const String &p_name);
+ void _add_input_port(int p_node, int p_port, int p_port_type, const String &p_name);
void _remove_input_port(int p_node, int p_port);
void _change_input_port_type(int p_type, int p_node, int p_port);
void _change_input_port_name(const String &p_text, Object *line_edit, int p_node, int p_port);
- void _add_output_port(int p_node, int p_port, int p_type, const String &p_name);
+ void _add_output_port(int p_node, int p_port, int p_port_type, const String &p_name);
void _remove_output_port(int p_node, int p_port);
void _change_output_port_type(int p_type, int p_node, int p_port);
void _change_output_port_name(const String &p_text, Object *line_edit, int p_node, int p_port);
@@ -204,7 +204,7 @@ class VisualShaderEditor : public VBoxContainer {
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
- bool _is_available(int p_flags);
+ bool _is_available(int p_mode);
void _update_created_node(GraphNode *node);
protected:
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index ee78b240a4..956da92c35 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -166,7 +166,7 @@ void ProjectExportDialog::_update_presets() {
void ProjectExportDialog::_update_export_all() {
- bool can_export = EditorExport::get_singleton()->get_export_preset_count() > 0 ? true : false;
+ bool can_export = EditorExport::get_singleton()->get_export_preset_count() > 0;
for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i);
@@ -986,7 +986,7 @@ void ProjectExportDialog::_export_all_dialog_action(const String &p_str) {
export_all_dialog->hide();
- _export_all(p_str == "release" ? false : true);
+ _export_all(p_str != "release");
}
void ProjectExportDialog::_export_all(bool p_debug) {
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 872f8fcd2c..df0dd8781e 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -808,7 +808,7 @@ void ProjectSettingsEditor::update_plugins() {
void ProjectSettingsEditor::_item_selected(const String &p_path) {
- String selected_path = p_path;
+ const String &selected_path = p_path;
if (selected_path == String())
return;
category->set_text(globals_editor->get_current_section());
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 4fa1bd74fe..82d974cae3 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -917,7 +917,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
}
for (Set<String>::Element *j = valid_inheritors.front(); j; j = j->next()) {
- String t = j->get();
+ const String &t = j->get();
bool is_custom_resource = false;
Ref<Texture> icon;
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index 858b14a733..40343cf908 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -475,17 +475,17 @@ String RenameDialog::_substitute(const String &subject, const Node *node, int co
if (root_node) {
result = result.replace("${ROOT}", root_node->get_name());
}
-
- Node *parent_node = node->get_parent();
- if (parent_node) {
- if (node == root_node) {
- // Can not substitute parent of root.
- result = result.replace("${PARENT}", "");
- } else {
- result = result.replace("${PARENT}", parent_node->get_name());
+ if (node) {
+ Node *parent_node = node->get_parent();
+ if (parent_node) {
+ if (node == root_node) {
+ // Can not substitute parent of root.
+ result = result.replace("${PARENT}", "");
+ } else {
+ result = result.replace("${PARENT}", parent_node->get_name());
+ }
}
}
-
return result;
}
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index d6c8e6b452..ff188a00d3 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -981,11 +981,7 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_d
return true;
}
- if (String(d["type"]) == "nodes") {
- return true;
- }
-
- return false;
+ return String(d["type"]) == "nodes";
}
void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index c4b8999401..fc4ff2ecfc 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -275,15 +275,13 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLE_FAN, a);
mesh->surface_set_material(0, p_material);
- if (true) {
- float md = 0;
- for (int i = 0; i < vs.size(); i++) {
+ float md = 0;
+ for (int i = 0; i < vs.size(); i++) {
- md = MAX(0, vs[i].length());
- }
- if (md) {
- mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
- }
+ md = MAX(0, vs[i].length());
+ }
+ if (md) {
+ mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
}
selectable_icon_size = p_scale;
@@ -432,9 +430,7 @@ bool EditorSpatialGizmo::intersect_frustum(const Camera *p_camera, const Vector<
}
}
- if (!any_out)
- return true;
- return false;
+ return !any_out;
}
if (collision_segments.size()) {
diff --git a/main/input_default.cpp b/main/input_default.cpp
index a939d77a1e..199fcfcf66 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -726,14 +726,14 @@ InputDefault::InputDefault() {
if (entries[i] == "")
continue;
parse_mapping(entries[i]);
- };
- };
+ }
+ }
int i = 0;
while (DefaultControllerMappings::mappings[i]) {
parse_mapping(DefaultControllerMappings::mappings[i++]);
- };
+ }
}
void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
@@ -748,14 +748,14 @@ void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
if (joy.mapping == -1) {
_button_event(p_device, p_button, p_pressed);
return;
- };
+ }
const Map<int, JoyEvent>::Element *el = map_db[joy.mapping].buttons.find(p_button);
if (!el) {
//don't process un-mapped events for now, it could mess things up badly for devices with additional buttons/axis
//return _button_event(p_last_id, p_device, p_button, p_pressed);
return;
- };
+ }
JoyEvent map = el->get();
if (map.type == TYPE_BUTTON) {
@@ -767,14 +767,13 @@ void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) {
}
_button_event(p_device, map.index, p_pressed);
return;
- };
+ }
if (map.type == TYPE_AXIS) {
_axis_event(p_device, map.index, p_pressed ? 1.0 : 0.0);
- };
-
- return; // no event?
-};
+ }
+ // no event?
+}
void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
@@ -878,19 +877,18 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
if (pressed == joy_buttons_pressed.has(_combine_device(map.index, p_device))) {
// button already pressed or released, this is an axis bounce value
return;
- };
+ }
_button_event(p_device, map.index, pressed);
return;
- };
+ }
if (map.type == TYPE_AXIS) {
_axis_event(p_device, map.index, val);
return;
- };
+ }
//printf("invalid mapping\n");
- return;
-};
+}
void InputDefault::joy_hat(int p_device, int p_val) {
@@ -909,20 +907,20 @@ void InputDefault::joy_hat(int p_device, int p_val) {
if ((p_val & HAT_MASK_UP) != (cur_val & HAT_MASK_UP)) {
_button_event(p_device, map[HAT_UP].index, p_val & HAT_MASK_UP);
- };
+ }
if ((p_val & HAT_MASK_RIGHT) != (cur_val & HAT_MASK_RIGHT)) {
_button_event(p_device, map[HAT_RIGHT].index, p_val & HAT_MASK_RIGHT);
- };
+ }
if ((p_val & HAT_MASK_DOWN) != (cur_val & HAT_MASK_DOWN)) {
_button_event(p_device, map[HAT_DOWN].index, p_val & HAT_MASK_DOWN);
- };
+ }
if ((p_val & HAT_MASK_LEFT) != (cur_val & HAT_MASK_LEFT)) {
_button_event(p_device, map[HAT_LEFT].index, p_val & HAT_MASK_LEFT);
- };
+ }
joy_names[p_device].hat_current = p_val;
-};
+}
void InputDefault::_button_event(int p_device, int p_index, bool p_pressed) {
@@ -933,7 +931,7 @@ void InputDefault::_button_event(int p_device, int p_index, bool p_pressed) {
ievent->set_pressed(p_pressed);
parse_input_event(ievent);
-};
+}
void InputDefault::_axis_event(int p_device, int p_axis, float p_value) {
diff --git a/main/main.cpp b/main/main.cpp
index c765ff9700..9183dab58c 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -812,7 +812,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
int sp = bp.find_last(":");
if (sp == -1) {
ERR_EXPLAIN("Invalid breakpoint: '" + bp + "', expected file:line format.");
- ERR_CONTINUE(sp == -1);
+ ERR_CONTINUE(true);
}
script_debugger->insert_breakpoint(bp.substr(sp + 1, bp.length()).to_int(), bp.substr(0, sp));
@@ -1469,7 +1469,7 @@ bool Main::start() {
if (obj)
memdelete(obj);
ERR_EXPLAIN("Can't load script '" + script + "', it does not inherit from a MainLoop type");
- ERR_FAIL_COND_V(!script_loop, false);
+ ERR_FAIL_V(false);
}
script_loop->set_init_script(script_res);
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp
index 87bd640001..e82af93293 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -911,7 +911,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String
if (incr == 0) {
ERR_EXPLAIN("unhandled opcode: " + itos(code[ip]));
- ERR_BREAK(incr == 0);
+ ERR_BREAK(true);
}
ip += incr;
@@ -974,7 +974,7 @@ MainLoop *test(TestType p_type) {
if (tk.get_token() == GDScriptTokenizer::TK_IDENTIFIER)
text = "'" + tk.get_token_identifier() + "' (identifier)";
else if (tk.get_token() == GDScriptTokenizer::TK_CONSTANT) {
- Variant c = tk.get_token_constant();
+ const Variant &c = tk.get_token_constant();
if (c.get_type() == Variant::STRING)
text = "\"" + String(c) + "\"";
else
diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp
index 84f504a78d..6850c4d88a 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -329,7 +329,6 @@ public:
make_grid(5, 5, 2.5, 1, gxf);
test_fall();
quit = false;
- return;
}
virtual bool iteration(float p_time) {
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp
index a107fd738f..05df888f40 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -57,7 +57,7 @@ bool test_2() {
OS::get_singleton()->print("\n\nTest 2: Assign from string (operator=)\n");
String s = "Dolly";
- String t = s;
+ const String &t = s;
OS::get_singleton()->print("\tExpected: Dolly\n");
OS::get_singleton()->print("\tResulted: %ls\n", t.c_str());
@@ -70,7 +70,7 @@ bool test_3() {
OS::get_singleton()->print("\n\nTest 3: Assign from c-string (copycon)\n");
String s("Sheep");
- String t(s);
+ const String &t(s);
OS::get_singleton()->print("\tExpected: Sheep\n");
OS::get_singleton()->print("\tResulted: %ls\n", t.c_str());
@@ -1062,7 +1062,7 @@ bool test_33() {
OS::get_singleton()->print("\n\nTest 33: parse_utf8(null, -1)\n");
String empty;
- return empty.parse_utf8(NULL, -1) == true;
+ return empty.parse_utf8(NULL, -1);
}
bool test_34() {
diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp
index b4530c2df1..a7e8dec11e 100644
--- a/modules/bmp/image_loader_bmp.cpp
+++ b/modules/bmp/image_loader_bmp.cpp
@@ -262,7 +262,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
PoolVector<uint8_t> bmp_color_table;
// Color table is usually 4 bytes per color -> [B][G][R][0]
- err = bmp_color_table.resize(color_table_size * 4);
+ bmp_color_table.resize(color_table_size * 4);
PoolVector<uint8_t>::Write bmp_color_table_w = bmp_color_table.write();
f->get_buffer(bmp_color_table_w.ptr(), color_table_size * 4);
diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h
index 553a7553c6..6c9419b3c2 100644
--- a/modules/csg/csg_shape.h
+++ b/modules/csg/csg_shape.h
@@ -404,7 +404,7 @@ public:
void set_spin_degrees(float p_spin_degrees);
float get_spin_degrees() const;
- void set_spin_sides(int p_sides);
+ void set_spin_sides(int p_spin_sides);
int get_spin_sides() const;
void set_path_node(const NodePath &p_path);
diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
index d3d1e58b7b..187e8d349d 100644
--- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
+++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
@@ -34,7 +34,7 @@
<argument index="4" name="client_port" type="int" default="0">
</argument>
<description>
- Create client that connects to a server at [code]address[/code] using specified [code]port[/code]. The given address needs to be either a fully qualified domain name (e.g. [code]www.example.com[/code]) or an IP address in IPv4 or IPv6 format (e.g. [code]192.168.1.1[/code]). The [code]port[/code] is the port the server is listening on. The [code]in_bandwidth[/code] and [code]out_bandwidth[/code] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [code]OK[/code] if a client was created, [code]ERR_ALREADY_IN_USE[/code] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [code]ERR_CANT_CREATE[/code] if the client could not be created. If [code]client_port[/code] is specified, the client will also listen to the given port, this is useful in some NAT traversal technique.
+ Create client that connects to a server at [code]address[/code] using specified [code]port[/code]. The given address needs to be either a fully qualified domain name (e.g. [code]www.example.com[/code]) or an IP address in IPv4 or IPv6 format (e.g. [code]192.168.1.1[/code]). The [code]port[/code] is the port the server is listening on. The [code]in_bandwidth[/code] and [code]out_bandwidth[/code] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [constant OK] if a client was created, [constant ERR_ALREADY_IN_USE] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [constant ERR_CANT_CREATE] if the client could not be created. If [code]client_port[/code] is specified, the client will also listen to the given port, this is useful in some NAT traversal technique.
</description>
</method>
<method name="create_server">
@@ -49,7 +49,7 @@
<argument index="3" name="out_bandwidth" type="int" default="0">
</argument>
<description>
- Create server that listens to connections via [code]port[/code]. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use [method set_bind_ip]. The default IP is the wildcard [code]*[/code], which listens on all available interfaces. [code]max_clients[/code] is the maximum number of clients that are allowed at once, any number up to 4096 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see [method create_client]. Returns [code]OK[/code] if a server was created, [code]ERR_ALREADY_IN_USE[/code] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [code]ERR_CANT_CREATE[/code] if the server could not be created.
+ Create server that listens to connections via [code]port[/code]. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use [method set_bind_ip]. The default IP is the wildcard [code]*[/code], which listens on all available interfaces. [code]max_clients[/code] is the maximum number of clients that are allowed at once, any number up to 4096 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see [method create_client]. Returns [constant OK] if a server was created, [constant ERR_ALREADY_IN_USE] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [constant ERR_CANT_CREATE] if the server could not be created.
</description>
</method>
<method name="disconnect_peer">
@@ -107,7 +107,7 @@
</methods>
<members>
<member name="always_ordered" type="bool" setter="set_always_ordered" getter="is_always_ordered">
- Always use [code]TRANSFER_MODE_ORDERED[/code] in place of [code]TRANSFER_MODE_UNRELIABLE[/code]. This is the only way to use ordering with the RPC system.
+ Enforce ordered packets when using [constant NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE] (thus behaving similarly to [constant NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE_ORDERED]). This is the only way to use ordering with the RPC system.
</member>
<member name="channel_count" type="int" setter="set_channel_count" getter="get_channel_count">
The number of channels to be used by ENet. Default: [code]3[/code]. Channels are used to separate different kinds of data. In reliable or ordered mode, for example, the packet delivery order is ensured on a per channel basis.
diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h
index 3c457bf5a7..884bcf60d2 100644
--- a/modules/gdnative/include/gdnative/gdnative.h
+++ b/modules/gdnative/include/gdnative/gdnative.h
@@ -67,7 +67,7 @@ extern "C" {
////// Error
typedef enum {
- GODOT_OK,
+ GODOT_OK, // (0)
GODOT_FAILED, ///< Generic fail error
GODOT_ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
GODOT_ERR_UNCONFIGURED, ///< The object being used hasn't been properly set up yet
@@ -97,12 +97,12 @@ typedef enum {
GODOT_ERR_CONNECTION_ERROR,
GODOT_ERR_CANT_ACQUIRE_RESOURCE,
GODOT_ERR_CANT_FORK,
- GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30)
+ GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30)
GODOT_ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
GODOT_ERR_ALREADY_EXISTS, ///< When adding, item already exists
GODOT_ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
GODOT_ERR_DATABASE_CANT_READ, ///< database is full
- GODOT_ERR_DATABASE_CANT_WRITE, ///< database is full (35)
+ GODOT_ERR_DATABASE_CANT_WRITE, ///< database is full (35)
GODOT_ERR_COMPILATION_FAILED,
GODOT_ERR_METHOD_NOT_FOUND,
GODOT_ERR_LINK_FAILED,
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 3fb9268702..95f3c12806 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -69,7 +69,7 @@ Variant GDScriptNativeClass::_new() {
Object *o = instance();
if (!o) {
ERR_EXPLAIN("Class type: '" + String(name) + "' is not instantiable.");
- ERR_FAIL_COND_V(!o, Variant());
+ ERR_FAIL_V(Variant());
}
Reference *ref = Object::cast_to<Reference>(o);
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 189317b163..caffe04700 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -1073,7 +1073,7 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
int set_index;
bool named = false;
- if (static_cast<const GDScriptParser::OperatorNode *>(op)->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
+ if (op->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
set_index = codegen.get_name_map_pos(static_cast<const GDScriptParser::IdentifierNode *>(op->arguments[1])->name);
named = true;
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index ec3e72eef7..85b270b369 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -776,8 +776,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
}
_add_warning(GDScriptWarning::UNASSIGNED_VARIABLE_OP_ASSIGN, -1, identifier.operator String());
}
- FALLTHROUGH;
- }
+ } break;
case GDScriptTokenizer::TK_OP_ASSIGN: {
lv->assignments += 1;
lv->usages--; // Assignment is not really usage
@@ -1150,7 +1149,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
if (!expr) {
ERR_EXPLAIN("GDScriptParser bug, couldn't figure out what expression is...");
- ERR_FAIL_COND_V(!expr, NULL);
+ ERR_FAIL_V(NULL);
}
/******************/
@@ -1493,7 +1492,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
if (next_op == -1) {
_set_error("Yet another parser bug....");
- ERR_FAIL_COND_V(next_op == -1, NULL);
+ ERR_FAIL_V(NULL);
}
// OK! create operator..
@@ -5944,11 +5943,8 @@ bool GDScriptParser::_is_type_compatible(const DataType &p_container, const Data
if (p_container.kind == DataType::BUILTIN && p_container.builtin_type == Variant::OBJECT) {
// Object built-in is a special case, it's compatible with any object and with null
- if (p_expression.kind == DataType::BUILTIN && p_expression.builtin_type == Variant::NIL) {
- return true;
- }
if (p_expression.kind == DataType::BUILTIN) {
- return false;
+ return p_expression.builtin_type == Variant::NIL;
}
// If it's not a built-in, must be an object
return true;
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index a93d1ceebb..95715ab648 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -1189,7 +1189,7 @@ Error GDScriptTokenizerBuffer::set_code_buffer(const Vector<uint8_t> &p_buffer)
int version = decode_uint32(&buf[4]);
if (version > BYTECODE_VERSION) {
ERR_EXPLAIN("Bytecode is too New! Please use a newer engine version.");
- ERR_FAIL_COND_V(version > BYTECODE_VERSION, ERR_INVALID_DATA);
+ ERR_FAIL_V(ERR_INVALID_DATA);
}
int identifier_count = decode_uint32(&buf[8]);
int constant_count = decode_uint32(&buf[12]);
@@ -1303,7 +1303,7 @@ Vector<uint8_t> GDScriptTokenizerBuffer::parse_code_string(const String &p_code)
} break;
case TK_CONSTANT: {
- Variant c = tt.get_token_constant();
+ const Variant &c = tt.get_token_constant();
if (!constant_map.has(c)) {
int idx = constant_map.size();
constant_map[c] = idx;
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 72199281ff..20b227bda1 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -2898,10 +2898,7 @@ void CSharpScript::update_exports() {
}
bool CSharpScript::has_script_signal(const StringName &p_signal) const {
- if (_signals.has(p_signal))
- return true;
-
- return false;
+ return _signals.has(p_signal);
}
void CSharpScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 64e3b40063..a2f1ec8f27 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -337,7 +337,7 @@ public:
_FORCE_INLINE_ static CSharpLanguage *get_singleton() { return singleton; }
static void release_script_gchandle(Ref<MonoGCHandle> &p_gchandle);
- static void release_script_gchandle(MonoObject *p_pinned_expected_obj, Ref<MonoGCHandle> &p_gchandle);
+ static void release_script_gchandle(MonoObject *p_expected_obj, Ref<MonoGCHandle> &p_gchandle);
bool debug_break(const String &p_error, bool p_allow_continue = true);
bool debug_break_parse(const String &p_file, int p_line, const String &p_error);
diff --git a/modules/mono/editor/csharp_project.h b/modules/mono/editor/csharp_project.h
index 3d5a65f8da..b08c9090c7 100644
--- a/modules/mono/editor/csharp_project.h
+++ b/modules/mono/editor/csharp_project.h
@@ -36,7 +36,7 @@
namespace CSharpProject {
String generate_core_api_project(const String &p_dir, const Vector<String> &p_files = Vector<String>());
-String generate_editor_api_project(const String &p_dir, const String &p_core_dll_path, const Vector<String> &p_files = Vector<String>());
+String generate_editor_api_project(const String &p_dir, const String &p_core_proj_path, const Vector<String> &p_files = Vector<String>());
String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>());
void add_item(const String &p_project_path, const String &p_item_type, const String &p_include);
diff --git a/modules/mono/editor/godotsharp_editor.h b/modules/mono/editor/godotsharp_editor.h
index 4a28492bad..d5bd8ba126 100644
--- a/modules/mono/editor/godotsharp_editor.h
+++ b/modules/mono/editor/godotsharp_editor.h
@@ -35,7 +35,7 @@
#include "monodevelop_instance.h"
class GodotSharpEditor : public Node {
- GDCLASS(GodotSharpEditor, Object);
+ GDCLASS(GodotSharpEditor, Node);
EditorNode *editor;
diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp
index 63bcfe053c..cb28efb4e5 100644
--- a/modules/mono/mono_gd/gd_mono_internals.cpp
+++ b/modules/mono/mono_gd/gd_mono_internals.cpp
@@ -105,8 +105,6 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
ScriptInstance *si = CSharpInstance::create_for_managed_type(unmanaged, script.ptr(), gchandle);
unmanaged->set_script_and_instance(script.get_ref_ptr(), si);
-
- return;
}
void unhandled_exception(MonoException *p_exc) {
diff --git a/modules/mono/utils/thread_local.h b/modules/mono/utils/thread_local.h
index 488cc2619a..e52b6e73ef 100644
--- a/modules/mono/utils/thread_local.h
+++ b/modules/mono/utils/thread_local.h
@@ -76,7 +76,7 @@ struct ThreadLocalStorage {
void *get_value() const;
void set_value(void *p_value) const;
- void alloc(void(_CALLBACK_FUNC_ *p_dest_callback)(void *));
+ void alloc(void(_CALLBACK_FUNC_ *p_destr_callback)(void *));
void free();
private:
diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h
index 445bf974b8..5e4a02fcee 100644
--- a/modules/opensimplex/noise_texture.h
+++ b/modules/opensimplex/noise_texture.h
@@ -77,12 +77,12 @@ public:
Ref<OpenSimplexNoise> get_noise();
void set_width(int p_width);
- void set_height(int p_hieght);
+ void set_height(int p_height);
void set_seamless(bool p_seamless);
bool get_seamless();
- void set_as_normalmap(bool p_seamless);
+ void set_as_normalmap(bool p_as_normalmap);
bool is_normalmap();
void set_bump_strength(float p_bump_strength);
diff --git a/modules/upnp/doc_classes/UPNP.xml b/modules/upnp/doc_classes/UPNP.xml
index 0516ea9d54..6530fd614e 100644
--- a/modules/upnp/doc_classes/UPNP.xml
+++ b/modules/upnp/doc_classes/UPNP.xml
@@ -171,7 +171,7 @@
No port maps are available. May also be returned if port mapping functionality is not available.
</constant>
<constant name="UPNP_RESULT_CONFLICT_WITH_OTHER_MECHANISM" value="12" enum="UPNPResult">
- Conflict with other mechanism. May be returned instead of [code]UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING[/code] if a port mapping conflicts with an existing one.
+ Conflict with other mechanism. May be returned instead of [constant UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING] if a port mapping conflicts with an existing one.
</constant>
<constant name="UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING" value="13" enum="UPNPResult">
Conflict with an existing port mapping.
diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
index 21e8a38c16..b88d2890e1 100644
--- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
+++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml
@@ -194,26 +194,26 @@
Serialize a [Variant] to a string.
</constant>
<constant name="STR_TO_VAR" value="60" enum="BuiltinFunc">
- Deserialize a [Variant] from a string serialized using [code]VAR_TO_STR[/code].
+ Deserialize a [Variant] from a string serialized using [constant VAR_TO_STR].
</constant>
<constant name="VAR_TO_BYTES" value="61" enum="BuiltinFunc">
Serialize a [Variant] to a [PoolByteArray].
</constant>
<constant name="BYTES_TO_VAR" value="62" enum="BuiltinFunc">
- Deserialize a [Variant] from a [PoolByteArray] serialized using [code]VAR_TO_BYTES[/code].
+ Deserialize a [Variant] from a [PoolByteArray] serialized using [constant VAR_TO_BYTES].
</constant>
<constant name="COLORN" value="63" enum="BuiltinFunc">
Return the [Color] with the given name and alpha ranging from 0 to 1. Note: names are defined in color_names.inc.
</constant>
<constant name="MATH_SMOOTHSTEP" value="64" enum="BuiltinFunc">
- Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to [code]MATH_LERP[/code], but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula:
+ Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to [constant MATH_LERP], but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula:
[codeblock]
var t = clamp((weight - from) / (to - from), 0.0, 1.0)
return t * t * (3.0 - 2.0 * t)
[/codeblock]
</constant>
<constant name="FUNC_MAX" value="65" enum="BuiltinFunc">
- The maximum value the [member function] property can have.
+ Represents the size of the [enum BuiltinFunc] enum.
</constant>
</constants>
</class>
diff --git a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
index 6e48e7c416..7d83cd0203 100644
--- a/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
+++ b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml
@@ -4,7 +4,7 @@
Gets a constant from a given class.
</brief_description>
<description>
- This node returns a constant from a given class, such as [constant @GlobalScope.TYPE_INT]. See the given class' documentation for available constants.
+ This node returns a constant from a given class, such as [constant TYPE_INT]. See the given class' documentation for available constants.
[b]Input Ports:[/b]
none
[b]Output Ports:[/b]
diff --git a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
index 1ab9f807fb..cd3a663e81 100644
--- a/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
+++ b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml
@@ -125,7 +125,7 @@
Execute the custom node's logic, returning the index of the output sequence port to use or a [String] when there is an error.
The [code]inputs[/code] array contains the values of the input ports.
[code]outputs[/code] is an array whose indices should be set to the respective outputs.
- The [code]start_mode[/code] is usually [code]START_MODE_BEGIN_SEQUENCE[/code], unless you have used the STEP_* constants.
+ The [code]start_mode[/code] is usually [constant START_MODE_BEGIN_SEQUENCE], unless you have used the STEP_* constants.
[code]working_mem[/code] is an array which can be used to persist information between runs of the custom node.
When returning, you can mask the returned value with one of the STEP_* constants.
</description>
diff --git a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml
index 430f9ee7d4..fb4e423f0e 100644
--- a/modules/visual_script/doc_classes/VisualScriptMathConstant.xml
+++ b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml
@@ -45,6 +45,7 @@
Not a number: [code]nan[/code]
</constant>
<constant name="MATH_CONSTANT_MAX" value="8" enum="MathConstant">
+ Represents the size of the [enum MathConstant] enum.
</constant>
</constants>
</class>
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp
index 772092fabe..4b74c088e0 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -1130,7 +1130,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
if (next_op == -1) {
_set_error("Yet another parser bug....");
- ERR_FAIL_COND_V(next_op == -1, NULL);
+ ERR_FAIL_V(NULL);
}
// OK! create operator..
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 8fa7d2c0d4..f8cb6cfa3c 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -51,10 +51,7 @@ int VisualScriptFunctionCall::get_output_sequence_port_count() const {
bool VisualScriptFunctionCall::has_input_sequence_port() const {
- if ((method_cache.flags & METHOD_FLAG_CONST && call_mode != CALL_MODE_INSTANCE) || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function)))
- return false;
- else
- return true;
+ return !((method_cache.flags & METHOD_FLAG_CONST && call_mode != CALL_MODE_INSTANCE) || (call_mode == CALL_MODE_BASIC_TYPE && Variant::is_method_const(basic_type, function)));
}
#ifdef TOOLS_ENABLED
@@ -949,7 +946,7 @@ int VisualScriptPropertySet::get_output_sequence_port_count() const {
bool VisualScriptPropertySet::has_input_sequence_port() const {
- return call_mode != CALL_MODE_BASIC_TYPE ? true : false;
+ return call_mode != CALL_MODE_BASIC_TYPE;
}
Node *VisualScriptPropertySet::_get_base_node() const {
diff --git a/modules/webrtc/doc_classes/WebRTCDataChannel.xml b/modules/webrtc/doc_classes/WebRTCDataChannel.xml
index 7cce97244d..6d600f6239 100644
--- a/modules/webrtc/doc_classes/WebRTCDataChannel.xml
+++ b/modules/webrtc/doc_classes/WebRTCDataChannel.xml
@@ -56,7 +56,7 @@
<return type="int" enum="WebRTCDataChannel.ChannelState">
</return>
<description>
- Returns the current state of this channel, see [enum WebRTCDataChannel.ChannelState].
+ Returns the current state of this channel, see [enum ChannelState].
</description>
</method>
<method name="is_negotiated" qualifiers="const">
diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
index ae709877f4..4c2938d0db 100644
--- a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
+++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml
@@ -7,7 +7,7 @@
A WebRTC connection between the local computer and a remote peer. Provides an interface to connect, maintain and monitor the connection.
Setting up a WebRTC connection between two peers from now on) may not seem a trivial task, but it can be broken down into 3 main steps:
- The peer that wants to initiate the connection ([code]A[/code] from now on) creates an offer and send it to the other peer ([code]B[/code] from now on).
- - [code]B[/code] receives the offer, generate and answer, and sends it to [code]B[/code]).
+ - [code]B[/code] receives the offer, generate and answer, and sends it to [code]A[/code]).
- [code]A[/code] and [code]B[/code] then generates and exchange ICE candidates with each other.
After these steps, the connection should become connected. Keep on reading or look into the tutorial for more information.
</description>
@@ -68,7 +68,7 @@
</return>
<description>
Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one [WebRTCDataChannel] must have been created before calling this method.
- If this functions returns [code]OK[/code], [signal session_description_created] will be called when the session is ready to be sent.
+ If this functions returns [constant OK], [signal session_description_created] will be called when the session is ready to be sent.
</description>
</method>
<method name="get_connection_state" qualifiers="const">
diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml
index 51945d410a..5c4647b1ce 100644
--- a/modules/websocket/doc_classes/WebSocketServer.xml
+++ b/modules/websocket/doc_classes/WebSocketServer.xml
@@ -71,7 +71,7 @@
Start listening on the given port.
You can specify the desired subprotocols via the "protocols" array. If the list empty (default), "binary" will be used.
If [code]true[/code] is passed as [code]gd_mp_api[/code], the server will behave like a network peer for the [MultiplayerAPI], connections from non Godot clients will not work, and [signal data_received] will not be emitted.
- If [code]false[/code] is passed instead (default), you must call [PacketPeer] functions ([code]put_packet[/code], [code]get_packet[/code], etc.), on the [WebSocketPeer] returned via [code]get_peer(ID)[/code] to communicate with the peer with given [code]ID[/code] (e.g. [code]get_peer(ID).get_available_packet_count[/code]).
+ If [code]false[/code] is passed instead (default), you must call [PacketPeer] functions ([code]put_packet[/code], [code]get_packet[/code], etc.), on the [WebSocketPeer] returned via [code]get_peer(id)[/code] to communicate with the peer with given [code]id[/code] (e.g. [code]get_peer(id).get_available_packet_count[/code]).
</description>
</method>
<method name="stop">
diff --git a/modules/websocket/websocket_multiplayer_peer.h b/modules/websocket/websocket_multiplayer_peer.h
index 089bc25fe9..7fd97a6595 100644
--- a/modules/websocket/websocket_multiplayer_peer.h
+++ b/modules/websocket/websocket_multiplayer_peer.h
@@ -82,7 +82,7 @@ public:
/* NetworkedMultiplayerPeer */
void set_transfer_mode(TransferMode p_mode);
TransferMode get_transfer_mode() const;
- void set_target_peer(int p_peer_id);
+ void set_target_peer(int p_target_peer);
int get_packet_peer() const;
int get_unique_id() const;
virtual bool is_server() const = 0;
diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp
index 21c3b0ac91..e6328ee14d 100644
--- a/platform/x11/joypad_linux.cpp
+++ b/platform/x11/joypad_linux.cpp
@@ -101,7 +101,6 @@ void JoypadLinux::joy_thread_func(void *p_user) {
JoypadLinux *joy = (JoypadLinux *)p_user;
joy->run_joypad_thread();
}
- return;
}
void JoypadLinux::run_joypad_thread() {
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 6421dc270f..bf6bc0b464 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -146,7 +146,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
if (is_stdout_verbose()) {
WARN_PRINT("IME is disabled");
}
- modifiers = XSetLocaleModifiers("@im=none");
+ XSetLocaleModifiers("@im=none");
WARN_PRINT("Error setting locale modifiers");
}
@@ -1032,9 +1032,7 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) {
}
XSetWMNormalHints(x11_display, x11_window, xsh);
XFree(xsh);
- }
- if (!p_enabled) {
// put back or remove decorations according to the last set borderless state
Hints hints;
Atom property;
@@ -1201,7 +1199,7 @@ Point2 OS_X11::get_window_position() const {
void OS_X11::set_window_position(const Point2 &p_position) {
int x = 0;
int y = 0;
- if (get_borderless_window() == false) {
+ if (!get_borderless_window()) {
//exclude window decorations
XSync(x11_display, False);
Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
@@ -3051,8 +3049,6 @@ void OS_X11::alert(const String &p_alert, const String &p_title) {
} else {
print_line(p_alert);
}
-
- return;
}
bool g_set_icon_error = false;
diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp
index 50da6a4967..758bd84114 100644
--- a/platform/x11/power_x11.cpp
+++ b/platform/x11/power_x11.cpp
@@ -202,7 +202,10 @@ void PowerX11::check_proc_acpi_battery(const char *node, bool *have_battery, boo
* We pick the battery that claims to have the most minutes left.
* (failing a report of minutes, we'll take the highest percent.)
*/
- if ((secs < 0) && (this->nsecs_left < 0)) {
+ // -- GODOT start --
+ //if ((secs < 0) && (this->nsecs_left < 0)) {
+ if (this->nsecs_left < 0) {
+ // -- GODOT end --
if ((pct < 0) && (this->percent_left < 0)) {
choose = true; /* at least we know there's a battery. */
}
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index 5bf70e12b7..b7ace804ef 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -69,10 +69,7 @@ bool AnimatedSprite::_edit_use_rect() const {
Ref<Texture> t;
if (animation)
t = frames->get_frame(animation, frame);
- if (t.is_null())
- return false;
-
- return true;
+ return t.is_valid();
}
Rect2 AnimatedSprite::get_anchorable_rect() const {
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 73f583111b..932af469d0 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -457,8 +457,8 @@ void AudioStreamPlayer2D::set_stream_paused(bool p_pause) {
if (p_pause != stream_paused) {
stream_paused = p_pause;
- stream_paused_fade_in = p_pause ? false : true;
- stream_paused_fade_out = p_pause ? true : false;
+ stream_paused_fade_in = !p_pause;
+ stream_paused_fade_out = p_pause;
}
}
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 1f585d84ce..2604eb04e4 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -143,7 +143,7 @@ public:
void set_particles_anim_v_frames(int p_frames);
int get_particles_anim_v_frames() const;
- void set_particles_anim_loop(bool p_frames);
+ void set_particles_anim_loop(bool p_loop);
bool get_particles_anim_loop() const;
static void init_shaders();
diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h
index 6c83abb311..813f5ddc6e 100644
--- a/scene/2d/cpu_particles_2d.h
+++ b/scene/2d/cpu_particles_2d.h
@@ -252,7 +252,7 @@ public:
void set_color(const Color &p_color);
Color get_color() const;
- void set_color_ramp(const Ref<Gradient> &p_texture);
+ void set_color_ramp(const Ref<Gradient> &p_ramp);
Ref<Gradient> get_color_ramp() const;
void set_particle_flag(Flags p_flag, bool p_enable);
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index 5ba184b324..4488dc501c 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -38,8 +38,7 @@ VARIANT_ENUM_CAST(Line2D::LineJointMode)
VARIANT_ENUM_CAST(Line2D::LineCapMode)
VARIANT_ENUM_CAST(Line2D::LineTextureMode)
-Line2D::Line2D() :
- Node2D() {
+Line2D::Line2D() {
_joint_mode = LINE_JOINT_SHARP;
_begin_cap_mode = LINE_CAP_NONE;
_end_cap_mode = LINE_CAP_NONE;
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index 89dd1e5341..66e5ce250f 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -157,8 +157,8 @@ private:
bool operator<(const ShapePair &p_sp) const {
if (body_shape == p_sp.body_shape)
return local_shape < p_sp.local_shape;
- else
- return body_shape < p_sp.body_shape;
+
+ return body_shape < p_sp.body_shape;
}
ShapePair() {}
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index a8c7622828..6626fccf1c 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -63,10 +63,7 @@ Rect2 Sprite::_edit_get_rect() const {
}
bool Sprite::_edit_use_rect() const {
- if (texture.is_null())
- return false;
-
- return true;
+ return texture.is_valid();
}
Rect2 Sprite::get_anchorable_rect() const {
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index ff8c218575..ff28f60d4f 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -93,7 +93,7 @@ void AudioStreamPlayer3D::_mix_audio() {
}
bool interpolate_filter = !started;
- ;
+
if (!found) {
//create new if was not used before
if (prev_output_count < MAX_OUTPUTS) {
@@ -872,8 +872,8 @@ void AudioStreamPlayer3D::set_stream_paused(bool p_pause) {
if (p_pause != stream_paused) {
stream_paused = p_pause;
- stream_paused_fade_in = stream_paused ? false : true;
- stream_paused_fade_out = stream_paused ? true : false;
+ stream_paused_fade_in = !stream_paused;
+ stream_paused_fade_out = stream_paused;
}
}
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index c0a4f77435..6460f17e85 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -113,7 +113,7 @@ public:
void set_perspective(float p_fovy_degrees, float p_z_near, float p_z_far);
void set_orthogonal(float p_size, float p_z_near, float p_z_far);
- void set_frustum(float p_size, Vector2 p_offset, float p_near, float p_far);
+ void set_frustum(float p_size, Vector2 p_offset, float p_z_near, float p_z_far);
void set_projection(Camera::Projection p_mode);
void make_current();
diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h
index 6f267102fa..6566792def 100644
--- a/scene/3d/cpu_particles.h
+++ b/scene/3d/cpu_particles.h
@@ -249,7 +249,7 @@ public:
void set_color(const Color &p_color);
Color get_color() const;
- void set_color_ramp(const Ref<Gradient> &p_texture);
+ void set_color_ramp(const Ref<Gradient> &p_ramp);
Ref<Gradient> get_color_ramp() const;
void set_particle_flag(Flags p_flag, bool p_enable);
diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp
index 909d4fda34..a9d96292a1 100644
--- a/scene/3d/soft_body.cpp
+++ b/scene/3d/soft_body.cpp
@@ -699,7 +699,6 @@ bool SoftBody::is_ray_pickable() const {
}
SoftBody::SoftBody() :
- MeshInstance(),
physics_rid(PhysicsServer::get_singleton()->soft_body_create()),
mesh_owner(false),
collision_mask(1),
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index 55bb7eabd9..89e96e0227 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -723,7 +723,7 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) {
real_t rollingFriction = 0.f;
if (wheelInfo.m_raycastInfo.m_isInContact) {
- if (engine_force != 0.f && wheelInfo.engine_traction != false) {
+ if (engine_force != 0.f && wheelInfo.engine_traction) {
rollingFriction = -engine_force * s->get_step();
} else {
real_t defaultRollingFrictionImpulse = 0.f;
@@ -928,8 +928,7 @@ void VehicleBody::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "steering", PROPERTY_HINT_RANGE, "-180,180.0,0.01"), "set_steering", "get_steering");
}
-VehicleBody::VehicleBody() :
- RigidBody() {
+VehicleBody::VehicleBody() {
m_pitchControl = 0;
m_currentVehicleSpeedKmHour = real_t(0.);
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 99c86f0406..4bb4d18071 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -326,6 +326,7 @@ void GeometryInstance::_bind_methods() {
BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_SHADOWS_ONLY);
BIND_ENUM_CONSTANT(FLAG_USE_BAKED_LIGHT);
+ BIND_ENUM_CONSTANT(FLAG_DRAW_NEXT_FRAME_IF_VISIBLE);
BIND_ENUM_CONSTANT(FLAG_MAX);
}
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 75b419ca58..5fa8c43f9f 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -212,9 +212,7 @@ static bool fast_tri_box_overlap(const Vector3 &boxcenter, const Vector3 boxhalf
/* compute plane equation of triangle: normal*x+d=0 */
normal = e0.cross(e1);
d = -normal.dot(v0); /* plane eq: normal.x+d=0 */
- if (!planeBoxOverlap(normal, d, boxhalfsize)) return false;
-
- return true; /* box and triangle overlaps */
+ return planeBoxOverlap(normal, d, boxhalfsize); /* if true, box and triangle overlaps */
}
static _FORCE_INLINE_ void get_uv_and_normal(const Vector3 &p_pos, const Vector3 *p_vtx, const Vector2 *p_uv, const Vector3 *p_normal, Vector2 &r_uv, Vector3 &r_normal) {
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index a2411743d4..f1ce948c43 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -178,11 +178,11 @@ float AnimationNodeStateMachinePlayback::get_current_length() const {
return len_current;
}
-bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *sm, const StringName &p_travel) {
+bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *p_state_machine, const StringName &p_travel) {
ERR_FAIL_COND_V(!playing, false);
- ERR_FAIL_COND_V(!sm->states.has(p_travel), false);
- ERR_FAIL_COND_V(!sm->states.has(current), false);
+ ERR_FAIL_COND_V(!p_state_machine->states.has(p_travel), false);
+ ERR_FAIL_COND_V(!p_state_machine->states.has(current), false);
path.clear(); //a new one will be needed
@@ -191,25 +191,25 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *sm, c
loops_current = 0; // reset loops, so fade does not happen immediately
- Vector2 current_pos = sm->states[current].position;
- Vector2 target_pos = sm->states[p_travel].position;
+ Vector2 current_pos = p_state_machine->states[current].position;
+ Vector2 target_pos = p_state_machine->states[p_travel].position;
Map<StringName, AStarCost> cost_map;
List<int> open_list;
//build open list
- for (int i = 0; i < sm->transitions.size(); i++) {
- if (sm->transitions[i].from == current) {
+ for (int i = 0; i < p_state_machine->transitions.size(); i++) {
+ if (p_state_machine->transitions[i].from == current) {
open_list.push_back(i);
- float cost = sm->states[sm->transitions[i].to].position.distance_to(current_pos);
- cost *= sm->transitions[i].transition->get_priority();
+ float cost = p_state_machine->states[p_state_machine->transitions[i].to].position.distance_to(current_pos);
+ cost *= p_state_machine->transitions[i].transition->get_priority();
AStarCost ap;
ap.prev = current;
ap.distance = cost;
- cost_map[sm->transitions[i].to] = ap;
+ cost_map[p_state_machine->transitions[i].to] = ap;
- if (sm->transitions[i].to == p_travel) { //prematurely found it! :D
+ if (p_state_machine->transitions[i].to == p_travel) { //prematurely found it! :D
path.push_back(p_travel);
return true;
}
@@ -230,42 +230,42 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *sm, c
for (List<int>::Element *E = open_list.front(); E; E = E->next()) {
- float cost = cost_map[sm->transitions[E->get()].to].distance;
- cost += sm->states[sm->transitions[E->get()].to].position.distance_to(target_pos);
+ float cost = cost_map[p_state_machine->transitions[E->get()].to].distance;
+ cost += p_state_machine->states[p_state_machine->transitions[E->get()].to].position.distance_to(target_pos);
if (cost < least_cost) {
least_cost_transition = E;
}
}
- StringName transition_prev = sm->transitions[least_cost_transition->get()].from;
- StringName transition = sm->transitions[least_cost_transition->get()].to;
+ StringName transition_prev = p_state_machine->transitions[least_cost_transition->get()].from;
+ StringName transition = p_state_machine->transitions[least_cost_transition->get()].to;
- for (int i = 0; i < sm->transitions.size(); i++) {
- if (sm->transitions[i].from != transition || sm->transitions[i].to == transition_prev) {
+ for (int i = 0; i < p_state_machine->transitions.size(); i++) {
+ if (p_state_machine->transitions[i].from != transition || p_state_machine->transitions[i].to == transition_prev) {
continue; //not interested on those
}
- float distance = sm->states[sm->transitions[i].from].position.distance_to(sm->states[sm->transitions[i].to].position);
- distance *= sm->transitions[i].transition->get_priority();
- distance += cost_map[sm->transitions[i].from].distance;
+ float distance = p_state_machine->states[p_state_machine->transitions[i].from].position.distance_to(p_state_machine->states[p_state_machine->transitions[i].to].position);
+ distance *= p_state_machine->transitions[i].transition->get_priority();
+ distance += cost_map[p_state_machine->transitions[i].from].distance;
- if (cost_map.has(sm->transitions[i].to)) {
+ if (cost_map.has(p_state_machine->transitions[i].to)) {
//oh this was visited already, can we win the cost?
- if (distance < cost_map[sm->transitions[i].to].distance) {
- cost_map[sm->transitions[i].to].distance = distance;
- cost_map[sm->transitions[i].to].prev = sm->transitions[i].from;
+ if (distance < cost_map[p_state_machine->transitions[i].to].distance) {
+ cost_map[p_state_machine->transitions[i].to].distance = distance;
+ cost_map[p_state_machine->transitions[i].to].prev = p_state_machine->transitions[i].from;
}
} else {
//add to open list
AStarCost ac;
- ac.prev = sm->transitions[i].from;
+ ac.prev = p_state_machine->transitions[i].from;
ac.distance = distance;
- cost_map[sm->transitions[i].to] = ac;
+ cost_map[p_state_machine->transitions[i].to] = ac;
open_list.push_back(i);
- if (sm->transitions[i].to == p_travel) {
+ if (p_state_machine->transitions[i].to == p_travel) {
found_route = true;
break;
}
@@ -291,12 +291,12 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *sm, c
return true;
}
-float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm, float p_time, bool p_seek) {
+float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_state_machine, float p_time, bool p_seek) {
//if not playing and it can restart, then restart
if (!playing && start_request == StringName()) {
- if (!stop_request && sm->start_node) {
- start(sm->start_node);
+ if (!stop_request && p_state_machine->start_node) {
+ start(p_state_machine->start_node);
} else {
return 0;
}
@@ -320,7 +320,7 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
ERR_FAIL_V(0);
}
- if (!_travel(sm, start_request)) {
+ if (!_travel(p_state_machine, start_request)) {
//can't travel, then teleport
path.clear();
current = start_request;
@@ -339,16 +339,16 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
if (do_start) {
- if (sm->start_node != StringName() && p_seek && p_time == 0) {
- current = sm->start_node;
+ if (p_state_machine->start_node != StringName() && p_seek && p_time == 0) {
+ current = p_state_machine->start_node;
}
- len_current = sm->blend_node(current, sm->states[current].node, 0, true, 1.0, AnimationNode::FILTER_IGNORE, false);
+ len_current = p_state_machine->blend_node(current, p_state_machine->states[current].node, 0, true, 1.0, AnimationNode::FILTER_IGNORE, false);
pos_current = 0;
loops_current = 0;
}
- if (!sm->states.has(current)) {
+ if (!p_state_machine->states.has(current)) {
playing = false; //current does not exist
current = StringName();
return 0;
@@ -357,7 +357,7 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
if (fading_from != StringName()) {
- if (!sm->states.has(fading_from)) {
+ if (!p_state_machine->states.has(fading_from)) {
fading_from = StringName();
} else {
if (!p_seek) {
@@ -370,11 +370,11 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
}
}
- float rem = sm->blend_node(current, sm->states[current].node, p_time, p_seek, fade_blend, AnimationNode::FILTER_IGNORE, false);
+ float rem = p_state_machine->blend_node(current, p_state_machine->states[current].node, p_time, p_seek, fade_blend, AnimationNode::FILTER_IGNORE, false);
if (fading_from != StringName()) {
- sm->blend_node(fading_from, sm->states[fading_from].node, p_time, p_seek, 1.0 - fade_blend, AnimationNode::FILTER_IGNORE, false);
+ p_state_machine->blend_node(fading_from, p_state_machine->states[fading_from].node, p_time, p_seek, 1.0 - fade_blend, AnimationNode::FILTER_IGNORE, false);
}
//guess playback position
@@ -399,40 +399,40 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
if (path.size()) {
- for (int i = 0; i < sm->transitions.size(); i++) {
- if (sm->transitions[i].from == current && sm->transitions[i].to == path[0]) {
- next_xfade = sm->transitions[i].transition->get_xfade_time();
- switch_mode = sm->transitions[i].transition->get_switch_mode();
+ for (int i = 0; i < p_state_machine->transitions.size(); i++) {
+ if (p_state_machine->transitions[i].from == current && p_state_machine->transitions[i].to == path[0]) {
+ next_xfade = p_state_machine->transitions[i].transition->get_xfade_time();
+ switch_mode = p_state_machine->transitions[i].transition->get_switch_mode();
next = path[0];
}
}
} else {
float priority_best = 1e20;
int auto_advance_to = -1;
- for (int i = 0; i < sm->transitions.size(); i++) {
+ for (int i = 0; i < p_state_machine->transitions.size(); i++) {
bool auto_advance = false;
- if (sm->transitions[i].transition->has_auto_advance()) {
+ if (p_state_machine->transitions[i].transition->has_auto_advance()) {
auto_advance = true;
}
- StringName advance_condition_name = sm->transitions[i].transition->get_advance_condition_name();
- if (advance_condition_name != StringName() && bool(sm->get_parameter(advance_condition_name))) {
+ StringName advance_condition_name = p_state_machine->transitions[i].transition->get_advance_condition_name();
+ if (advance_condition_name != StringName() && bool(p_state_machine->get_parameter(advance_condition_name))) {
auto_advance = true;
}
- if (sm->transitions[i].from == current && auto_advance) {
+ if (p_state_machine->transitions[i].from == current && auto_advance) {
- if (sm->transitions[i].transition->get_priority() <= priority_best) {
- priority_best = sm->transitions[i].transition->get_priority();
+ if (p_state_machine->transitions[i].transition->get_priority() <= priority_best) {
+ priority_best = p_state_machine->transitions[i].transition->get_priority();
auto_advance_to = i;
}
}
}
if (auto_advance_to != -1) {
- next = sm->transitions[auto_advance_to].to;
- next_xfade = sm->transitions[auto_advance_to].transition->get_xfade_time();
- switch_mode = sm->transitions[auto_advance_to].transition->get_switch_mode();
+ next = p_state_machine->transitions[auto_advance_to].to;
+ next_xfade = p_state_machine->transitions[auto_advance_to].transition->get_xfade_time();
+ switch_mode = p_state_machine->transitions[auto_advance_to].transition->get_switch_mode();
}
}
@@ -467,12 +467,12 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
}
current = next;
if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_SYNC) {
- len_current = sm->blend_node(current, sm->states[current].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
+ len_current = p_state_machine->blend_node(current, p_state_machine->states[current].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
pos_current = MIN(pos_current, len_current);
- sm->blend_node(current, sm->states[current].node, pos_current, true, 0, AnimationNode::FILTER_IGNORE, false);
+ p_state_machine->blend_node(current, p_state_machine->states[current].node, pos_current, true, 0, AnimationNode::FILTER_IGNORE, false);
} else {
- len_current = sm->blend_node(current, sm->states[current].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
+ len_current = p_state_machine->blend_node(current, p_state_machine->states[current].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
pos_current = 0;
}
@@ -482,9 +482,9 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm,
}
//compute time left for transitions by using the end node
- if (sm->end_node != StringName() && sm->end_node != current) {
+ if (p_state_machine->end_node != StringName() && p_state_machine->end_node != current) {
- rem = sm->blend_node(sm->end_node, sm->states[sm->end_node].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
+ rem = p_state_machine->blend_node(p_state_machine->end_node, p_state_machine->states[p_state_machine->end_node].node, 0, true, 0, AnimationNode::FILTER_IGNORE, false);
}
return rem;
diff --git a/scene/animation/root_motion_view.h b/scene/animation/root_motion_view.h
index 07f51165a7..b30b06229e 100644
--- a/scene/animation/root_motion_view.h
+++ b/scene/animation/root_motion_view.h
@@ -56,7 +56,7 @@ public:
void set_animation_path(const NodePath &p_path);
NodePath get_animation_path() const;
- void set_color(const Color &p_path);
+ void set_color(const Color &p_color);
Color get_color() const;
void set_cell_size(float p_size);
diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp
index 06d6806f03..43c4b2aa51 100644
--- a/scene/animation/skeleton_ik.cpp
+++ b/scene/animation/skeleton_ik.cpp
@@ -423,7 +423,6 @@ void SkeletonIK::_notification(int p_what) {
}
SkeletonIK::SkeletonIK() :
- Node(),
interpolation(1),
override_tip_basis(true),
use_magnet(false),
diff --git a/scene/animation/skeleton_ik.h b/scene/animation/skeleton_ik.h
index 5d48b7be33..d2c5f56ace 100644
--- a/scene/animation/skeleton_ik.h
+++ b/scene/animation/skeleton_ik.h
@@ -165,7 +165,7 @@ protected:
_validate_property(PropertyInfo &property) const;
static void _bind_methods();
- virtual void _notification(int p_notification);
+ virtual void _notification(int p_what);
public:
SkeletonIK();
@@ -192,7 +192,7 @@ public:
void set_use_magnet(bool p_use);
bool is_using_magnet() const;
- void set_magnet_position(const Vector3 &p_constraint);
+ void set_magnet_position(const Vector3 &p_local_position);
const Vector3 &get_magnet_position() const;
void set_min_distance(real_t p_min_distance);
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index c70e58564f..4dee4e1d12 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -583,9 +583,7 @@ bool Tween::_apply_tween_value(InterpolateData &p_data, Variant &value) {
}
// Did we get an error from the function call?
- if (error.error == Variant::CallError::CALL_OK)
- return true;
- return false;
+ return error.error == Variant::CallError::CALL_OK;
}
case INTER_CALLBACK:
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index 2def9fe8fc..c053fceb74 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -339,7 +339,7 @@ void AudioStreamPlayer::set_stream_paused(bool p_pause) {
if (p_pause != stream_paused) {
stream_paused = p_pause;
- stream_paused_fade = p_pause ? true : false;
+ stream_paused_fade = p_pause;
}
}
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index cc37d4cf7d..b7d2131ee9 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -91,7 +91,6 @@ void BoxContainer::_resort() {
int stretch_diff = stretch_max - stretch_min;
if (stretch_diff < 0) {
//avoid negative stretch space
- stretch_max = stretch_min;
stretch_diff = 0;
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 0845b56828..6e0e26312f 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1042,55 +1042,37 @@ int Control::get_constant(const StringName &p_name, const StringName &p_type) co
bool Control::has_icon_override(const StringName &p_name) const {
const Ref<Texture> *tex = data.icon_override.getptr(p_name);
- if (tex)
- return true;
- else
- return false;
+ return tex != NULL;
}
bool Control::has_shader_override(const StringName &p_name) const {
const Ref<Shader> *sdr = data.shader_override.getptr(p_name);
- if (sdr)
- return true;
- else
- return false;
+ return sdr != NULL;
}
bool Control::has_stylebox_override(const StringName &p_name) const {
const Ref<StyleBox> *style = data.style_override.getptr(p_name);
- if (style)
- return true;
- else
- return false;
+ return style != NULL;
}
bool Control::has_font_override(const StringName &p_name) const {
const Ref<Font> *font = data.font_override.getptr(p_name);
- if (font)
- return true;
- else
- return false;
+ return font != NULL;
}
bool Control::has_color_override(const StringName &p_name) const {
const Color *color = data.color_override.getptr(p_name);
- if (color)
- return true;
- else
- return false;
+ return color != NULL;
}
bool Control::has_constant_override(const StringName &p_name) const {
const int *constant = data.constant_override.getptr(p_name);
- if (constant)
- return true;
- else
- return false;
+ return constant != NULL;
}
bool Control::has_icon(const StringName &p_name, const StringName &p_type) const {
@@ -1997,10 +1979,7 @@ Control *Control::find_next_valid_focus() const {
break;
}
- if (next_child) {
-
- from = next_child;
- } else {
+ if (!next_child) {
next_child = _next_control(from);
if (!next_child) { //nothing else.. go up and find either window or subwindow
diff --git a/scene/gui/control.h b/scene/gui/control.h
index a6f9a442ae..2489a5eda4 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -139,8 +139,8 @@ private:
bool operator()(const Control *p_a, const Control *p_b) const {
if (p_a->get_canvas_layer() == p_b->get_canvas_layer())
return p_b->is_greater_than(p_a);
- else
- return p_a->get_canvas_layer() < p_b->get_canvas_layer();
+
+ return p_a->get_canvas_layer() < p_b->get_canvas_layer();
}
};
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index bc8dcf0e82..ba4d390fc5 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -302,11 +302,8 @@ bool FileDialog::_is_open_should_be_disabled() {
Dictionary d = ti->get_metadata(0);
// Opening a file, but selected a folder? Forbidden.
- if (((mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES) && d["dir"]) || // Flipped case, also forbidden.
- (mode == MODE_OPEN_DIR && !d["dir"]))
- return true;
-
- return false;
+ return ((mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES) && d["dir"]) || // Flipped case, also forbidden.
+ (mode == MODE_OPEN_DIR && !d["dir"]);
}
void FileDialog::_go_up() {
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index e3e9368a12..e18387a52e 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -470,7 +470,6 @@ void Label::regenerate_word_cache() {
wc->word_len = i - word_pos;
wc->space_count = space_count;
current_word_size = char_width;
- space_count = 0;
word_pos = i;
}
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 960499c876..7a015f77db 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -623,10 +623,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const {
}
Ref<Texture> icon = Control::get_icon("clear");
int x_ofs = get_stylebox("normal")->get_offset().x;
- if (p_pos.x > get_size().width - icon->get_width() - x_ofs) {
- return true;
- }
- return false;
+ return p_pos.x > get_size().width - icon->get_width() - x_ofs;
}
void LineEdit::_notification(int p_what) {
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 3a9a0ae21a..5b91299de6 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -459,14 +459,13 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (p_font_color_shadow.a > 0) {
float x_ofs_shadow = align_ofs + pofs;
float y_ofs_shadow = y + lh - line_descent;
- float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + shadow_ofs, c[i], c[i + 1], p_font_color_shadow);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + shadow_ofs, c[i], c[i + 1], p_font_color_shadow);
if (p_shadow_as_outline) {
font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(shadow_ofs.x, -shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, -shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
}
- x_ofs_shadow += move;
}
if (selected) {
@@ -947,84 +946,80 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) {
return;
if (b->get_button_index() == BUTTON_LEFT) {
+ if (b->is_pressed() && !b->is_doubleclick()) {
+ scroll_updated = false;
+ int line = 0;
+ Item *item = NULL;
- if (true) {
+ bool outside;
+ _find_click(main, b->get_position(), &item, &line, &outside);
- if (b->is_pressed() && !b->is_doubleclick()) {
- scroll_updated = false;
- int line = 0;
- Item *item = NULL;
-
- bool outside;
- _find_click(main, b->get_position(), &item, &line, &outside);
-
- if (item) {
+ if (item) {
- if (selection.enabled) {
+ if (selection.enabled) {
- selection.click = item;
- selection.click_char = line;
+ selection.click = item;
+ selection.click_char = line;
- // Erase previous selection.
- if (selection.active) {
- selection.from = NULL;
- selection.from_char = '\0';
- selection.to = NULL;
- selection.to_char = '\0';
- selection.active = false;
+ // Erase previous selection.
+ if (selection.active) {
+ selection.from = NULL;
+ selection.from_char = '\0';
+ selection.to = NULL;
+ selection.to_char = '\0';
+ selection.active = false;
- update();
- }
+ update();
}
}
- } else if (b->is_pressed() && b->is_doubleclick() && selection.enabled) {
+ }
+ } else if (b->is_pressed() && b->is_doubleclick() && selection.enabled) {
- //doubleclick: select word
- int line = 0;
- Item *item = NULL;
- bool outside;
+ //doubleclick: select word
+ int line = 0;
+ Item *item = NULL;
+ bool outside;
- _find_click(main, b->get_position(), &item, &line, &outside);
+ _find_click(main, b->get_position(), &item, &line, &outside);
- while (item && item->type != ITEM_TEXT) {
+ while (item && item->type != ITEM_TEXT) {
- item = _get_next_item(item, true);
- }
+ item = _get_next_item(item, true);
+ }
- if (item && item->type == ITEM_TEXT) {
+ if (item && item->type == ITEM_TEXT) {
- String itext = static_cast<ItemText *>(item)->text;
+ String itext = static_cast<ItemText *>(item)->text;
- int beg, end;
- if (select_word(itext, line, beg, end)) {
+ int beg, end;
+ if (select_word(itext, line, beg, end)) {
- selection.from = item;
- selection.to = item;
- selection.from_char = beg;
- selection.to_char = end - 1;
- selection.active = true;
- update();
- }
+ selection.from = item;
+ selection.to = item;
+ selection.from_char = beg;
+ selection.to_char = end - 1;
+ selection.active = true;
+ update();
}
- } else if (!b->is_pressed()) {
+ }
+ } else if (!b->is_pressed()) {
- selection.click = NULL;
+ selection.click = NULL;
- if (!b->is_doubleclick() && !scroll_updated) {
- int line = 0;
- Item *item = NULL;
+ if (!b->is_doubleclick() && !scroll_updated) {
+ int line = 0;
+ Item *item = NULL;
- bool outside;
- _find_click(main, b->get_position(), &item, &line, &outside);
+ bool outside;
+ _find_click(main, b->get_position(), &item, &line, &outside);
- if (item) {
+ if (item) {
- Variant meta;
- if (!outside && _find_meta(item, &meta)) {
- //meta clicked
+ Variant meta;
+ if (!outside && _find_meta(item, &meta)) {
+ //meta clicked
- emit_signal("meta_clicked", meta);
- }
+ emit_signal("meta_clicked", meta);
}
}
}
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index a1034937b5..d83ae47671 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -140,19 +140,17 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
_cancel_drag();
}
- if (true) {
- drag_speed = Vector2();
- drag_accum = Vector2();
- last_drag_accum = Vector2();
- drag_from = Vector2(h_scroll->get_value(), v_scroll->get_value());
- drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
- drag_touching_deaccel = false;
- beyond_deadzone = false;
+ drag_speed = Vector2();
+ drag_accum = Vector2();
+ last_drag_accum = Vector2();
+ drag_from = Vector2(h_scroll->get_value(), v_scroll->get_value());
+ drag_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ drag_touching_deaccel = false;
+ beyond_deadzone = false;
+ time_since_motion = 0;
+ if (drag_touching) {
+ set_physics_process_internal(true);
time_since_motion = 0;
- if (drag_touching) {
- set_physics_process_internal(true);
- time_since_motion = 0;
- }
}
} else {
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 9d457e989c..fdd21f525b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1593,7 +1593,6 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
insert_text_at_cursor(ch_pair);
cursor_set_column(cursor_position_to_move);
- return;
}
void TextEdit::_consume_backspace_for_pair_symbol(int prev_line, int prev_column) {
@@ -5395,11 +5394,7 @@ bool TextEdit::is_line_comment(int p_line) const {
for (int i = 0; i < line_length - 1; i++) {
if (_is_symbol(text[p_line][i]) && cri_map.has(i)) {
const Text::ColorRegionInfo &cri = cri_map[i];
- if (color_regions[cri.region].begin_key == "#" || color_regions[cri.region].begin_key == "//") {
- return true;
- } else {
- return false;
- }
+ return color_regions[cri.region].begin_key == "#" || color_regions[cri.region].begin_key == "//";
} else if (_is_whitespace(text[p_line][i])) {
continue;
} else {
@@ -5448,9 +5443,7 @@ bool TextEdit::is_folded(int p_line) const {
ERR_FAIL_INDEX_V(p_line, text.size(), false);
if (p_line + 1 >= text.size())
return false;
- if (!is_line_hidden(p_line) && is_line_hidden(p_line + 1))
- return true;
- return false;
+ return !is_line_hidden(p_line) && is_line_hidden(p_line + 1);
}
Vector<int> TextEdit::get_folded_lines() const {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 5493879e55..c2493ab321 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1931,8 +1931,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
edited_col = col;
bool on_arrow = x > col_width - cache.select_arrow->get_width();
- bring_up_editor = false;
-
custom_popup_rect = Rect2i(get_global_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs + item_h - cache.offset.y), Size2(get_column_width(col), item_h));
if (on_arrow || !p_item->cells[col].custom_button) {
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 26186638d7..a580a7f8ac 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1393,7 +1393,7 @@ Node *Node::get_node(const NodePath &p_path) const {
Node *node = get_node_or_null(p_path);
if (!node) {
ERR_EXPLAIN("Node not found: " + p_path);
- ERR_FAIL_COND_V(!node, NULL);
+ ERR_FAIL_V(NULL);
}
return node;
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 10e5ad78e2..dcd70a1844 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -532,7 +532,7 @@ void Viewport::_notification(int p_what) {
Map<ObjectID, uint64_t>::Element *F = physics_2d_mouseover.find(res[i].collider_id);
if (!F) {
- F = physics_2d_mouseover.insert(res[i].collider_id, frame);
+ physics_2d_mouseover.insert(res[i].collider_id, frame);
co->_mouse_enter();
} else {
F->get() = frame;
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp
index 5d8adc0c8d..99a17fb5b9 100644
--- a/scene/resources/multimesh.cpp
+++ b/scene/resources/multimesh.cpp
@@ -35,7 +35,7 @@ void MultiMesh::_set_transform_array(const PoolVector<Vector3> &p_array) {
if (transform_format != TRANSFORM_3D)
return;
- PoolVector<Vector3> xforms = p_array;
+ const PoolVector<Vector3> &xforms = p_array;
int len = xforms.size();
ERR_FAIL_COND((len / 4) != instance_count);
if (len == 0)
@@ -85,7 +85,7 @@ void MultiMesh::_set_transform_2d_array(const PoolVector<Vector2> &p_array) {
if (transform_format != TRANSFORM_2D)
return;
- PoolVector<Vector2> xforms = p_array;
+ const PoolVector<Vector2> &xforms = p_array;
int len = xforms.size();
ERR_FAIL_COND((len / 3) != instance_count);
if (len == 0)
@@ -130,7 +130,7 @@ PoolVector<Vector2> MultiMesh::_get_transform_2d_array() const {
void MultiMesh::_set_color_array(const PoolVector<Color> &p_array) {
- PoolVector<Color> colors = p_array;
+ const PoolVector<Color> &colors = p_array;
int len = colors.size();
if (len == 0)
return;
@@ -162,7 +162,7 @@ PoolVector<Color> MultiMesh::_get_color_array() const {
void MultiMesh::_set_custom_data_array(const PoolVector<Color> &p_array) {
- PoolVector<Color> custom_datas = p_array;
+ const PoolVector<Color> &custom_datas = p_array;
int len = custom_datas.size();
if (len == 0)
return;
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 04d13c8869..74a493d3b5 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -743,8 +743,6 @@ void CylinderMesh::_create_mesh_array(Array &p_arr) const {
int i, j, prevrow, thisrow, point;
float x, y, z, u, v, radius;
- radius = bottom_radius > top_radius ? bottom_radius : top_radius;
-
PoolVector<Vector3> points;
PoolVector<Vector3> normals;
PoolVector<float> tangents;
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index efc1082a6b..339f008a3d 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -1324,7 +1324,7 @@ Error ResourceFormatLoaderText::convert_file_to_binary(const String &p_src_path,
ERR_FAIL_COND_V(err != OK, ERR_CANT_OPEN);
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- String path = p_src_path;
+ const String &path = p_src_path;
ria->local_path = ProjectSettings::get_singleton()->localize_path(path);
ria->res_path = ria->local_path;
//ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
@@ -1441,7 +1441,7 @@ void ResourceFormatSaverTextInstance::_find_resources(const Variant &p_variant,
int len = varray.size();
for (int i = 0; i < len; i++) {
- Variant v = varray.get(i);
+ const Variant &v = varray.get(i);
_find_resources(v);
}
diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h
index df753276e4..ef64b50711 100644
--- a/scene/resources/visual_shader_nodes.h
+++ b/scene/resources/visual_shader_nodes.h
@@ -699,7 +699,7 @@ public:
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty
- void set_function(Function p_op);
+ void set_function(Function p_func);
Function get_function() const;
virtual Vector<StringName> get_editable_properties() const;
@@ -740,7 +740,7 @@ public:
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty
- void set_function(Function p_op);
+ void set_function(Function p_func);
Function get_function() const;
virtual Vector<StringName> get_editable_properties() const;
@@ -895,7 +895,7 @@ public:
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty
- void set_function(Function p_op);
+ void set_function(Function p_func);
Function get_function() const;
virtual Vector<StringName> get_editable_properties() const;
@@ -935,7 +935,7 @@ public:
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty
- void set_function(Function p_op);
+ void set_function(Function p_func);
Function get_function() const;
virtual Vector<StringName> get_editable_properties() const;
diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp
index 392938a2be..ca033f6079 100644
--- a/servers/audio/audio_filter_sw.cpp
+++ b/servers/audio/audio_filter_sw.cpp
@@ -154,7 +154,6 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) {
double tmpq = Math::sqrt(Q);
if (tmpq <= 0)
tmpq = 0.001;
- alpha = sin_v / (2 * tmpq);
double beta = Math::sqrt(tmpgain) / tmpq;
a0 = (tmpgain + 1.0) + (tmpgain - 1.0) * cos_v + beta * sin_v;
@@ -169,7 +168,6 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) {
double tmpq = Math::sqrt(Q);
if (tmpq <= 0)
tmpq = 0.001;
- alpha = sin_v / (2 * tmpq);
double beta = Math::sqrt(tmpgain) / tmpq;
a0 = (tmpgain + 1.0) - (tmpgain - 1.0) * cos_v + beta * sin_v;
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index 1a6430c499..388346b67c 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -223,7 +223,7 @@ float AudioStreamPlaybackMicrophone::get_playback_position() const {
}
void AudioStreamPlaybackMicrophone::seek(float p_time) {
- return; // Can't seek a microphone input
+ // Can't seek a microphone input
}
AudioStreamPlaybackMicrophone::~AudioStreamPlaybackMicrophone() {
diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h
index 8f023c0401..ef9f8ea92a 100644
--- a/servers/audio/audio_stream.h
+++ b/servers/audio/audio_stream.h
@@ -119,7 +119,7 @@ public:
class AudioStreamPlaybackMicrophone : public AudioStreamPlaybackResampled {
- GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlayback);
+ GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlaybackResampled);
friend class AudioStreamMicrophone;
bool active;
diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp
index 305f9046c3..bb1daf04a4 100644
--- a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp
+++ b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp
@@ -231,8 +231,8 @@ Ref<AudioEffectInstance> AudioEffectSpectrumAnalyzer::instance() {
return ins;
}
-void AudioEffectSpectrumAnalyzer::set_buffer_length(float p_volume) {
- buffer_length = p_volume;
+void AudioEffectSpectrumAnalyzer::set_buffer_length(float p_seconds) {
+ buffer_length = p_seconds;
}
float AudioEffectSpectrumAnalyzer::get_buffer_length() const {
diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp
index 94bf274f9c..1b59779bd6 100644
--- a/servers/physics/broad_phase_octree.cpp
+++ b/servers/physics/broad_phase_octree.cpp
@@ -45,7 +45,7 @@ void BroadPhaseOctree::move(ID p_id, const AABB &p_aabb) {
void BroadPhaseOctree::set_static(ID p_id, bool p_static) {
CollisionObjectSW *it = octree.get(p_id);
- octree.set_pairable(p_id, p_static ? false : true, 1 << it->get_type(), p_static ? 0 : 0xFFFFF); //pair everything, don't care 1?
+ octree.set_pairable(p_id, !p_static, 1 << it->get_type(), p_static ? 0 : 0xFFFFF); //pair everything, don't care 1?
}
void BroadPhaseOctree::remove(ID p_id) {
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index 3073cc8b11..a13fa65009 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -538,8 +538,6 @@ static void _collision_sphere_capsule(const ShapeSW *p_a, const Transform &p_tra
template <bool withMargin>
static void _collision_sphere_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
@@ -835,8 +833,6 @@ static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transf
template <bool withMargin>
static void _collision_box_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
@@ -1117,8 +1113,6 @@ static void _collision_capsule_capsule(const ShapeSW *p_a, const Transform &p_tr
template <bool withMargin>
static void _collision_capsule_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
@@ -1243,20 +1237,14 @@ static void _collision_capsule_face(const ShapeSW *p_a, const Transform &p_trans
template <bool withMargin>
static void _collision_cylinder_cylinder(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
static void _collision_cylinder_convex_polygon(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
static void _collision_cylinder_face(const ShapeSW *p_a, const Transform &p_transform_a, const ShapeSW *p_b, const Transform &p_transform_b, _CollectorCallback *p_collector, real_t p_margin_a, real_t p_margin_b) {
-
- return;
}
template <bool withMargin>
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp
index 813d9b7704..a9fe045856 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics/joints/generic_6dof_joint_sw.cpp
@@ -421,7 +421,6 @@ void Generic6DOFJointSW::calcAnchorPos(void) {
const Vector3 &pA = m_calculatedTransformA.origin;
const Vector3 &pB = m_calculatedTransformB.origin;
m_AnchorPos = pA * weight + pB * (real_t(1.0) - weight);
- return;
} // Generic6DOFJointSW::calcAnchorPos()
void Generic6DOFJointSW::set_param(Vector3::Axis p_axis, PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value) {
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index 8b9f210850..f3a4cbed24 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -118,7 +118,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas))
continue;
- if (p_pick_ray && !(static_cast<CollisionObjectSW *>(space->intersection_query_results[i])->is_ray_pickable()))
+ if (p_pick_ray && !(space->intersection_query_results[i]->is_ray_pickable()))
continue;
if (p_exclude.has(space->intersection_query_results[i]->get_self()))
@@ -439,7 +439,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_
continue;
}
- if (rcd.best_len == 0)
+ if (rcd.best_len == 0 || !rcd.best_object)
return false;
r_info->collider_id = rcd.best_object->get_instance_id();
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index e2b1bb9da4..7c89c43f36 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -442,7 +442,7 @@ bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D &p_sh
continue;
}
- if (rcd.best_len == 0)
+ if (rcd.best_len == 0 || !rcd.best_object)
return false;
r_info->collider_id = rcd.best_object->get_instance_id();
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index d5e154a7fc..66e2429bd0 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -783,7 +783,7 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
ERR_FAIL_COND(!p_bones.empty() && p_bones.size() != vertex_count * 4);
ERR_FAIL_COND(!p_weights.empty() && p_weights.size() != vertex_count * 4);
- Vector<int> indices = p_indices;
+ const Vector<int> &indices = p_indices;
int count = p_count * 3;
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index 26424f927e..28a8770c90 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -84,8 +84,8 @@ public:
if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y))
return p_left->ysort_pos.x < p_right->ysort_pos.x;
- else
- return p_left->ysort_pos.y < p_right->ysort_pos.y;
+
+ return p_left->ysort_pos.y < p_right->ysort_pos.y;
}
};
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 3ee23e9290..faf5a1f8fa 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -3387,11 +3387,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) {
RID mat = VSG::storage->immediate_get_material(p_instance->base);
- if (!mat.is_valid() || VSG::storage->material_casts_shadows(mat)) {
- can_cast_shadows = true;
- } else {
- can_cast_shadows = false;
- }
+ can_cast_shadows = !mat.is_valid() || VSG::storage->material_casts_shadows(mat);
if (mat.is_valid() && VSG::storage->material_is_animated(mat)) {
is_animated = true;
diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp
index b7c54caffd..f8ed035766 100644
--- a/servers/visual/visual_server_viewport.cpp
+++ b/servers/visual/visual_server_viewport.cpp
@@ -253,8 +253,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
} else {
_draw_3d(p_viewport, p_eye);
}
-
- scenario_draw_canvas_bg = false;
}
//VSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow);
diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h
index 43bbcb66c3..bdd4c1d4f2 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/visual/visual_server_viewport.h
@@ -138,9 +138,8 @@ public:
if (left_to_screen == right_to_screen) {
return p_left->parent == p_right->self;
- } else {
- return right_to_screen;
}
+ return right_to_screen;
}
};
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index 60be63fd24..c6468694fd 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -917,7 +917,7 @@ uint32_t VisualServer::mesh_surface_make_offsets_from_format(uint32_t p_format,
}
r_offsets[i] = elem_size;
continue;
- } break;
+ }
default: {
ERR_FAIL_V(0);
}
@@ -953,15 +953,12 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
switch (var.get_type()) {
case Variant::POOL_VECTOR2_ARRAY: {
PoolVector<Vector2> v2 = var;
- array_len = v2.size();
} break;
case Variant::POOL_VECTOR3_ARRAY: {
PoolVector<Vector3> v3 = var;
- array_len = v3.size();
} break;
default: {
Array v = var;
- array_len = v.size();
} break;
}
@@ -1151,7 +1148,7 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
if (err) {
ERR_EXPLAIN("Invalid array format for surface");
- ERR_FAIL_COND(err != OK);
+ ERR_FAIL();
}
Vector<PoolVector<uint8_t> > blend_shape_data;
@@ -1165,9 +1162,9 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
AABB laabb;
Error err2 = _surface_set_data(p_blend_shapes[i], format & ~ARRAY_FORMAT_INDEX, offsets, total_elem_size, vertex_array_shape, array_len, noindex, 0, laabb, bone_aabb);
aabb.merge_with(laabb);
- if (err2) {
+ if (err2 != OK) {
ERR_EXPLAIN("Invalid blend shape array format for surface");
- ERR_FAIL_COND(err2 != OK);
+ ERR_FAIL();
}
blend_shape_data.push_back(vertex_array_shape);