Merge pull request #30455 from qarmin/const_reference

Pass by reference to const
This commit is contained in:
Rémi Verschelde 2019-07-10 15:43:15 +02:00 committed by GitHub
commit 34d7484039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 82 additions and 82 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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());

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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) {

View File

@ -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();

View File

@ -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>());

View File

@ -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

View File

@ -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)) {

View File

@ -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();

View File

@ -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));

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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()) {

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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) {

View File

@ -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);

View File

@ -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()));

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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];

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;
};

View File

@ -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);

View File

@ -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;
};

View File

@ -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)