mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
parent
07bc4e2f96
commit
0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions
|
@ -44,8 +44,9 @@ bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3
|
|||
|
||||
for (int i = 0; i < geometry.size(); i++) {
|
||||
float area = geometry[i].get_area();
|
||||
if (area < CMP_EPSILON)
|
||||
if (area < CMP_EPSILON) {
|
||||
continue;
|
||||
}
|
||||
triangle_area_map[area_accum] = i;
|
||||
area_accum += area;
|
||||
}
|
||||
|
@ -92,10 +93,11 @@ bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3
|
|||
|
||||
for (int i = 0; i < gcount; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
if (i == 0 && j == 0)
|
||||
if (i == 0 && j == 0) {
|
||||
aabb.position = r[i].vertex[j];
|
||||
else
|
||||
} else {
|
||||
aabb.expand_to(r[i].vertex[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,15 +127,18 @@ bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3
|
|||
res -= ofs;
|
||||
float d = dir.dot(res);
|
||||
|
||||
if (d < min)
|
||||
if (d < min) {
|
||||
min = d;
|
||||
if (d > max)
|
||||
}
|
||||
if (d > max) {
|
||||
max = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (max < min)
|
||||
if (max < min) {
|
||||
continue; //lost attempt
|
||||
}
|
||||
|
||||
float val = min + (max - min) * Math::randf();
|
||||
|
||||
|
@ -150,8 +155,9 @@ bool GPUParticles3DEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3
|
|||
|
||||
void GPUParticles3DEditorBase::_node_selected(const NodePath &p_path) {
|
||||
Node *sel = get_node(p_path);
|
||||
if (!sel)
|
||||
if (!sel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sel->is_class("Node3D")) {
|
||||
EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Node3D."), sel->get_name()));
|
||||
|
@ -234,10 +240,11 @@ void GPUParticles3DEditor::_menu_option(int p_option) {
|
|||
case MENU_OPTION_GENERATE_AABB: {
|
||||
float gen_time = node->get_lifetime();
|
||||
|
||||
if (gen_time < 1.0)
|
||||
if (gen_time < 1.0) {
|
||||
generate_seconds->set_value(1.0);
|
||||
else
|
||||
} else {
|
||||
generate_seconds->set_value(trunc(gen_time) + 1.0);
|
||||
}
|
||||
generate_aabb->popup_centered();
|
||||
} break;
|
||||
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
|
||||
|
@ -295,10 +302,11 @@ void GPUParticles3DEditor::_generate_aabb() {
|
|||
OS::get_singleton()->delay_usec(1000);
|
||||
|
||||
AABB capture = node->capture_aabb();
|
||||
if (rect == AABB())
|
||||
if (rect == AABB()) {
|
||||
rect = capture;
|
||||
else
|
||||
} else {
|
||||
rect.merge_with(capture);
|
||||
}
|
||||
|
||||
running += (OS::get_singleton()->get_ticks_usec() - ticks) / 1000000.0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue