From 07bc4e2f96f8f47991339654ff4ab16acc19d44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 14:29:06 +0200 Subject: 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. --- scene/3d/gpu_particles_3d.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scene/3d/gpu_particles_3d.cpp') diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 1ce25f1e6e..a87b57bd4d 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -38,6 +38,7 @@ AABB GPUParticles3D::get_aabb() const { return AABB(); } + Vector GPUParticles3D::get_faces(uint32_t p_usage_flags) const { return Vector(); } @@ -57,6 +58,7 @@ void GPUParticles3D::set_amount(int p_amount) { amount = p_amount; RS::get_singleton()->particles_set_amount(particles, amount); } + void GPUParticles3D::set_lifetime(float p_lifetime) { ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0."); lifetime = p_lifetime; @@ -81,24 +83,29 @@ void GPUParticles3D::set_pre_process_time(float p_time) { pre_process_time = p_time; RS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time); } + void GPUParticles3D::set_explosiveness_ratio(float p_ratio) { explosiveness_ratio = p_ratio; RS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio); } + void GPUParticles3D::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; RS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio); } + void GPUParticles3D::set_visibility_aabb(const AABB &p_aabb) { visibility_aabb = p_aabb; RS::get_singleton()->particles_set_custom_aabb(particles, visibility_aabb); update_gizmo(); _change_notify("visibility_aabb"); } + void GPUParticles3D::set_use_local_coordinates(bool p_enable) { local_coords = p_enable; RS::get_singleton()->particles_set_use_local_coordinates(particles, local_coords); } + void GPUParticles3D::set_process_material(const Ref &p_material) { process_material = p_material; RID material_rid; @@ -117,12 +124,15 @@ void GPUParticles3D::set_speed_scale(float p_scale) { bool GPUParticles3D::is_emitting() const { return RS::get_singleton()->particles_get_emitting(particles); } + int GPUParticles3D::get_amount() const { return amount; } + float GPUParticles3D::get_lifetime() const { return lifetime; } + bool GPUParticles3D::get_one_shot() const { return one_shot; } @@ -130,18 +140,23 @@ bool GPUParticles3D::get_one_shot() const { float GPUParticles3D::get_pre_process_time() const { return pre_process_time; } + float GPUParticles3D::get_explosiveness_ratio() const { return explosiveness_ratio; } + float GPUParticles3D::get_randomness_ratio() const { return randomness_ratio; } + AABB GPUParticles3D::get_visibility_aabb() const { return visibility_aabb; } + bool GPUParticles3D::get_use_local_coordinates() const { return local_coords; } + Ref GPUParticles3D::get_process_material() const { return process_material; } @@ -165,6 +180,7 @@ void GPUParticles3D::set_draw_passes(int p_count) { RS::get_singleton()->particles_set_draw_passes(particles, p_count); _change_notify(); } + int GPUParticles3D::get_draw_passes() const { return draw_passes.size(); } -- cgit v1.2.3