mirror of
https://github.com/Relintai/voxelman.git
synced 2024-11-12 10:15:12 +01:00
More const qualifiers.
This commit is contained in:
parent
367c203cc6
commit
b21030ae89
@ -32,21 +32,21 @@ void WorldArea::set_aabb(const AABB value) {
|
||||
Ref<Texture> WorldArea::get_map_texture() const {
|
||||
return _map_texture;
|
||||
}
|
||||
void WorldArea::set_map_texture(const Ref<Texture> value) {
|
||||
void WorldArea::set_map_texture(const Ref<Texture> &value) {
|
||||
_map_texture = value;
|
||||
}
|
||||
|
||||
Ref<Texture> WorldArea::get_fov_texture() const {
|
||||
return _fov_texture;
|
||||
}
|
||||
void WorldArea::set_fov_texture(const Ref<Texture> value) {
|
||||
void WorldArea::set_fov_texture(const Ref<Texture> &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;
|
||||
}
|
||||
|
||||
|
@ -37,13 +37,13 @@ public:
|
||||
void set_aabb(const AABB value);
|
||||
|
||||
Ref<Texture> get_map_texture() const;
|
||||
void set_map_texture(const Ref<Texture> value);
|
||||
void set_map_texture(const Ref<Texture> &value);
|
||||
|
||||
Ref<Texture> get_fov_texture() const;
|
||||
void set_fov_texture(const Ref<Texture> value);
|
||||
void set_fov_texture(const Ref<Texture> &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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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<VoxelmanLibrary> 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];
|
||||
|
@ -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<VoxelmanLibrary> get_library() const;
|
||||
void set_library(Ref<VoxelmanLibrary> 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();
|
||||
|
||||
|
@ -35,14 +35,14 @@ typedef class StandardMaterial3D SpatialMaterial;
|
||||
Ref<AtlasTexture> VoxelSurfaceMerger::get_region(const VoxelSurfaceSides side) {
|
||||
return _regions[side];
|
||||
}
|
||||
void VoxelSurfaceMerger::set_region(const VoxelSurfaceSides side, Ref<AtlasTexture> texture) {
|
||||
void VoxelSurfaceMerger::set_region(const VoxelSurfaceSides side, const Ref<AtlasTexture> &texture) {
|
||||
_regions[side] = texture;
|
||||
}
|
||||
|
||||
Ref<Texture> VoxelSurfaceMerger::get_texture(const VoxelSurfaceSides side) {
|
||||
return _textures[side];
|
||||
}
|
||||
void VoxelSurfaceMerger::set_texture(const VoxelSurfaceSides side, Ref<Texture> texture) {
|
||||
void VoxelSurfaceMerger::set_texture(const VoxelSurfaceSides side, const Ref<Texture> &texture) {
|
||||
_textures[side] = texture;
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ class VoxelSurfaceMerger : public VoxelSurface {
|
||||
|
||||
public:
|
||||
Ref<AtlasTexture> get_region(const VoxelSurfaceSides side);
|
||||
void set_region(const VoxelSurfaceSides side, Ref<AtlasTexture> texture);
|
||||
void set_region(const VoxelSurfaceSides side, const Ref<AtlasTexture> &texture);
|
||||
|
||||
Ref<Texture> get_texture(const VoxelSurfaceSides side);
|
||||
void set_texture(const VoxelSurfaceSides side, Ref<Texture> texture);
|
||||
void set_texture(const VoxelSurfaceSides side, const Ref<Texture> &texture);
|
||||
|
||||
void refresh_rects();
|
||||
|
||||
|
@ -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<PackedScene> value) {
|
||||
|
||||
////_props[value->get_id()] = value;
|
||||
}
|
||||
void VoxelmanLibraryMerger::set_prop(const int id, Ref<PackedScene> value) {
|
||||
void VoxelmanLibraryMerger::set_prop(const int id, const Ref<PackedScene> &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> texture) {
|
||||
void VoxelmanLibraryMerger::_setup_material_albedo(const int material_index, const Ref<Texture> &texture) {
|
||||
Ref<SpatialMaterial> mat;
|
||||
|
||||
int count = 0;
|
||||
|
@ -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<PackedScene> get_prop(const int id);
|
||||
void add_prop(Ref<PackedScene> value);
|
||||
void set_prop(const int id, Ref<PackedScene> value);
|
||||
void set_prop(const int id, const Ref<PackedScene> &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> texture);
|
||||
void _setup_material_albedo(const int material_index, const Ref<Texture> &texture);
|
||||
|
||||
VoxelmanLibraryMerger();
|
||||
~VoxelmanLibraryMerger();
|
||||
|
@ -31,36 +31,36 @@ SOFTWARE.
|
||||
Ref<Environment> EnvironmentData::get_environment() {
|
||||
return _environment;
|
||||
}
|
||||
void EnvironmentData::set_environment(Ref<Environment> value) {
|
||||
void EnvironmentData::set_environment(const Ref<Environment> &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;
|
||||
|
@ -44,14 +44,14 @@ class EnvironmentData : public Resource {
|
||||
|
||||
public:
|
||||
Ref<Environment> get_environment();
|
||||
void set_environment(Ref<Environment> value);
|
||||
void set_environment(const Ref<Environment> &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);
|
||||
|
Loading…
Reference in New Issue
Block a user