diff options
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/visual_server_canvas.cpp | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.h | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.cpp | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.h | 3 |
5 files changed, 5 insertions, 12 deletions
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index d5e154a7fc..66e2429bd0 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -783,7 +783,7 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector ERR_FAIL_COND(!p_bones.empty() && p_bones.size() != vertex_count * 4); ERR_FAIL_COND(!p_weights.empty() && p_weights.size() != vertex_count * 4); - Vector<int> indices = p_indices; + const Vector<int> &indices = p_indices; int count = p_count * 3; diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h index 26424f927e..28a8770c90 100644 --- a/servers/visual/visual_server_canvas.h +++ b/servers/visual/visual_server_canvas.h @@ -84,8 +84,8 @@ public: if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y)) return p_left->ysort_pos.x < p_right->ysort_pos.x; - else - return p_left->ysort_pos.y < p_right->ysort_pos.y; + + return p_left->ysort_pos.y < p_right->ysort_pos.y; } }; diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 3ee23e9290..faf5a1f8fa 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -3387,11 +3387,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { RID mat = VSG::storage->immediate_get_material(p_instance->base); - if (!mat.is_valid() || VSG::storage->material_casts_shadows(mat)) { - can_cast_shadows = true; - } else { - can_cast_shadows = false; - } + can_cast_shadows = !mat.is_valid() || VSG::storage->material_casts_shadows(mat); if (mat.is_valid() && VSG::storage->material_is_animated(mat)) { is_animated = true; diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index b7c54caffd..f8ed035766 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -253,8 +253,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E } else { _draw_3d(p_viewport, p_eye); } - - scenario_draw_canvas_bg = false; } //VSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow); diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index 43bbcb66c3..bdd4c1d4f2 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -138,9 +138,8 @@ public: if (left_to_screen == right_to_screen) { return p_left->parent == p_right->self; - } else { - return right_to_screen; } + return right_to_screen; } }; |