summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-04-05 14:09:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-04-05 14:09:59 +0200
commitd83761ba80b90e17aaefaa83c7ece0fa89511266 (patch)
tree39544b604c8be6cf6daa56a2a7774426d394c2a3 /servers/rendering
parent9bbe51dc279e1203962bdf0b3266c9b14307638c (diff)
Style: Apply clang-tidy's `readability-braces-around-statements`
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp3
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp10
-rw-r--r--servers/rendering/shader_language.cpp8
3 files changed, 13 insertions, 8 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp
index 7a19495f48..b98aee611a 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_render_forward_clustered.cpp
@@ -3022,8 +3022,9 @@ void RendererSceneRenderForwardClustered::_geometry_instance_update(GeometryInst
for (int j = 0; j < draw_passes; j++) {
RID mesh = storage->particles_get_draw_pass_mesh(ginstance->data->base, j);
- if (!mesh.is_valid())
+ if (!mesh.is_valid()) {
continue;
+ }
const RID *materials = nullptr;
uint32_t surface_count;
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index ba5ace8f31..b984f850a0 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -4692,10 +4692,11 @@ void RendererStorageRD::update_particles() {
if (particles->clear && particles->pre_process_time > 0.0) {
float frame_time;
- if (particles->fixed_fps > 0)
+ if (particles->fixed_fps > 0) {
frame_time = 1.0 / particles->fixed_fps;
- else
+ } else {
frame_time = 1.0 / 30.0;
+ }
float todo = particles->pre_process_time;
@@ -4731,10 +4732,11 @@ void RendererStorageRD::update_particles() {
particles->frame_remainder = todo;
} else {
- if (zero_time_scale)
+ if (zero_time_scale) {
_particles_process(particles, 0.0);
- else
+ } else {
_particles_process(particles, RendererCompositorRD::singleton->get_frame_delta_time());
+ }
}
//copy particles to instance buffer
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index bab251beb2..4ae0eda232 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -6932,10 +6932,11 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
decl.initializer.push_back(n);
break;
} else {
- if (curly)
+ if (curly) {
_set_error("Expected '}' or ','");
- else
+ } else {
_set_error("Expected ')' or ','");
+ }
return ERR_PARSE_ERROR;
}
}
@@ -6962,8 +6963,9 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
} else {
//variable created with assignment! must parse an expression
Node *expr = _parse_and_reduce_expression(nullptr, FunctionInfo());
- if (!expr)
+ if (!expr) {
return ERR_PARSE_ERROR;
+ }
if (expr->type == Node::TYPE_OPERATOR && ((OperatorNode *)expr)->op == OP_CALL) {
_set_error("Expected constant expression after '='");
return ERR_PARSE_ERROR;