diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 14:29:06 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch) | |
tree | 43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/resources/sky_material.cpp | |
parent | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff) | |
download | redot-engine-07bc4e2f96f8f47991339654ff4ab16acc19d44f.tar.gz |
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
-o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
-o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```
This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.
This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.
Part of #33027.
Diffstat (limited to 'scene/resources/sky_material.cpp')
-rw-r--r-- | scene/resources/sky_material.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index 860673bee6..92c5151d7a 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -43,6 +43,7 @@ void ProceduralSkyMaterial::set_sky_horizon_color(const Color &p_sky_horizon) { sky_horizon_color = p_sky_horizon; RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear()); } + Color ProceduralSkyMaterial::get_sky_horizon_color() const { return sky_horizon_color; } @@ -51,6 +52,7 @@ void ProceduralSkyMaterial::set_sky_curve(float p_curve) { sky_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sky_curve", sky_curve); } + float ProceduralSkyMaterial::get_sky_curve() const { return sky_curve; } @@ -59,6 +61,7 @@ void ProceduralSkyMaterial::set_sky_energy(float p_energy) { sky_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "sky_energy", sky_energy); } + float ProceduralSkyMaterial::get_sky_energy() const { return sky_energy; } @@ -67,6 +70,7 @@ void ProceduralSkyMaterial::set_ground_bottom_color(const Color &p_ground_bottom ground_bottom_color = p_ground_bottom; RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear()); } + Color ProceduralSkyMaterial::get_ground_bottom_color() const { return ground_bottom_color; } @@ -75,6 +79,7 @@ void ProceduralSkyMaterial::set_ground_horizon_color(const Color &p_ground_horiz ground_horizon_color = p_ground_horizon; RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear()); } + Color ProceduralSkyMaterial::get_ground_horizon_color() const { return ground_horizon_color; } @@ -83,6 +88,7 @@ void ProceduralSkyMaterial::set_ground_curve(float p_curve) { ground_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "ground_curve", ground_curve); } + float ProceduralSkyMaterial::get_ground_curve() const { return ground_curve; } @@ -91,6 +97,7 @@ void ProceduralSkyMaterial::set_ground_energy(float p_energy) { ground_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "ground_energy", ground_energy); } + float ProceduralSkyMaterial::get_ground_energy() const { return ground_energy; } @@ -99,6 +106,7 @@ void ProceduralSkyMaterial::set_sun_angle_max(float p_angle) { sun_angle_max = p_angle; RS::get_singleton()->material_set_param(_get_material(), "sun_angle_max", Math::deg2rad(sun_angle_max)); } + float ProceduralSkyMaterial::get_sun_angle_max() const { return sun_angle_max; } @@ -107,6 +115,7 @@ void ProceduralSkyMaterial::set_sun_curve(float p_curve) { sun_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sun_curve", sun_curve); } + float ProceduralSkyMaterial::get_sun_curve() const { return sun_curve; } @@ -307,6 +316,7 @@ PanoramaSkyMaterial::~PanoramaSkyMaterial() { RS::get_singleton()->free(shader); RS::get_singleton()->material_set_shader(_get_material(), RID()); } + ////////////////////////////////// /* PhysicalSkyMaterial */ @@ -314,6 +324,7 @@ void PhysicalSkyMaterial::set_rayleigh_coefficient(float p_rayleigh) { rayleigh = p_rayleigh; RS::get_singleton()->material_set_param(_get_material(), "rayleigh", rayleigh); } + float PhysicalSkyMaterial::get_rayleigh_coefficient() const { return rayleigh; } @@ -322,6 +333,7 @@ void PhysicalSkyMaterial::set_rayleigh_color(Color p_rayleigh_color) { rayleigh_color = p_rayleigh_color; RS::get_singleton()->material_set_param(_get_material(), "rayleigh_color", rayleigh_color); } + Color PhysicalSkyMaterial::get_rayleigh_color() const { return rayleigh_color; } @@ -330,6 +342,7 @@ void PhysicalSkyMaterial::set_mie_coefficient(float p_mie) { mie = p_mie; RS::get_singleton()->material_set_param(_get_material(), "mie", mie); } + float PhysicalSkyMaterial::get_mie_coefficient() const { return mie; } @@ -338,6 +351,7 @@ void PhysicalSkyMaterial::set_mie_eccentricity(float p_eccentricity) { mie_eccentricity = p_eccentricity; RS::get_singleton()->material_set_param(_get_material(), "mie_eccentricity", mie_eccentricity); } + float PhysicalSkyMaterial::get_mie_eccentricity() const { return mie_eccentricity; } @@ -346,6 +360,7 @@ void PhysicalSkyMaterial::set_mie_color(Color p_mie_color) { mie_color = p_mie_color; RS::get_singleton()->material_set_param(_get_material(), "mie_color", mie_color); } + Color PhysicalSkyMaterial::get_mie_color() const { return mie_color; } @@ -354,6 +369,7 @@ void PhysicalSkyMaterial::set_turbidity(float p_turbidity) { turbidity = p_turbidity; RS::get_singleton()->material_set_param(_get_material(), "turbidity", turbidity); } + float PhysicalSkyMaterial::get_turbidity() const { return turbidity; } @@ -362,6 +378,7 @@ void PhysicalSkyMaterial::set_sun_disk_scale(float p_sun_disk_scale) { sun_disk_scale = p_sun_disk_scale; RS::get_singleton()->material_set_param(_get_material(), "sun_disk_scale", sun_disk_scale); } + float PhysicalSkyMaterial::get_sun_disk_scale() const { return sun_disk_scale; } @@ -370,6 +387,7 @@ void PhysicalSkyMaterial::set_ground_color(Color p_ground_color) { ground_color = p_ground_color; RS::get_singleton()->material_set_param(_get_material(), "ground_color", ground_color); } + Color PhysicalSkyMaterial::get_ground_color() const { return ground_color; } @@ -378,6 +396,7 @@ void PhysicalSkyMaterial::set_exposure(float p_exposure) { exposure = p_exposure; RS::get_singleton()->material_set_param(_get_material(), "exposure", exposure); } + float PhysicalSkyMaterial::get_exposure() const { return exposure; } @@ -386,6 +405,7 @@ void PhysicalSkyMaterial::set_dither_strength(float p_dither_strength) { dither_strength = p_dither_strength; RS::get_singleton()->material_set_param(_get_material(), "dither_strength", dither_strength); } + float PhysicalSkyMaterial::get_dither_strength() const { return dither_strength; } |