summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-05 14:34:31 +0200
committerGitHub <noreply@github.com>2021-04-05 14:34:31 +0200
commitb80b072c44cfc4f6ec1bfecc045374597eb296e0 (patch)
tree39544b604c8be6cf6daa56a2a7774426d394c2a3 /scene
parent33b8f1448e3efd8ad71c65c3d42581fae82905a3 (diff)
parentd83761ba80b90e17aaefaa83c7ece0fa89511266 (diff)
Merge pull request #47642 from akien-mga/clang-tidy-fixes
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/sprite_3d.h4
-rw-r--r--scene/main/http_request.cpp2
-rw-r--r--scene/main/node.cpp3
-rw-r--r--scene/main/viewport.cpp3
-rw-r--r--scene/resources/text_paragraph.cpp6
-rw-r--r--scene/resources/visual_shader_nodes.cpp20
6 files changed, 23 insertions, 15 deletions
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index b48660eb2d..d1bc8dc737 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -203,8 +203,8 @@ class AnimatedSprite3D : public SpriteBase3D {
float timeout = 0.0;
- bool hflip = 1;
- bool vflip = 1;
+ bool hflip = true;
+ bool vflip = true;
Color modulate;
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index e4ed5c6e6c..64df37654b 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -454,7 +454,7 @@ void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArra
is_compressed = false;
}
- const PackedByteArray *data = NULL;
+ const PackedByteArray *data = nullptr;
if (accept_gzip && is_compressed && p_data.size() > 0) {
// Decompress request body
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index b406d800dc..27712242d1 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1968,8 +1968,9 @@ Node *Node::get_deepest_editable_node(Node *p_start_node) const {
Node *node = p_start_node;
while (iterated_item->get_owner() && iterated_item->get_owner() != this) {
- if (!is_editable_instance(iterated_item->get_owner()))
+ if (!is_editable_instance(iterated_item->get_owner())) {
node = iterated_item->get_owner();
+ }
iterated_item = iterated_item->get_owner();
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f382f5b685..a2047261f5 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3228,8 +3228,9 @@ Viewport::ScreenSpaceAA Viewport::get_screen_space_aa() const {
}
void Viewport::set_use_debanding(bool p_use_debanding) {
- if (use_debanding == p_use_debanding)
+ if (use_debanding == p_use_debanding) {
return;
+ }
use_debanding = p_use_debanding;
RS::get_singleton()->viewport_set_use_debanding(viewport, p_use_debanding);
}
diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp
index 012d36cc35..341f5abd80 100644
--- a/scene/resources/text_paragraph.cpp
+++ b/scene/resources/text_paragraph.cpp
@@ -620,11 +620,13 @@ int TextParagraph::hit_test(const Point2 &p_coords) const {
const_cast<TextParagraph *>(this)->_shape_lines();
Vector2 ofs;
if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) {
- if (ofs.y < 0)
+ if (ofs.y < 0) {
return 0;
+ }
} else {
- if (ofs.x < 0)
+ if (ofs.x < 0) {
return 0;
+ }
}
for (int i = 0; i < lines.size(); i++) {
if (TS->shaped_text_get_orientation(lines[i]) == TextServer::ORIENTATION_HORIZONTAL) {
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp
index 9c8d2a0981..7943b95177 100644
--- a/scene/resources/visual_shader_nodes.cpp
+++ b/scene/resources/visual_shader_nodes.cpp
@@ -4660,16 +4660,18 @@ String VisualShaderNodeTexture2DArrayUniform::generate_global(Shader::Mode p_mod
switch (texture_type) {
case TYPE_DATA:
- if (color_default == COLOR_DEFAULT_BLACK)
+ if (color_default == COLOR_DEFAULT_BLACK) {
code += " : hint_black;\n";
- else
+ } else {
code += ";\n";
+ }
break;
case TYPE_COLOR:
- if (color_default == COLOR_DEFAULT_BLACK)
+ if (color_default == COLOR_DEFAULT_BLACK) {
code += " : hint_black_albedo;\n";
- else
+ } else {
code += " : hint_albedo;\n";
+ }
break;
case TYPE_NORMAL_MAP:
code += " : hint_normal;\n";
@@ -4728,16 +4730,18 @@ String VisualShaderNodeTexture3DUniform::generate_global(Shader::Mode p_mode, Vi
switch (texture_type) {
case TYPE_DATA:
- if (color_default == COLOR_DEFAULT_BLACK)
+ if (color_default == COLOR_DEFAULT_BLACK) {
code += " : hint_black;\n";
- else
+ } else {
code += ";\n";
+ }
break;
case TYPE_COLOR:
- if (color_default == COLOR_DEFAULT_BLACK)
+ if (color_default == COLOR_DEFAULT_BLACK) {
code += " : hint_black_albedo;\n";
- else
+ } else {
code += " : hint_albedo;\n";
+ }
break;
case TYPE_NORMAL_MAP:
code += " : hint_normal;\n";