summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-10 12:56:01 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-10 13:12:16 +0200
commite956e80c1fa1cc8aefcb1533e5acf5cf3c8ffdd9 (patch)
tree8f162f9162ca0dfa35841a9c734a0529764cb458 /scene/2d
parent03b13e0c695bb63043c3ca8665083bae1960aca4 (diff)
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/cpu_particles_2d.cpp6
-rw-r--r--scene/2d/navigation_agent_2d.cpp9
-rw-r--r--scene/2d/physics_body_2d.cpp3
-rw-r--r--scene/2d/tile_map.cpp3
4 files changed, 14 insertions, 7 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index 0a6b091a51..c37cd398c4 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -961,7 +961,8 @@ void CPUParticles2D::_particles_process(float p_delta) {
//scale by scale
float base_scale = tex_scale * Math::lerp(parameters[PARAM_SCALE], 1.0f, p.scale_rand * randomness[PARAM_SCALE]);
- if (base_scale < 0.000001) base_scale = 0.000001;
+ if (base_scale < 0.000001)
+ base_scale = 0.000001;
p.transform.elements[0] *= base_scale;
p.transform.elements[1] *= base_scale;
@@ -1196,7 +1197,8 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) {
set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \
{ \
Ref<CurveTexture> ctex = material->get_param_texture(ParticlesMaterial::m_param); \
- if (ctex.is_valid()) set_param_curve(m_param, ctex->get_curve()); \
+ if (ctex.is_valid()) \
+ set_param_curve(m_param, ctex->get_curve()); \
} \
set_param_randomness(m_param, material->get_param_randomness(ParticlesMaterial::m_param));
diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp
index 32da46e8a8..df23a40721 100644
--- a/scene/2d/navigation_agent_2d.cpp
+++ b/scene/2d/navigation_agent_2d.cpp
@@ -288,9 +288,12 @@ String NavigationAgent2D::get_configuration_warning() const {
void NavigationAgent2D::update_navigation() {
- if (agent_parent == nullptr) return;
- if (navigation == nullptr) return;
- if (update_frame_id == Engine::get_singleton()->get_physics_frames()) return;
+ if (agent_parent == nullptr)
+ return;
+ if (navigation == nullptr)
+ return;
+ if (update_frame_id == Engine::get_singleton()->get_physics_frames())
+ return;
update_frame_id = Engine::get_singleton()->get_physics_frames();
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index de15f0efc2..4198eb6c06 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1394,7 +1394,8 @@ Vector2 KinematicCollision2D::get_remainder() const {
return collision.remainder;
}
Object *KinematicCollision2D::get_local_shape() const {
- if (!owner) return nullptr;
+ if (!owner)
+ return nullptr;
uint32_t ownerid = owner->shape_find_owner(collision.local_shape);
return owner->shape_owner_get_owner(ownerid);
}
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 86e61fe878..ac8136a79f 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -1355,7 +1355,8 @@ bool TileMap::get_collision_use_parent() const {
void TileMap::set_collision_use_parent(bool p_use_parent) {
- if (use_parent == p_use_parent) return;
+ if (use_parent == p_use_parent)
+ return;
_clear_quadrants();