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/3d/cpu_particles_3d.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/3d/cpu_particles_3d.cpp')
| -rw-r--r-- | scene/3d/cpu_particles_3d.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 631ab4e0f7..cd80607692 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -38,6 +38,7 @@ AABB CPUParticles3D::get_aabb() const { return AABB(); } + Vector<Face3> CPUParticles3D::get_faces(uint32_t p_usage_flags) const { return Vector<Face3>(); } @@ -74,6 +75,7 @@ void CPUParticles3D::set_amount(int p_amount) { particle_order.resize(p_amount); } + void CPUParticles3D::set_lifetime(float p_lifetime) { ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0."); lifetime = p_lifetime; @@ -86,18 +88,23 @@ void CPUParticles3D::set_one_shot(bool p_one_shot) { void CPUParticles3D::set_pre_process_time(float p_time) { pre_process_time = p_time; } + void CPUParticles3D::set_explosiveness_ratio(float p_ratio) { explosiveness_ratio = p_ratio; } + void CPUParticles3D::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; } + void CPUParticles3D::set_lifetime_randomness(float p_random) { lifetime_randomness = p_random; } + void CPUParticles3D::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; } + void CPUParticles3D::set_speed_scale(float p_scale) { speed_scale = p_scale; } @@ -105,12 +112,15 @@ void CPUParticles3D::set_speed_scale(float p_scale) { bool CPUParticles3D::is_emitting() const { return emitting; } + int CPUParticles3D::get_amount() const { return particles.size(); } + float CPUParticles3D::get_lifetime() const { return lifetime; } + bool CPUParticles3D::get_one_shot() const { return one_shot; } @@ -118,12 +128,15 @@ bool CPUParticles3D::get_one_shot() const { float CPUParticles3D::get_pre_process_time() const { return pre_process_time; } + float CPUParticles3D::get_explosiveness_ratio() const { return explosiveness_ratio; } + float CPUParticles3D::get_randomness_ratio() const { return randomness_ratio; } + float CPUParticles3D::get_lifetime_randomness() const { return lifetime_randomness; } @@ -246,6 +259,7 @@ float CPUParticles3D::get_spread() const { void CPUParticles3D::set_flatness(float p_flatness) { flatness = p_flatness; } + float CPUParticles3D::get_flatness() const { return flatness; } @@ -255,6 +269,7 @@ void CPUParticles3D::set_param(Parameter p_param, float p_value) { parameters[p_param] = p_value; } + float CPUParticles3D::get_param(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); @@ -266,6 +281,7 @@ void CPUParticles3D::set_param_randomness(Parameter p_param, float p_value) { randomness[p_param] = p_value; } + float CPUParticles3D::get_param_randomness(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); @@ -324,6 +340,7 @@ void CPUParticles3D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv } } } + Ref<Curve> CPUParticles3D::get_param_curve(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, Ref<Curve>()); @@ -387,12 +404,15 @@ void CPUParticles3D::set_emission_colors(const Vector<Color> &p_colors) { float CPUParticles3D::get_emission_sphere_radius() const { return emission_sphere_radius; } + Vector3 CPUParticles3D::get_emission_box_extents() const { return emission_box_extents; } + Vector<Vector3> CPUParticles3D::get_emission_points() const { return emission_points; } + Vector<Vector3> CPUParticles3D::get_emission_normals() const { return emission_normals; } @@ -404,6 +424,7 @@ Vector<Color> CPUParticles3D::get_emission_colors() const { CPUParticles3D::EmissionShape CPUParticles3D::get_emission_shape() const { return emission_shape; } + void CPUParticles3D::set_gravity(const Vector3 &p_gravity) { gravity = p_gravity; } |
