diff --git a/areas/world_area.cpp b/areas/world_area.cpp index e09683c..22abcd1 100644 --- a/areas/world_area.cpp +++ b/areas/world_area.cpp @@ -32,21 +32,21 @@ void WorldArea::set_aabb(const AABB value) { Ref WorldArea::get_map_texture() const { return _map_texture; } -void WorldArea::set_map_texture(const Ref value) { +void WorldArea::set_map_texture(const Ref &value) { _map_texture = value; } Ref WorldArea::get_fov_texture() const { return _fov_texture; } -void WorldArea::set_fov_texture(const Ref value) { +void WorldArea::set_fov_texture(const Ref &value) { _fov_texture = value; } String WorldArea::get_name() const { return _name; } -void WorldArea::set_name(const String value) { +void WorldArea::set_name(const String &value) { _name = value; } diff --git a/areas/world_area.h b/areas/world_area.h index 940c8d2..6105412 100644 --- a/areas/world_area.h +++ b/areas/world_area.h @@ -37,13 +37,13 @@ public: void set_aabb(const AABB value); Ref get_map_texture() const; - void set_map_texture(const Ref value); + void set_map_texture(const Ref &value); Ref get_fov_texture() const; - void set_fov_texture(const Ref value); + void set_fov_texture(const Ref &value); String get_name() const; - void set_name(const String value); + void set_name(const String &value); int get_level() const; void set_level(const int value); diff --git a/data/voxel_light.cpp b/data/voxel_light.cpp index 371d895..e0df386 100644 --- a/data/voxel_light.cpp +++ b/data/voxel_light.cpp @@ -43,7 +43,7 @@ void VoxelLight::set_world_position(const int x, const int y, const int z) { _FORCE_INLINE_ Color VoxelLight::get_color() const { return _color; } -void VoxelLight::set_color(Color color) { +void VoxelLight::set_color(const Color &color) { _color = color; } diff --git a/data/voxel_light.h b/data/voxel_light.h index b794aa9..4374ae8 100644 --- a/data/voxel_light.h +++ b/data/voxel_light.h @@ -38,7 +38,7 @@ public: void set_world_position(const int x, const int y, const int z); Color get_color() const; - void set_color(const Color color); + void set_color(const Color &color); float get_size() const; void set_size(const float strength); diff --git a/library/voxel_surface.cpp b/library/voxel_surface.cpp index 380e1e8..488e68d 100644 --- a/library/voxel_surface.cpp +++ b/library/voxel_surface.cpp @@ -46,7 +46,7 @@ void VoxelSurface::set_transparent(const bool transparent) { Rect2 VoxelSurface::get_rect(const VoxelSurfaceSides side) const { return _rects[side]; } -void VoxelSurface::set_rect(const VoxelSurfaceSides side, const Rect2 rect) { +void VoxelSurface::set_rect(const VoxelSurfaceSides side, const Rect2 &rect) { _rects[side] = rect; } @@ -58,7 +58,7 @@ void VoxelSurface::set_library(Ref library) { _library = (*library); } -_FORCE_INLINE_ Vector2 VoxelSurface::transform_uv(const VoxelSurfaceSides p_side, const Vector2 p_uv) const { +_FORCE_INLINE_ Vector2 VoxelSurface::transform_uv(const VoxelSurfaceSides p_side, const Vector2 &p_uv) const { Vector2 uv = p_uv; Rect2 r = _rects[p_side]; @@ -71,7 +71,7 @@ _FORCE_INLINE_ Vector2 VoxelSurface::transform_uv(const VoxelSurfaceSides p_side return uv; } -_FORCE_INLINE_ Vector2 VoxelSurface::transform_uv_scaled(const VoxelSurfaceSides p_side, const Vector2 p_uv, int p_current_x, int p_current_y, int p_max) const { +_FORCE_INLINE_ Vector2 VoxelSurface::transform_uv_scaled(const VoxelSurfaceSides p_side, const Vector2 &p_uv, const int p_current_x, const int p_current_y, const int p_max) const { Vector2 uv = p_uv; Rect2 r = _rects[p_side]; diff --git a/library/voxel_surface.h b/library/voxel_surface.h index fad4629..e2382ea 100644 --- a/library/voxel_surface.h +++ b/library/voxel_surface.h @@ -74,13 +74,13 @@ public: void set_transparent(const bool transparent); Rect2 get_rect(const VoxelSurfaceSides side) const; - void set_rect(const VoxelSurfaceSides side, const Rect2 rect); + void set_rect(const VoxelSurfaceSides side, const Rect2 &rect); Ref get_library() const; void set_library(Ref library); - Vector2 transform_uv(const VoxelSurfaceSides p_side, const Vector2 p_uv) const; - Vector2 transform_uv_scaled(const VoxelSurfaceSides p_side, const Vector2 p_uv, int p_current_x, int p_current_y, int p_max) const; + Vector2 transform_uv(const VoxelSurfaceSides p_side, const Vector2 &p_uv) const; + Vector2 transform_uv_scaled(const VoxelSurfaceSides p_side, const Vector2 &p_uv, const int p_current_x, const int p_current_y, const int p_max) const; virtual void refresh_rects(); diff --git a/library/voxel_surface_merger.cpp b/library/voxel_surface_merger.cpp index f49848b..81e621d 100644 --- a/library/voxel_surface_merger.cpp +++ b/library/voxel_surface_merger.cpp @@ -35,14 +35,14 @@ typedef class StandardMaterial3D SpatialMaterial; Ref VoxelSurfaceMerger::get_region(const VoxelSurfaceSides side) { return _regions[side]; } -void VoxelSurfaceMerger::set_region(const VoxelSurfaceSides side, Ref texture) { +void VoxelSurfaceMerger::set_region(const VoxelSurfaceSides side, const Ref &texture) { _regions[side] = texture; } Ref VoxelSurfaceMerger::get_texture(const VoxelSurfaceSides side) { return _textures[side]; } -void VoxelSurfaceMerger::set_texture(const VoxelSurfaceSides side, Ref texture) { +void VoxelSurfaceMerger::set_texture(const VoxelSurfaceSides side, const Ref &texture) { _textures[side] = texture; } diff --git a/library/voxel_surface_merger.h b/library/voxel_surface_merger.h index 916f480..61b6eec 100644 --- a/library/voxel_surface_merger.h +++ b/library/voxel_surface_merger.h @@ -40,10 +40,10 @@ class VoxelSurfaceMerger : public VoxelSurface { public: Ref get_region(const VoxelSurfaceSides side); - void set_region(const VoxelSurfaceSides side, Ref texture); + void set_region(const VoxelSurfaceSides side, const Ref &texture); Ref get_texture(const VoxelSurfaceSides side); - void set_texture(const VoxelSurfaceSides side, Ref texture); + void set_texture(const VoxelSurfaceSides side, const Ref &texture); void refresh_rects(); diff --git a/library/voxelman_library_merger.cpp b/library/voxelman_library_merger.cpp index 9cd3c7d..5b9ab18 100644 --- a/library/voxelman_library_merger.cpp +++ b/library/voxelman_library_merger.cpp @@ -55,7 +55,7 @@ void VoxelmanLibraryMerger::set_keep_original_atlases(const bool value) { Color VoxelmanLibraryMerger::get_background_color() const { return _packer->get_background_color(); } -void VoxelmanLibraryMerger::set_background_color(const Color color) { +void VoxelmanLibraryMerger::set_background_color(const Color &color) { _packer->set_background_color(color); } @@ -252,7 +252,7 @@ void VoxelmanLibraryMerger::add_prop(Ref value) { ////_props[value->get_id()] = value; } -void VoxelmanLibraryMerger::set_prop(const int id, Ref value) { +void VoxelmanLibraryMerger::set_prop(const int id, const Ref &value) { //_props[value->get_id()] = value; } void VoxelmanLibraryMerger::remove_prop(const int id) { @@ -335,7 +335,7 @@ void VoxelmanLibraryMerger::refresh_rects() { } } -void VoxelmanLibraryMerger::_setup_material_albedo(int material_index, Ref texture) { +void VoxelmanLibraryMerger::_setup_material_albedo(const int material_index, const Ref &texture) { Ref mat; int count = 0; diff --git a/library/voxelman_library_merger.h b/library/voxelman_library_merger.h index a0b55b5..7c744eb 100644 --- a/library/voxelman_library_merger.h +++ b/library/voxelman_library_merger.h @@ -50,7 +50,7 @@ public: void set_keep_original_atlases(const bool value); Color get_background_color() const; - void set_background_color(const Color color); + void set_background_color(const Color &color); int get_margin() const; void set_margin(const int margin); @@ -77,7 +77,7 @@ public: Ref get_prop(const int id); void add_prop(Ref value); - void set_prop(const int id, Ref value); + void set_prop(const int id, const Ref &value); void remove_prop(const int id); int get_num_props() const; void clear_props(); @@ -87,7 +87,7 @@ public: void refresh_rects(); - void _setup_material_albedo(int material_index, Ref texture); + void _setup_material_albedo(const int material_index, const Ref &texture); VoxelmanLibraryMerger(); ~VoxelmanLibraryMerger(); diff --git a/world/environment_data.cpp b/world/environment_data.cpp index d4b0ca8..2660862 100644 --- a/world/environment_data.cpp +++ b/world/environment_data.cpp @@ -31,36 +31,36 @@ SOFTWARE. Ref EnvironmentData::get_environment() { return _environment; } -void EnvironmentData::set_environment(Ref value) { +void EnvironmentData::set_environment(const Ref &value) { _environment = value; } -Color EnvironmentData::get_color(int index) { +Color EnvironmentData::get_color(const int index) { ERR_FAIL_INDEX_V(index, LIGHT_COUNT, Color()); return _colors[index]; } -void EnvironmentData::set_color(int index, Color value) { +void EnvironmentData::set_color(const int index, const Color &value) { ERR_FAIL_INDEX(index, LIGHT_COUNT); _colors[index] = value; } -float EnvironmentData::get_energy(int index) { +float EnvironmentData::get_energy(const int index) { ERR_FAIL_INDEX_V(index, LIGHT_COUNT, 0); return _energies[index]; } -void EnvironmentData::set_energy(int index, float value) { +void EnvironmentData::set_energy(const int index, const float value) { ERR_FAIL_INDEX(index, LIGHT_COUNT); _energies[index] = value; } -float EnvironmentData::get_indirect_energy(int index) { +float EnvironmentData::get_indirect_energy(const int index) { ERR_FAIL_INDEX_V(index, LIGHT_COUNT, 0); return _indirect_energies[index]; } -void EnvironmentData::set_indirect_energy(int index, float value) { +void EnvironmentData::set_indirect_energy(const int index, const float value) { ERR_FAIL_INDEX(index, LIGHT_COUNT); _indirect_energies[index] = value; diff --git a/world/environment_data.h b/world/environment_data.h index 369171b..b8b0fed 100644 --- a/world/environment_data.h +++ b/world/environment_data.h @@ -44,14 +44,14 @@ class EnvironmentData : public Resource { public: Ref get_environment(); - void set_environment(Ref value); + void set_environment(const Ref &value); - Color get_color(int index); - void set_color(int index, Color value); - float get_energy(int index); - void set_energy(int index, float value); - float get_indirect_energy(int index); - void set_indirect_energy(int index, float value); + Color get_color(const int index); + void set_color(const int index, const Color &value); + float get_energy(const int index); + void set_energy(const int index, const float value); + float get_indirect_energy(const int index); + void set_indirect_energy(const int index, const float value); void setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light); void setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light);