diff options
44 files changed, 87 insertions, 83 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index 2cbf53ba0b..794d990083 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -1148,7 +1148,7 @@ Variant::Type ClassDB::get_property_type(const StringName &p_class, const String return Variant::NIL; } -StringName ClassDB::get_property_setter(StringName p_class, const StringName p_property) { +StringName ClassDB::get_property_setter(StringName p_class, const StringName &p_property) { ClassInfo *type = classes.getptr(p_class); ClassInfo *check = type; @@ -1165,7 +1165,7 @@ StringName ClassDB::get_property_setter(StringName p_class, const StringName p_p return StringName(); } -StringName ClassDB::get_property_getter(StringName p_class, const StringName p_property) { +StringName ClassDB::get_property_getter(StringName p_class, const StringName &p_property) { ClassInfo *type = classes.getptr(p_class); ClassInfo *check = type; diff --git a/core/class_db.h b/core/class_db.h index 237ae9b806..3d9a695f02 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -337,8 +337,8 @@ public: static bool has_property(const StringName &p_class, const StringName &p_property, bool p_no_inheritance = false); static int get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL); static Variant::Type get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL); - static StringName get_property_setter(StringName p_class, const StringName p_property); - static StringName get_property_getter(StringName p_class, const StringName p_property); + static StringName get_property_setter(StringName p_class, const StringName &p_property); + static StringName get_property_getter(StringName p_class, const StringName &p_property); static bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false); static void set_method_flags(StringName p_class, StringName p_method, int p_flags); diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 1540bc8fe1..400f342018 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -852,7 +852,7 @@ void Basis::set_quat_scale(const Quat &p_quat, const Vector3 &p_scale) { rotate(p_quat); } -void Basis::set_diagonal(const Vector3 p_diag) { +void Basis::set_diagonal(const Vector3 &p_diag) { elements[0][0] = p_diag.x; elements[0][1] = 0; elements[0][2] = 0; diff --git a/core/math/basis.h b/core/math/basis.h index 75037c2c52..d3adad3d90 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -153,7 +153,7 @@ public: int get_orthogonal_index() const; void set_orthogonal_index(int p_index); - void set_diagonal(const Vector3 p_diag); + void set_diagonal(const Vector3 &p_diag); bool is_orthogonal() const; bool is_diagonal() const; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 3597e2b818..c1d4967f55 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -487,7 +487,7 @@ void ProjectSettings::set_registering_order(bool p_enable) { registering_order = p_enable; } -Error ProjectSettings::_load_settings_binary(const String p_path) { +Error ProjectSettings::_load_settings_binary(const String &p_path) { Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -530,7 +530,7 @@ Error ProjectSettings::_load_settings_binary(const String p_path) { return OK; } -Error ProjectSettings::_load_settings_text(const String p_path) { +Error ProjectSettings::_load_settings_text(const String &p_path) { Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -593,7 +593,7 @@ Error ProjectSettings::_load_settings_text(const String p_path) { } } -Error ProjectSettings::_load_settings_text_or_binary(const String p_text_path, const String p_bin_path) { +Error ProjectSettings::_load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path) { // Attempt first to load the text-based project.godot file Error err_text = _load_settings_text(p_text_path); diff --git a/core/project_settings.h b/core/project_settings.h index 0ff18ab3f5..d7651417d5 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -97,9 +97,9 @@ protected: static ProjectSettings *singleton; - Error _load_settings_text(const String p_path); - Error _load_settings_binary(const String p_path); - Error _load_settings_text_or_binary(const String p_text_path, const String p_bin_path); + Error _load_settings_text(const String &p_path); + Error _load_settings_binary(const String &p_path); + Error _load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path); Error _save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); Error _save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 306f17ea44..53ee0b6132 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -68,6 +68,8 @@ <member name="max_redirects" type="int" setter="set_max_redirects" getter="get_max_redirects" default="8"> Maximum number of allowed redirects. </member> + <member name="timeout" type="int" setter="set_timeout" getter="get_timeout" default="0"> + </member> <member name="use_threads" type="bool" setter="set_use_threads" getter="is_using_threads" default="false"> If [code]true[/code], multithreading is used to improve performance. </member> @@ -123,5 +125,7 @@ <constant name="RESULT_REDIRECT_LIMIT_REACHED" value="11" enum="Result"> Request reached its maximum redirect limit, see [member max_redirects]. </constant> + <constant name="RESULT_TIMEOUT" value="12" enum="Result"> + </constant> </constants> </class> diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index f8e771aea0..6a57a2e562 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -212,7 +212,7 @@ NetSocketPosix::NetError NetSocketPosix::_get_socket_error() { #pragma GCC diagnostic pop #endif -bool NetSocketPosix::_can_use_ip(const IP_Address p_ip, const bool p_for_bind) const { +bool NetSocketPosix::_can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const { if (p_for_bind && !(p_ip.is_valid() || p_ip.is_wildcard())) { return false; diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index ce6dc00d42..40406b241a 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -65,7 +65,7 @@ private: protected: static NetSocket *_create_func(); - bool _can_use_ip(const IP_Address p_ip, const bool p_for_bind) const; + bool _can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const; public: static void make_default(); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index f2e4d1086b..327e61cea3 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -50,7 +50,7 @@ bool EditorResourcePreviewGenerator::handles(const String &p_type) const { ERR_FAIL_V(false); } -Ref<Texture> EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 &p_size) const { if (get_script_instance() && get_script_instance()->has_method("generate")) { return get_script_instance()->call("generate", p_from, p_size); @@ -59,7 +59,7 @@ Ref<Texture> EditorResourcePreviewGenerator::generate(const RES &p_from, const S ERR_FAIL_V(Ref<Texture>()); } -Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 p_size) const { +Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 &p_size) const { if (get_script_instance() && get_script_instance()->has_method("generate_from_path")) { return get_script_instance()->call("generate_from_path", p_path, p_size); diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index e0fd54c924..ad4136e9ab 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -45,8 +45,8 @@ protected: public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; - virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; + virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 &p_size) const; virtual bool generate_small_preview_automatically() const; virtual bool can_generate_small_preview() const; diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 4bd68a593f..e4e32b2ce0 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -37,7 +37,7 @@ EditorRun::Status EditorRun::get_status() const { return status; } -Error EditorRun::run(const String &p_scene, const String p_custom_args, const List<String> &p_breakpoints) { +Error EditorRun::run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints) { List<String> args; diff --git a/editor/editor_run.h b/editor/editor_run.h index c27c8a05c8..9127c62030 100644 --- a/editor/editor_run.h +++ b/editor/editor_run.h @@ -51,7 +51,7 @@ private: public: Status get_status() const; - Error run(const String &p_scene, const String p_custom_args, const List<String> &p_breakpoints); + Error run(const String &p_scene, const String &p_custom_args, const List<String> &p_breakpoints); void run_native_notify() { status = STATUS_PLAY; } void stop(); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b74350c98b..947d96f897 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -163,7 +163,7 @@ Vector<String> FileSystemDock::_compute_uncollapsed_paths() { return uncollapsed_paths; } -void FileSystemDock::_update_tree(const Vector<String> p_uncollapsed_paths, bool p_uncollapse_root, bool p_select_in_favorites) { +void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, bool p_uncollapse_root, bool p_select_in_favorites) { // Recreate the tree tree->clear(); @@ -812,7 +812,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } } -void FileSystemDock::_select_file(const String p_path, bool p_select_in_favorites) { +void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) { String fpath = p_path; if (fpath.ends_with("/")) { if (fpath != "res://") { @@ -1502,7 +1502,7 @@ void FileSystemDock::_file_list_rmb_option(int p_option) { _file_option(p_option, selected); } -void FileSystemDock::_file_option(int p_option, const Vector<String> p_selected) { +void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected) { // The first one should be the active item switch (p_option) { diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 76f92665db..6de370ad29 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -175,7 +175,7 @@ private: Ref<Texture> _get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx); bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths, bool p_select_in_favorites); Vector<String> _compute_uncollapsed_paths(); - void _update_tree(const Vector<String> p_uncollapsed_paths = Vector<String>(), bool p_uncollapse_root = false, bool p_select_in_favorites = false); + void _update_tree(const Vector<String> &p_uncollapsed_paths = Vector<String>(), bool p_uncollapse_root = false, bool p_select_in_favorites = false); void _navigate_to_path(const String &p_path, bool p_select_in_favorites = false); void _file_list_gui_input(Ref<InputEvent> p_event); @@ -188,7 +188,7 @@ private: void _tree_toggle_collapsed(); - void _select_file(const String p_path, bool p_select_in_favorites = false); + void _select_file(const String &p_path, bool p_select_in_favorites = false); void _tree_activate_file(); void _file_list_activate_file(int p_idx); void _file_multi_selected(int p_index, bool p_selected); @@ -221,7 +221,7 @@ private: void _tree_rmb_option(int p_option); void _file_list_rmb_option(int p_option); - void _file_option(int p_option, const Vector<String> p_selected); + void _file_option(int p_option, const Vector<String> &p_selected); void _fw_history(); void _bw_history(); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 33f685892c..5d3cef4c34 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -766,7 +766,7 @@ bool CurvePreviewGenerator::handles(const String &p_type) const { return p_type == "Curve"; } -Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, const Size2 p_size) const { +Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, const Size2 &p_size) const { Ref<Curve> curve_ref = p_from; ERR_FAIL_COND_V(curve_ref.is_null(), Ref<Texture>()); diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index 2e2bf1c26f..9071146863 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -140,7 +140,7 @@ class CurvePreviewGenerator : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const Ref<Resource> &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const Ref<Resource> &p_from, const Size2 &p_size) const; }; #endif // CURVE_EDITOR_PLUGIN_H diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index d260b171a8..c8ffc2744a 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -82,7 +82,7 @@ bool EditorTexturePreviewPlugin::generate_small_preview_automatically() const { return true; } -Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<Image> img; Ref<AtlasTexture> atex = p_from; @@ -148,7 +148,7 @@ bool EditorImagePreviewPlugin::handles(const String &p_type) const { return p_type == "Image"; } -Ref<Texture> EditorImagePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorImagePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<Image> img = p_from; @@ -196,7 +196,7 @@ bool EditorBitmapPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "BitMap"); } -Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<BitMap> bm = p_from; @@ -263,12 +263,12 @@ bool EditorPackedScenePreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "PackedScene"); } -Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { return generate_from_path(p_from->get_path(), p_size); } -Ref<Texture> EditorPackedScenePreviewPlugin::generate_from_path(const String &p_path, const Size2 p_size) const { +Ref<Texture> EditorPackedScenePreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const { String temp_path = EditorSettings::get_singleton()->get_cache_dir(); String cache_base = ProjectSettings::get_singleton()->globalize_path(p_path).md5_text(); @@ -321,7 +321,7 @@ bool EditorMaterialPreviewPlugin::generate_small_preview_automatically() const { return true; } -Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<Material> material = p_from; ERR_FAIL_COND_V(material.is_null(), Ref<Texture>()); @@ -487,7 +487,7 @@ bool EditorScriptPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "Script"); } -Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<Script> scr = p_from; if (scr.is_null()) @@ -609,7 +609,7 @@ bool EditorAudioStreamPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "AudioStream"); } -Ref<Texture> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<AudioStream> stream = p_from; ERR_FAIL_COND_V(stream.is_null(), Ref<Texture>()); @@ -706,7 +706,7 @@ bool EditorMeshPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "Mesh"); //any Mesh } -Ref<Texture> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref<Mesh> mesh = p_from; ERR_FAIL_COND_V(mesh.is_null(), Ref<Texture>()); @@ -827,7 +827,7 @@ bool EditorFontPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "DynamicFontData"); } -Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, const Size2 p_size) const { +Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const { Ref<DynamicFontData> SampledFont; SampledFont.instance(); @@ -882,7 +882,7 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c return ptex; } -Ref<Texture> EditorFontPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref<Texture> EditorFontPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { String path = p_from->get_path(); if (!FileAccess::exists(path)) { diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h index 12d693b10a..71a6c0fc08 100644 --- a/editor/plugins/editor_preview_plugins.h +++ b/editor/plugins/editor_preview_plugins.h @@ -41,7 +41,7 @@ class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; virtual bool generate_small_preview_automatically() const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorTexturePreviewPlugin(); }; @@ -52,7 +52,7 @@ class EditorImagePreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; virtual bool generate_small_preview_automatically() const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorImagePreviewPlugin(); }; @@ -63,7 +63,7 @@ class EditorBitmapPreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; virtual bool generate_small_preview_automatically() const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorBitmapPreviewPlugin(); }; @@ -72,8 +72,8 @@ class EditorPackedScenePreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; - virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; + virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 &p_size) const; EditorPackedScenePreviewPlugin(); }; @@ -102,7 +102,7 @@ protected: public: virtual bool handles(const String &p_type) const; virtual bool generate_small_preview_automatically() const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorMaterialPreviewPlugin(); ~EditorMaterialPreviewPlugin(); @@ -111,7 +111,7 @@ public: class EditorScriptPreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorScriptPreviewPlugin(); }; @@ -119,7 +119,7 @@ public: class EditorAudioStreamPreviewPlugin : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorAudioStreamPreviewPlugin(); }; @@ -146,7 +146,7 @@ protected: public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; EditorMeshPreviewPlugin(); ~EditorMeshPreviewPlugin(); @@ -169,8 +169,8 @@ protected: public: virtual bool handles(const String &p_type) const; - virtual Ref<Texture> generate(const RES &p_from, const Size2 p_size) const; - virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 p_size) const; + virtual Ref<Texture> generate(const RES &p_from, const Size2 &p_size) const; + virtual Ref<Texture> generate_from_path(const String &p_path, const Size2 &p_size) const; EditorFontPreviewPlugin(); ~EditorFontPreviewPlugin(); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 66663d0cd9..9fd694ee0d 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3190,7 +3190,7 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const return point + offset; } -AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, const AABB p_bounds) { +AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, const AABB &p_bounds) { AABB bounds = p_bounds; for (int i = 0; i < p_parent->get_child_count(); i++) { Spatial *child = Object::cast_to<Spatial>(p_parent->get_child(i)); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 0404115269..b4e2f028d2 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -376,7 +376,7 @@ private: Point2i _get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const; Vector3 _get_instance_position(const Point2 &p_pos) const; - static AABB _calculate_spatial_bounds(const Spatial *p_parent, const AABB p_bounds); + static AABB _calculate_spatial_bounds(const Spatial *p_parent, const AABB &p_bounds); void _create_preview(const Vector<String> &files) const; void _remove_preview(); bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 3735cceb15..25e812e31c 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -281,7 +281,7 @@ void TileMapEditor::_finish_undo() { undo_redo->commit_action(); } -void TileMapEditor::_set_cell(const Point2i &p_pos, Vector<int> p_values, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i p_autotile_coord) { +void TileMapEditor::_set_cell(const Point2i &p_pos, Vector<int> p_values, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord) { ERR_FAIL_COND(!node); @@ -693,7 +693,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era return preview ? bucket_cache : points; } -void TileMapEditor::_fill_points(const PoolVector<Vector2> p_points, const Dictionary &p_op) { +void TileMapEditor::_fill_points(const PoolVector<Vector2> &p_points, const Dictionary &p_op) { int len = p_points.size(); PoolVector<Vector2>::Read pr = p_points.read(); @@ -711,7 +711,7 @@ void TileMapEditor::_fill_points(const PoolVector<Vector2> p_points, const Dicti node->update_dirty_bitmask(); } -void TileMapEditor::_erase_points(const PoolVector<Vector2> p_points) { +void TileMapEditor::_erase_points(const PoolVector<Vector2> &p_points) { int len = p_points.size(); PoolVector<Vector2>::Read pr = p_points.read(); @@ -754,7 +754,7 @@ void TileMapEditor::_erase_selection() { } } -void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i p_autotile_coord, const Transform2D &p_xform) { +void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord, const Transform2D &p_xform) { Ref<Texture> t = node->get_tileset()->tile_get_texture(p_cell); @@ -875,7 +875,7 @@ void TileMapEditor::_draw_cell(Control *p_viewport, int p_cell, const Point2i &p } } -void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i p_autotile_coord, const Transform2D &p_xform) { +void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord, const Transform2D &p_xform) { PoolVector<Vector2> points = _bucket_fill(p_point, false, true); PoolVector<Vector2>::Read pr = points.read(); diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index 3f0abd1e6e..3331fb971f 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -169,14 +169,14 @@ class TileMapEditor : public VBoxContainer { PoolVector<Vector2> _bucket_fill(const Point2i &p_start, bool erase = false, bool preview = false); - void _fill_points(const PoolVector<Vector2> p_points, const Dictionary &p_op); - void _erase_points(const PoolVector<Vector2> p_points); + void _fill_points(const PoolVector<Vector2> &p_points, const Dictionary &p_op); + void _erase_points(const PoolVector<Vector2> &p_points); void _select(const Point2i &p_from, const Point2i &p_to); void _erase_selection(); - void _draw_cell(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i p_autotile_coord, const Transform2D &p_xform); - void _draw_fill_preview(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i p_autotile_coord, const Transform2D &p_xform); + void _draw_cell(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord, const Transform2D &p_xform); + void _draw_fill_preview(Control *p_viewport, int p_cell, const Point2i &p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Point2i &p_autotile_coord, const Transform2D &p_xform); void _clear_bucket_cache(); void _update_copydata(); @@ -200,7 +200,7 @@ class TileMapEditor : public VBoxContainer { void _start_undo(const String &p_action); void _finish_undo(); void _create_set_cell_undo_redo(const Vector2 &p_vec, const CellOp &p_cell_old, const CellOp &p_cell_new); - void _set_cell(const Point2i &p_pos, Vector<int> p_values, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false, const Point2i p_autotile_coord = Point2()); + void _set_cell(const Point2i &p_pos, Vector<int> p_values, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false, const Point2i &p_autotile_coord = Point2()); void _canvas_mouse_enter(); void _canvas_mouse_exit(); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 2b59787f17..f135becf5f 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -1833,7 +1833,7 @@ Vector<Vector2> TileSetEditor::_get_edited_shape_points() { return _get_collision_shape_points(edited_collision_shape); } -void TileSetEditor::_set_edited_shape_points(const Vector<Vector2> points) { +void TileSetEditor::_set_edited_shape_points(const Vector<Vector2> &points) { Ref<ConvexPolygonShape2D> convex = edited_collision_shape; Ref<ConcavePolygonShape2D> concave = edited_collision_shape; if (convex.is_valid()) { diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 04e8d65155..69ad8205a4 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -201,7 +201,7 @@ private: void _on_grid_snap_toggled(bool p_val); Vector<Vector2> _get_collision_shape_points(const Ref<Shape2D> &p_shape); Vector<Vector2> _get_edited_shape_points(); - void _set_edited_shape_points(const Vector<Vector2> points); + void _set_edited_shape_points(const Vector<Vector2> &points); void _update_tile_data(); void _update_toggle_shape_button(); void _select_next_tile(); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 3ab2ae1643..c1debfe482 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1395,7 +1395,7 @@ void VisualShaderEditor::_node_selected(Object *p_node) { //EditorNode::get_singleton()->push_item(vsnode.ptr(), "", true); } -void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> p_event) { +void VisualShaderEditor::_graph_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index fa72b5ec29..4274cc3d76 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -198,7 +198,7 @@ class VisualShaderEditor : public VBoxContainer { void _node_resized(const Vector2 &p_new_size, int p_type, int p_node); void _preview_select_port(int p_node, int p_port); - void _graph_gui_input(const Ref<InputEvent> p_event); + void _graph_gui_input(const Ref<InputEvent> &p_event); void _member_filter_changed(const String &p_text); void _sbox_input(const Ref<InputEvent> &p_ie); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 2cf566941e..5a21833ffa 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -345,7 +345,7 @@ void GridMapEditor::_validate_selection() { _update_selection_transform(); } -void GridMapEditor::_set_selection(bool p_active, const Vector3 p_begin, const Vector3 p_end) { +void GridMapEditor::_set_selection(bool p_active, const Vector3 &p_begin, const Vector3 &p_end) { selection.active = p_active; selection.begin = p_begin; diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index da36165d4e..b9be925ff7 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -222,7 +222,7 @@ class GridMapEditor : public VBoxContainer { void _do_paste(); void _update_selection_transform(); void _validate_selection(); - void _set_selection(bool p_active, const Vector3 p_begin = Vector3(), const Vector3 p_end = Vector3()); + void _set_selection(bool p_active, const Vector3 &p_begin = Vector3(), const Vector3 &p_end = Vector3()); void _floor_changed(float p_value); void _floor_mouse_exited(); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs index a0d14c43c9..f0068385f4 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs @@ -172,7 +172,7 @@ namespace GodotTools.Build if (outputArray.Count == 0) return string.Empty; - var lines = outputArray[1].Split('\n'); + var lines = outputArray[0].Split('\n'); foreach (string line in lines) { diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index e778af3ceb..279253889c 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -173,7 +173,7 @@ void SpinBox::_line_edit_focus_exit() { _text_entered(line_edit->get_text()); } -inline void SpinBox::_adjust_width_for_icon(const Ref<Texture> icon) { +inline void SpinBox::_adjust_width_for_icon(const Ref<Texture> &icon) { int w = icon->get_width(); if (w != last_w) { diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index 49dc6d950c..9cf977d2d6 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -62,7 +62,7 @@ class SpinBox : public Range { void _line_edit_focus_exit(); - inline void _adjust_width_for_icon(const Ref<Texture> icon); + inline void _adjust_width_for_icon(const Ref<Texture> &icon); protected: void _gui_input(const Ref<InputEvent> &p_event); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 5888760973..cf1bd96483 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1759,7 +1759,7 @@ bool Node::has_persistent_groups() const { return false; } -void Node::_print_tree_pretty(const String prefix, const bool last) { +void Node::_print_tree_pretty(const String &prefix, const bool last) { String new_prefix = last ? String::utf8(" ┖╴") : String::utf8(" ┠╴"); print_line(prefix + new_prefix + String(get_name())); diff --git a/scene/main/node.h b/scene/main/node.h index 9b9ca06455..982bfcd620 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -152,7 +152,7 @@ private: Ref<MultiplayerAPI> multiplayer; - void _print_tree_pretty(const String prefix, const bool last); + void _print_tree_pretty(const String &prefix, const bool last); void _print_tree(const Node *p_node); Node *_get_child_by_name(const StringName &p_name) const; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 0940a59a82..5eeaff6411 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1249,7 +1249,7 @@ void SceneTree::_update_root_rect() { } } -void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, real_t p_shrink) { +void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 &p_minsize, real_t p_shrink) { stretch_mode = p_mode; stretch_aspect = p_aspect; diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 0bcb724929..98f2fe5e35 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -386,7 +386,7 @@ public: void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list); bool has_group(const StringName &p_identifier) const; - void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 p_minsize, real_t p_shrink = 1); + void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 &p_minsize, real_t p_shrink = 1); void set_use_font_oversampling(bool p_oversampling); bool is_using_font_oversampling() const; diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index af2a8c931f..64051fe304 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -863,7 +863,7 @@ Error Animation::transform_track_get_key(int p_track, int p_key, Vector3 *r_loc, return OK; } -int Animation::transform_track_insert_key(int p_track, float p_time, const Vector3 p_loc, const Quat &p_rot, const Vector3 &p_scale) { +int Animation::transform_track_insert_key(int p_track, float p_time, const Vector3 &p_loc, const Quat &p_rot, const Vector3 &p_scale) { ERR_FAIL_INDEX_V(p_track, tracks.size(), -1); Track *t = tracks[p_track]; diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 59f2ae24c7..6fff77d746 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -314,7 +314,7 @@ public: float track_get_key_time(int p_track, int p_key_idx) const; float track_get_key_transition(int p_track, int p_key_idx) const; - int transform_track_insert_key(int p_track, float p_time, const Vector3 p_loc, const Quat &p_rot = Quat(), const Vector3 &p_scale = Vector3()); + int transform_track_insert_key(int p_track, float p_time, const Vector3 &p_loc, const Quat &p_rot = Quat(), const Vector3 &p_scale = Vector3()); Error transform_track_get_key(int p_track, int p_key, Vector3 *r_loc, Quat *r_rot, Vector3 *r_scale) const; void track_set_interpolation_type(int p_track, InterpolationType p_interp); InterpolationType track_get_interpolation_type(int p_track) const; diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 2588e41951..b294991248 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -769,7 +769,7 @@ void SurfaceTool::create_from(const Ref<Mesh> &p_existing, int p_surface) { material = p_existing->surface_get_material(p_surface); } -void SurfaceTool::create_from_blend_shape(const Ref<Mesh> &p_existing, int p_surface, const String p_blend_shape_name) { +void SurfaceTool::create_from_blend_shape(const Ref<Mesh> &p_existing, int p_surface, const String &p_blend_shape_name) { clear(); primitive = p_existing->surface_get_primitive_type(p_surface); Array arr = p_existing->surface_get_blend_shape_arrays(p_surface); diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index c4c71dca13..e3aec6ce0e 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -136,7 +136,7 @@ public: static Vector<Vertex> create_vertex_array_from_triangle_arrays(const Array &p_arrays); Array commit_to_arrays(); void create_from(const Ref<Mesh> &p_existing, int p_surface); - void create_from_blend_shape(const Ref<Mesh> &p_existing, int p_surface, const String p_blend_shape_name); + void create_from_blend_shape(const Ref<Mesh> &p_existing, int p_surface, const String &p_blend_shape_name); void append_from(const Ref<Mesh> &p_existing, int p_surface, const Transform &p_xform); Ref<ArrayMesh> commit(const Ref<ArrayMesh> &p_existing = Ref<ArrayMesh>(), uint32_t p_flags = Mesh::ARRAY_COMPRESS_DEFAULT); diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp index aabe617a8a..cbda3556c5 100644 --- a/servers/arvr/arvr_positional_tracker.cpp +++ b/servers/arvr/arvr_positional_tracker.cpp @@ -79,7 +79,7 @@ ARVRServer::TrackerType ARVRPositionalTracker::get_type() const { return type; }; -void ARVRPositionalTracker::set_name(const String p_name) { +void ARVRPositionalTracker::set_name(const String &p_name) { name = p_name; }; diff --git a/servers/arvr/arvr_positional_tracker.h b/servers/arvr/arvr_positional_tracker.h index 0d6a69540f..775579b089 100644 --- a/servers/arvr/arvr_positional_tracker.h +++ b/servers/arvr/arvr_positional_tracker.h @@ -73,7 +73,7 @@ protected: public: void set_type(ARVRServer::TrackerType p_type); ARVRServer::TrackerType get_type() const; - void set_name(const String p_name); + void set_name(const String &p_name); StringName get_name() const; int get_tracker_id() const; void set_joy_id(int p_joy_id); diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index 7d89764d20..f7ce1d3c5d 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -100,7 +100,7 @@ Transform ARVRServer::get_world_origin() const { return world_origin; }; -void ARVRServer::set_world_origin(const Transform p_world_origin) { +void ARVRServer::set_world_origin(const Transform &p_world_origin) { world_origin = p_world_origin; }; diff --git a/servers/arvr_server.h b/servers/arvr_server.h index e7d635a8d9..c0301ebaab 100644 --- a/servers/arvr_server.h +++ b/servers/arvr_server.h @@ -123,7 +123,7 @@ public: and in the virtual world out of sync */ Transform get_world_origin() const; - void set_world_origin(const Transform p_world_origin); + void set_world_origin(const Transform &p_world_origin); /* center_on_hmd calculates a new reference frame. This ensures the HMD is positioned to 0,0,0 facing 0,0,-1 (need to verify this direction) |