1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +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:
Rémi Verschelde
2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View File

@@ -124,8 +124,9 @@ void NoiseTexture::_thread_function(void *p_ud) {
}
void NoiseTexture::_queue_update() {
if (update_queued)
if (update_queued) {
return;
}
update_queued = true;
call_deferred("_update_texture");
@@ -179,8 +180,9 @@ void NoiseTexture::_update_texture() {
}
void NoiseTexture::set_noise(Ref<OpenSimplexNoise> p_noise) {
if (p_noise == noise)
if (p_noise == noise) {
return;
}
if (noise.is_valid()) {
noise->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture::_queue_update));
}
@@ -196,22 +198,25 @@ Ref<OpenSimplexNoise> NoiseTexture::get_noise() {
}
void NoiseTexture::set_width(int p_width) {
if (p_width == size.x)
if (p_width == size.x) {
return;
}
size.x = p_width;
_queue_update();
}
void NoiseTexture::set_height(int p_height) {
if (p_height == size.y)
if (p_height == size.y) {
return;
}
size.y = p_height;
_queue_update();
}
void NoiseTexture::set_seamless(bool p_seamless) {
if (p_seamless == seamless)
if (p_seamless == seamless) {
return;
}
seamless = p_seamless;
_queue_update();
}
@@ -221,8 +226,9 @@ bool NoiseTexture::get_seamless() {
}
void NoiseTexture::set_as_normalmap(bool p_as_normalmap) {
if (p_as_normalmap == as_normalmap)
if (p_as_normalmap == as_normalmap) {
return;
}
as_normalmap = p_as_normalmap;
_queue_update();
_change_notify();
@@ -233,11 +239,13 @@ bool NoiseTexture::is_normalmap() {
}
void NoiseTexture::set_bump_strength(float p_bump_strength) {
if (p_bump_strength == bump_strength)
if (p_bump_strength == bump_strength) {
return;
}
bump_strength = p_bump_strength;
if (as_normalmap)
if (as_normalmap) {
_queue_update();
}
}
float NoiseTexture::get_bump_strength() {