From 8028b6544207237ce34fe66d7ce2b0d73aff63ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 10 Mar 2026 14:37:15 +0100 Subject: [PATCH] Remove unused includes in `scene` with clangd-tidy --- editor/import/3d/resource_importer_scene.cpp | 1 + editor/inspector/editor_properties.cpp | 1 + editor/scene/2d/sprite_2d_editor_plugin.cpp | 1 + editor/scene/3d/bone_map_editor_plugin.h | 2 +- editor/shader/visual_shader_editor_plugin.cpp | 1 + .../tests/test_scene_multiplayer.h | 1 + .../2d/nav_mesh_generator_2d.cpp | 2 + scene/2d/camera_2d.cpp | 1 - scene/2d/mesh_instance_2d.cpp | 1 - scene/2d/multimesh_instance_2d.cpp | 1 - scene/2d/navigation/navigation_region_2d.h | 1 + scene/2d/path_2d.cpp | 4 -- scene/2d/physics/physics_body_2d.h | 1 - scene/2d/physics/rigid_body_2d.cpp | 1 + scene/2d/physics/rigid_body_2d.h | 2 + scene/2d/physics/static_body_2d.cpp | 1 + scene/2d/physics/static_body_2d.h | 4 ++ scene/2d/sprite_2d.cpp | 1 - scene/3d/label_3d.cpp | 2 +- scene/3d/lightmap_gi.cpp | 5 +- scene/3d/physics/physics_body_3d.h | 1 - scene/3d/physics/rigid_body_3d.cpp | 1 + scene/3d/physics/rigid_body_3d.h | 2 + scene/3d/physics/static_body_3d.cpp | 2 +- scene/3d/physics/static_body_3d.h | 2 + scene/3d/spline_ik_3d.cpp | 1 + scene/3d/spline_ik_3d.h | 3 +- scene/3d/sprite_3d.cpp | 2 +- scene/3d/visual_instance_3d.cpp | 1 - scene/3d/voxelizer.cpp | 1 - scene/animation/animation_blend_space_2d.cpp | 1 - scene/animation/easing_equations.h | 58 +++++++++---------- scene/debugger/view_3d_controller.cpp | 2 +- scene/gui/check_box.cpp | 1 - scene/gui/check_button.cpp | 1 - scene/gui/color_picker.cpp | 5 +- scene/gui/dialogs.h | 1 - scene/gui/line_edit.cpp | 1 - scene/gui/margin_container.cpp | 1 - scene/gui/panel.cpp | 1 - scene/gui/panel_container.cpp | 1 - scene/gui/popup.cpp | 2 +- scene/gui/separator.cpp | 1 - scene/gui/virtual_joystick.cpp | 1 - scene/main/node.h | 2 +- scene/resources/2d/navigation_polygon.h | 1 - scene/resources/2d/tile_set.cpp | 4 -- scene/resources/3d/joint_limitation_3d.cpp | 2 - scene/resources/dpi_texture.cpp | 5 +- scene/resources/dpi_texture.h | 1 - scene/resources/drawable_texture_2d.cpp | 2 + scene/resources/drawable_texture_2d.h | 6 +- scene/resources/font.cpp | 1 - scene/resources/font.h | 2 +- scene/resources/style_box_flat.cpp | 3 +- .../icons/default_theme_icons_builders.py | 2 - 56 files changed, 76 insertions(+), 82 deletions(-) diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp index 16bfaa1e49..1a227c7ab5 100644 --- a/editor/import/3d/resource_importer_scene.cpp +++ b/editor/import/3d/resource_importer_scene.cpp @@ -56,6 +56,7 @@ #include "scene/resources/animation.h" #include "scene/resources/bone_map.h" #include "scene/resources/packed_scene.h" +#include "scene/resources/physics_material.h" #include "scene/resources/resource_format_text.h" void EditorSceneFormatImporter::get_extensions(List *r_extensions) const { diff --git a/editor/inspector/editor_properties.cpp b/editor/inspector/editor_properties.cpp index c90f29de93..cc941fea54 100644 --- a/editor/inspector/editor_properties.cpp +++ b/editor/inspector/editor_properties.cpp @@ -59,6 +59,7 @@ #include "scene/gui/color_picker.h" #include "scene/gui/grid_container.h" #include "scene/gui/text_edit.h" +#include "scene/gui/texture_button.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/font.h" diff --git a/editor/scene/2d/sprite_2d_editor_plugin.cpp b/editor/scene/2d/sprite_2d_editor_plugin.cpp index e9b46ea427..79e6507e6e 100644 --- a/editor/scene/2d/sprite_2d_editor_plugin.cpp +++ b/editor/scene/2d/sprite_2d_editor_plugin.cpp @@ -49,6 +49,7 @@ #include "scene/gui/panel.h" #include "scene/gui/view_panner.h" #include "scene/main/scene_tree.h" +#include "scene/resources/bit_map.h" #include "scene/resources/mesh.h" #include "thirdparty/clipper2/include/clipper2/clipper.h" diff --git a/editor/scene/3d/bone_map_editor_plugin.h b/editor/scene/3d/bone_map_editor_plugin.h index 777d2f6618..790d7d72bb 100644 --- a/editor/scene/3d/bone_map_editor_plugin.h +++ b/editor/scene/3d/bone_map_editor_plugin.h @@ -33,11 +33,11 @@ #include "editor/editor_node.h" #include "editor/inspector/editor_properties.h" #include "editor/plugins/editor_plugin.h" - #include "scene/3d/skeleton_3d.h" #include "scene/gui/box_container.h" #include "scene/gui/color_rect.h" #include "scene/gui/dialogs.h" +#include "scene/gui/texture_button.h" #include "scene/resources/bone_map.h" #include "scene/resources/texture.h" diff --git a/editor/shader/visual_shader_editor_plugin.cpp b/editor/shader/visual_shader_editor_plugin.cpp index b85b8cbc89..2a371a3612 100644 --- a/editor/shader/visual_shader_editor_plugin.cpp +++ b/editor/shader/visual_shader_editor_plugin.cpp @@ -67,6 +67,7 @@ #include "scene/gui/rich_text_label.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" +#include "scene/gui/texture_button.h" #include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" #include "scene/gui/view_panner.h" diff --git a/modules/multiplayer/tests/test_scene_multiplayer.h b/modules/multiplayer/tests/test_scene_multiplayer.h index cef8b9502e..abac7b2989 100644 --- a/modules/multiplayer/tests/test_scene_multiplayer.h +++ b/modules/multiplayer/tests/test_scene_multiplayer.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/callable_mp.h" +#include "scene/2d/node_2d.h" #include "scene/main/scene_tree.h" #include "tests/test_macros.h" #include "tests/test_utils.h" diff --git a/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp b/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp index b954c90b70..4667e8b579 100644 --- a/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp +++ b/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp @@ -33,6 +33,8 @@ #include "nav_mesh_generator_2d.h" #include "core/config/project_settings.h" +#include "scene/2d/node_2d.h" +#include "scene/main/node.h" #include "scene/main/scene_tree.h" #include "scene/resources/2d/navigation_mesh_source_geometry_data_2d.h" #include "scene/resources/2d/navigation_polygon.h" diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 3b3e0f7f78..4434512117 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" -#include "core/input/input.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/main/scene_tree.h" diff --git a/scene/2d/mesh_instance_2d.cpp b/scene/2d/mesh_instance_2d.cpp index eee4213193..75265161f9 100644 --- a/scene/2d/mesh_instance_2d.cpp +++ b/scene/2d/mesh_instance_2d.cpp @@ -39,7 +39,6 @@ #include "servers/navigation_2d/navigation_server_2d.h" #include "thirdparty/clipper2/include/clipper2/clipper.h" -#include "thirdparty/misc/polypartition.h" #endif // NAVIGATION_2D_DISABLED Callable MeshInstance2D::_navmesh_source_geometry_parsing_callback; diff --git a/scene/2d/multimesh_instance_2d.cpp b/scene/2d/multimesh_instance_2d.cpp index 1526a62c1f..f3a850cca3 100644 --- a/scene/2d/multimesh_instance_2d.cpp +++ b/scene/2d/multimesh_instance_2d.cpp @@ -39,7 +39,6 @@ #include "servers/navigation_2d/navigation_server_2d.h" #include "thirdparty/clipper2/include/clipper2/clipper.h" -#include "thirdparty/misc/polypartition.h" #endif // NAVIGATION_2D_DISABLED Callable MultiMeshInstance2D::_navmesh_source_geometry_parsing_callback; diff --git a/scene/2d/navigation/navigation_region_2d.h b/scene/2d/navigation/navigation_region_2d.h index 011267153f..74a02781d3 100644 --- a/scene/2d/navigation/navigation_region_2d.h +++ b/scene/2d/navigation/navigation_region_2d.h @@ -30,6 +30,7 @@ #pragma once +#include "scene/2d/node_2d.h" #include "scene/resources/2d/navigation_polygon.h" class NavigationRegion2D : public Node2D { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 7007f0a72b..0c29f39f3c 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -39,10 +39,6 @@ #include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" -#ifdef TOOLS_ENABLED -#include "editor/themes/editor_scale.h" -#endif - #ifdef DEBUG_ENABLED Rect2 Path2D::_edit_get_rect() const { if (curve.is_null() || curve->get_point_count() == 0) { diff --git a/scene/2d/physics/physics_body_2d.h b/scene/2d/physics/physics_body_2d.h index 5272170b81..e3e4bfa5eb 100644 --- a/scene/2d/physics/physics_body_2d.h +++ b/scene/2d/physics/physics_body_2d.h @@ -32,7 +32,6 @@ #include "scene/2d/physics/collision_object_2d.h" #include "scene/2d/physics/kinematic_collision_2d.h" -#include "scene/resources/physics_material.h" #include "servers/physics_2d/physics_server_2d.h" class PhysicsBody2D : public CollisionObject2D { diff --git a/scene/2d/physics/rigid_body_2d.cpp b/scene/2d/physics/rigid_body_2d.cpp index 90d4f165b1..f83ece627f 100644 --- a/scene/2d/physics/rigid_body_2d.cpp +++ b/scene/2d/physics/rigid_body_2d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/resources/physics_material.h" void RigidBody2D::_body_enter_tree(ObjectID p_id) { Object *obj = ObjectDB::get_instance(p_id); diff --git a/scene/2d/physics/rigid_body_2d.h b/scene/2d/physics/rigid_body_2d.h index 4655818ead..f3b0708d5d 100644 --- a/scene/2d/physics/rigid_body_2d.h +++ b/scene/2d/physics/rigid_body_2d.h @@ -33,6 +33,8 @@ #include "core/templates/vset.h" #include "scene/2d/physics/physics_body_2d.h" +class PhysicsMaterial; + class RigidBody2D : public PhysicsBody2D { GDCLASS(RigidBody2D, PhysicsBody2D); diff --git a/scene/2d/physics/static_body_2d.cpp b/scene/2d/physics/static_body_2d.cpp index 410e721ce3..1972c98269 100644 --- a/scene/2d/physics/static_body_2d.cpp +++ b/scene/2d/physics/static_body_2d.cpp @@ -32,6 +32,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/resources/physics_material.h" #ifndef NAVIGATION_2D_DISABLED #include "scene/resources/2d/capsule_shape_2d.h" diff --git a/scene/2d/physics/static_body_2d.h b/scene/2d/physics/static_body_2d.h index a0891b91c7..19729fc139 100644 --- a/scene/2d/physics/static_body_2d.h +++ b/scene/2d/physics/static_body_2d.h @@ -32,8 +32,12 @@ #include "scene/2d/physics/physics_body_2d.h" +class PhysicsMaterial; + +#ifndef NAVIGATION_2D_DISABLED class NavigationPolygon; class NavigationMeshSourceGeometryData2D; +#endif class StaticBody2D : public PhysicsBody2D { GDCLASS(StaticBody2D, PhysicsBody2D); diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp index 9a7aca710f..9c703fe4b4 100644 --- a/scene/2d/sprite_2d.cpp +++ b/scene/2d/sprite_2d.cpp @@ -31,7 +31,6 @@ #include "sprite_2d.h" #include "core/config/engine.h" -#include "core/input/input.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/main/viewport.h" diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 4d182e8e85..141d150d58 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -31,10 +31,10 @@ #include "label_3d.h" #include "core/config/engine.h" +#include "core/math/triangle_mesh.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/main/window.h" -#include "scene/resources/mesh.h" #include "scene/resources/theme.h" #include "scene/theme/theme_db.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 438601985d..19d5eacf91 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -37,7 +37,6 @@ #include "core/math/geometry_3d.h" #include "core/object/class_db.h" #include "core/object/object.h" -#include "core/os/os.h" #include "scene/3d/light_3d.h" #include "scene/3d/lightmap_probe.h" #include "scene/3d/mesh_instance_3d.h" @@ -50,6 +49,10 @@ #include "modules/modules_enabled.gen.h" // For lightmapper_rd. +#if defined(ANDROID_ENABLED) || defined(APPLE_EMBEDDED_ENABLED) +#include "core/os/os.h" +#endif + void LightmapGIData::add_user(const NodePath &p_path, const Rect2 &p_uv_scale, int p_slice_index, int32_t p_sub_instance) { User user; user.path = p_path; diff --git a/scene/3d/physics/physics_body_3d.h b/scene/3d/physics/physics_body_3d.h index a5a99ceafc..249844dd9e 100644 --- a/scene/3d/physics/physics_body_3d.h +++ b/scene/3d/physics/physics_body_3d.h @@ -32,7 +32,6 @@ #include "scene/3d/physics/collision_object_3d.h" #include "scene/3d/physics/kinematic_collision_3d.h" -#include "scene/resources/physics_material.h" #include "servers/physics_3d/physics_server_3d.h" class PhysicsBody3D : public CollisionObject3D { diff --git a/scene/3d/physics/rigid_body_3d.cpp b/scene/3d/physics/rigid_body_3d.cpp index 9ac2db9705..c94dcc6090 100644 --- a/scene/3d/physics/rigid_body_3d.cpp +++ b/scene/3d/physics/rigid_body_3d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/resources/physics_material.h" void RigidBody3D::_body_enter_tree(ObjectID p_id) { Object *obj = ObjectDB::get_instance(p_id); diff --git a/scene/3d/physics/rigid_body_3d.h b/scene/3d/physics/rigid_body_3d.h index 43fe317554..65df0435d7 100644 --- a/scene/3d/physics/rigid_body_3d.h +++ b/scene/3d/physics/rigid_body_3d.h @@ -33,6 +33,8 @@ #include "core/templates/vset.h" #include "scene/3d/physics/physics_body_3d.h" +class PhysicsMaterial; + class RigidBody3D : public PhysicsBody3D { GDCLASS(RigidBody3D, PhysicsBody3D); diff --git a/scene/3d/physics/static_body_3d.cpp b/scene/3d/physics/static_body_3d.cpp index 3fc269cb7f..da4252f072 100644 --- a/scene/3d/physics/static_body_3d.cpp +++ b/scene/3d/physics/static_body_3d.cpp @@ -45,8 +45,8 @@ #include "scene/resources/3d/primitive_meshes.h" #include "scene/resources/3d/shape_3d.h" #include "scene/resources/3d/sphere_shape_3d.h" -#include "scene/resources/3d/world_boundary_shape_3d.h" #include "scene/resources/navigation_mesh.h" +#include "scene/resources/physics_material.h" #include "servers/navigation_3d/navigation_server_3d.h" Callable StaticBody3D::_navmesh_source_geometry_parsing_callback; diff --git a/scene/3d/physics/static_body_3d.h b/scene/3d/physics/static_body_3d.h index f486957560..04ae6b7767 100644 --- a/scene/3d/physics/static_body_3d.h +++ b/scene/3d/physics/static_body_3d.h @@ -32,6 +32,8 @@ #include "scene/3d/physics/physics_body_3d.h" +class PhysicsMaterial; + #ifndef NAVIGATION_3D_DISABLED class NavigationMesh; class NavigationMeshSourceGeometryData3D; diff --git a/scene/3d/spline_ik_3d.cpp b/scene/3d/spline_ik_3d.cpp index 7a6bc8859d..7e711d68e7 100644 --- a/scene/3d/spline_ik_3d.cpp +++ b/scene/3d/spline_ik_3d.cpp @@ -31,6 +31,7 @@ #include "spline_ik_3d.h" #include "core/object/class_db.h" +#include "scene/3d/path_3d.h" bool SplineIK3D::_set(const StringName &p_path, const Variant &p_value) { String path = p_path; diff --git a/scene/3d/spline_ik_3d.h b/scene/3d/spline_ik_3d.h index 4ac2985037..d1f288eb83 100644 --- a/scene/3d/spline_ik_3d.h +++ b/scene/3d/spline_ik_3d.h @@ -31,7 +31,8 @@ #pragma once #include "scene/3d/chain_ik_3d.h" -#include "scene/3d/path_3d.h" + +class Curve3D; class SplineIK3D : public ChainIK3D { GDCLASS(SplineIK3D, ChainIK3D); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 34a79f0bf3..510344e395 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -31,10 +31,10 @@ #include "sprite_3d.h" #include "core/config/engine.h" +#include "core/math/triangle_mesh.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/resources/atlas_texture.h" -#include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" Color SpriteBase3D::_get_color_accum() { diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp index 86bb3d1740..c4788c8c47 100644 --- a/scene/3d/visual_instance_3d.cpp +++ b/scene/3d/visual_instance_3d.cpp @@ -32,7 +32,6 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer); -#include "core/config/project_settings.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "core/os/os.h" diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp index c3742b2757..dd4b0a2bb3 100644 --- a/scene/3d/voxelizer.cpp +++ b/scene/3d/voxelizer.cpp @@ -33,7 +33,6 @@ #include "core/config/project_settings.h" #include "core/io/image.h" #include "core/math/geometry_3d.h" -#include "scene/resources/curve.h" #include "scene/resources/texture.h" static _FORCE_INLINE_ void get_uv_and_normal(const Vector3 &p_pos, const Vector3 *p_vtx, const Vector2 *p_uv, const Vector3 *p_normal, Vector2 &r_uv, Vector3 &r_normal) { diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 323fac5d00..9ebfbec2aa 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -35,7 +35,6 @@ #include "core/math/geometry_2d.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" -#include "scene/resources/material.h" void AnimationNodeBlendSpace2D::get_parameter_list(List *r_list) const { AnimationNode::get_parameter_list(r_list); diff --git a/scene/animation/easing_equations.h b/scene/animation/easing_equations.h index 705ffdd5af..2c05f8f6b4 100644 --- a/scene/animation/easing_equations.h +++ b/scene/animation/easing_equations.h @@ -64,15 +64,15 @@ inline real_t in(real_t t, real_t b, real_t c, real_t d) { namespace Sine { inline real_t in(real_t t, real_t b, real_t c, real_t d) { - return -c * std::cos(t / d * (Math::PI / 2)) + c + b; + return -c * Math::cos(t / d * (Math::PI / 2)) + c + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { - return c * std::sin(t / d * (Math::PI / 2)) + b; + return c * Math::sin(t / d * (Math::PI / 2)) + b; } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { - return -c / 2 * (std::cos(Math::PI * t / d) - 1) + b; + return -c / 2 * (Math::cos(Math::PI * t / d) - 1) + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -86,20 +86,20 @@ inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { namespace Quint { inline real_t in(real_t t, real_t b, real_t c, real_t d) { - return c * std::pow(t / d, 5) + b; + return c * Math::pow(t / d, 5) + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { - return c * (std::pow(t / d - 1, 5) + 1) + b; + return c * (Math::pow(t / d - 1, 5) + 1) + b; } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { t = t / d * 2; if (t < 1) { - return c / 2 * std::pow(t, 5) + b; + return c / 2 * Math::pow(t, 5) + b; } - return c / 2 * (std::pow(t - 2, 5) + 2) + b; + return c / 2 * (Math::pow(t - 2, 5) + 2) + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -113,20 +113,20 @@ inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { namespace Quart { inline real_t in(real_t t, real_t b, real_t c, real_t d) { - return c * std::pow(t / d, 4) + b; + return c * Math::pow(t / d, 4) + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { - return -c * (std::pow(t / d - 1, 4) - 1) + b; + return -c * (Math::pow(t / d - 1, 4) - 1) + b; } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { t = t / d * 2; if (t < 1) { - return c / 2 * std::pow(t, 4) + b; + return c / 2 * Math::pow(t, 4) + b; } - return -c / 2 * (std::pow(t - 2, 4) - 2) + b; + return -c / 2 * (Math::pow(t - 2, 4) - 2) + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -140,7 +140,7 @@ inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { namespace Quad { inline real_t in(real_t t, real_t b, real_t c, real_t d) { - return c * std::pow(t / d, 2) + b; + return c * Math::pow(t / d, 2) + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { @@ -152,7 +152,7 @@ inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { t = t / d * 2; if (t < 1) { - return c / 2 * std::pow(t, 2) + b; + return c / 2 * Math::pow(t, 2) + b; } return -c / 2 * ((t - 1) * (t - 3) - 1) + b; } @@ -171,14 +171,14 @@ inline real_t in(real_t t, real_t b, real_t c, real_t d) { if (t == 0) { return b; } - return c * std::pow(2, 10 * (t / d - 1)) + b - c * 0.001; + return c * Math::pow(2, 10 * (t / d - 1)) + b - c * 0.001; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { if (t == d) { return b + c; } - return c * 1.001 * (-std::pow(2, -10 * t / d) + 1) + b; + return c * 1.001 * (-Math::pow(2, -10 * t / d) + 1) + b; } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { @@ -193,9 +193,9 @@ inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { t = t / d * 2; if (t < 1) { - return c / 2 * std::pow(2, 10 * (t - 1)) + b - c * 0.0005; + return c / 2 * Math::pow(2, 10 * (t - 1)) + b - c * 0.0005; } - return c / 2 * 1.0005 * (-std::pow(2, -10 * (t - 1)) + 2) + b; + return c / 2 * 1.0005 * (-Math::pow(2, -10 * (t - 1)) + 2) + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -220,10 +220,10 @@ inline real_t in(real_t t, real_t b, real_t c, real_t d) { t -= 1; float p = d * 0.3f; - float a = c * std::pow(2, 10 * t); + float a = c * Math::pow(2, 10 * t); float s = p / 4; - return -(a * std::sin((t * d - s) * (2 * Math::PI) / p)) + b; + return -(a * Math::sin((t * d - s) * (2 * Math::PI) / p)) + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { @@ -239,7 +239,7 @@ inline real_t out(real_t t, real_t b, real_t c, real_t d) { float p = d * 0.3f; float s = p / 4; - return (c * std::pow(2, -10 * t) * std::sin((t * d - s) * (2 * Math::PI) / p) + c + b); + return (c * Math::pow(2, -10 * t) * Math::sin((t * d - s) * (2 * Math::PI) / p) + c + b); } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { @@ -257,13 +257,13 @@ inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { if (t < 1) { t -= 1; - a *= std::pow(2, 10 * t); - return -0.5f * (a * std::sin((t * d - s) * (2 * Math::PI) / p)) + b; + a *= Math::pow(2, 10 * t); + return -0.5f * (a * Math::sin((t * d - s) * (2 * Math::PI) / p)) + b; } t -= 1; - a *= std::pow(2, -10 * t); - return a * std::sin((t * d - s) * (2 * Math::PI) / p) * 0.5f + c + b; + a *= Math::pow(2, -10 * t); + return a * Math::sin((t * d - s) * (2 * Math::PI) / p) * 0.5f + c + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -308,22 +308,22 @@ inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { namespace Circ { inline real_t in(real_t t, real_t b, real_t c, real_t d) { t /= d; - return -c * (std::sqrt(1 - t * t) - 1) + b; + return -c * (Math::sqrt(1 - t * t) - 1) + b; } inline real_t out(real_t t, real_t b, real_t c, real_t d) { t = t / d - 1; - return c * std::sqrt(1 - t * t) + b; + return c * Math::sqrt(1 - t * t) + b; } inline real_t in_out(real_t t, real_t b, real_t c, real_t d) { t /= d / 2; if (t < 1) { - return -c / 2 * (std::sqrt(1 - t * t) - 1) + b; + return -c / 2 * (Math::sqrt(1 - t * t) - 1) + b; } t -= 2; - return c / 2 * (std::sqrt(1 - t * t) + 1) + b; + return c / 2 * (Math::sqrt(1 - t * t) + 1) + b; } inline real_t out_in(real_t t, real_t b, real_t c, real_t d) { @@ -418,7 +418,7 @@ namespace Spring { inline real_t out(real_t t, real_t b, real_t c, real_t d) { t /= d; real_t s = 1.0 - t; - t = (std::sin(t * Math::PI * (0.2 + 2.5 * t * t * t)) * std::pow(s, 2.2) + t) * (1.0 + (1.2 * s)); + t = (Math::sin(t * Math::PI * (0.2 + 2.5 * t * t * t)) * Math::pow(s, (real_t)2.2) + t) * (1.0 + (1.2 * s)); return c * t + b; } diff --git a/scene/debugger/view_3d_controller.cpp b/scene/debugger/view_3d_controller.cpp index 0f30805dc4..03ba53a21e 100644 --- a/scene/debugger/view_3d_controller.cpp +++ b/scene/debugger/view_3d_controller.cpp @@ -35,7 +35,7 @@ #include "core/config/engine.h" #include "core/input/input.h" #include "core/input/shortcut.h" -#include "core/object/class_db.h" +#include "core/object/class_db.h" // IWYU pragma: keep. `ADD_SIGNAL` macro. #include "scene/main/scene_tree.h" #include "scene/main/window.h" diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 8e97b09b1f..3dd9e4817c 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -30,7 +30,6 @@ #include "check_box.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index 63b4b2e187..f9650b39bd 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -30,7 +30,6 @@ #include "check_button.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index df8a005e62..94ea01ee19 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -36,7 +36,6 @@ #include "core/math/expression.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" -#include "core/os/os.h" #include "scene/gui/color_mode.h" #include "scene/gui/color_picker_shape.h" #include "scene/gui/file_dialog.h" @@ -61,6 +60,10 @@ #include "servers/display/accessibility_server.h" #include "servers/display/display_server.h" +#ifdef MACOS_ENABLED +#include "core/os/os.h" +#endif + static inline bool is_color_overbright(const Color &color) { return (color.r > 1.0) || (color.g > 1.0) || (color.b > 1.0); } diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index b837f7fe65..218cf4ebe5 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -35,7 +35,6 @@ #include "scene/gui/label.h" #include "scene/gui/panel.h" #include "scene/gui/popup.h" -#include "scene/gui/texture_button.h" #include "scene/main/window.h" class LineEdit; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 7efded00e2..6f16c0d761 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -41,7 +41,6 @@ #include "core/os/main_loop.h" #include "core/os/os.h" #include "core/string/alt_codes.h" -#include "core/string/translation_server.h" #include "scene/gui/label.h" #include "scene/main/window.h" #include "scene/theme/theme_db.h" diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index 9bb5685435..535db650f0 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -30,7 +30,6 @@ #include "margin_container.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" Size2 MarginContainer::get_minimum_size() const { diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index a250cf3f5d..20f126f795 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -30,7 +30,6 @@ #include "panel.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index 2da3a65be2..6196310b55 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -30,7 +30,6 @@ #include "panel_container.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" Size2 PanelContainer::get_minimum_size() const { diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index becf8d1f93..25cf55ce94 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -32,7 +32,7 @@ #include "core/config/engine.h" #include "core/object/callable_mp.h" -#include "core/object/class_db.h" +#include "core/object/class_db.h" // IWYU pragma: keep. `ADD_SIGNAL` macro. #include "scene/gui/panel.h" #include "scene/resources/style_box_flat.h" #include "scene/theme/theme_db.h" diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 9a37d93de8..d0ca7c2e86 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -30,7 +30,6 @@ #include "separator.h" -#include "core/object/class_db.h" #include "scene/theme/theme_db.h" Size2 Separator::get_minimum_size() const { diff --git a/scene/gui/virtual_joystick.cpp b/scene/gui/virtual_joystick.cpp index 06bf591d78..ba0910a24d 100644 --- a/scene/gui/virtual_joystick.cpp +++ b/scene/gui/virtual_joystick.cpp @@ -32,7 +32,6 @@ #include "core/config/engine.h" #include "core/input/input.h" -#include "core/input/input_map.h" #include "core/object/class_db.h" #include "scene/theme/theme_db.h" diff --git a/scene/main/node.h b/scene/main/node.h index a06bd7dedb..12e18040b8 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -35,7 +35,7 @@ #include "core/object/object.h" #include "core/object/ref_counted.h" #include "core/templates/iterable.h" -#include "scene/scene_string_names.h" +#include "scene/scene_string_names.h" // IWYU pragma: export. Make available to all Nodes. class MultiplayerAPI; class NodePath; diff --git a/scene/resources/2d/navigation_polygon.h b/scene/resources/2d/navigation_polygon.h index 9f1ce76a57..3438009bb8 100644 --- a/scene/resources/2d/navigation_polygon.h +++ b/scene/resources/2d/navigation_polygon.h @@ -30,7 +30,6 @@ #pragma once -#include "scene/2d/node_2d.h" #include "scene/resources/navigation_mesh.h" #include "servers/navigation_2d/navigation_constants_2d.h" diff --git a/scene/resources/2d/tile_set.cpp b/scene/resources/2d/tile_set.cpp index b69e9f2d2a..ab748e5195 100644 --- a/scene/resources/2d/tile_set.cpp +++ b/scene/resources/2d/tile_set.cpp @@ -43,10 +43,6 @@ #include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" -#ifndef NAVIGATION_2D_DISABLED -#include "servers/navigation_2d/navigation_server_2d.h" -#endif // NAVIGATION_2D_DISABLED - /////////////////////////////// TileMapPattern ////////////////////////////////////// void TileMapPattern::_set_tile_data(const Vector &p_data) { diff --git a/scene/resources/3d/joint_limitation_3d.cpp b/scene/resources/3d/joint_limitation_3d.cpp index d6bab4dbf3..5162912356 100644 --- a/scene/resources/3d/joint_limitation_3d.cpp +++ b/scene/resources/3d/joint_limitation_3d.cpp @@ -30,8 +30,6 @@ #include "joint_limitation_3d.h" -#include "scene/3d/skeleton_modifier_3d.h" - Quaternion JointLimitation3D::make_space(const Vector3 &p_local_forward_vector, const Vector3 &p_local_right_vector, const Quaternion &p_rotation_offset) const { const double ALMOST_ONE = 1.0 - CMP_EPSILON; // The default is to interpret the forward vector as the +Y axis. diff --git a/scene/resources/dpi_texture.cpp b/scene/resources/dpi_texture.cpp index 7b96e8ede2..bc81a06e39 100644 --- a/scene/resources/dpi_texture.cpp +++ b/scene/resources/dpi_texture.cpp @@ -30,13 +30,10 @@ #include "dpi_texture.h" -#include "core/io/image_loader.h" #include "core/object/class_db.h" -#include "scene/main/canvas_item.h" -#include "scene/main/viewport.h" #include "scene/resources/bit_map.h" -#include "scene/resources/placeholder_textures.h" #include "servers/rendering/rendering_server.h" +#include "servers/text/text_server.h" #include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED diff --git a/scene/resources/dpi_texture.h b/scene/resources/dpi_texture.h index 93750bb445..48f6c6dd3f 100644 --- a/scene/resources/dpi_texture.h +++ b/scene/resources/dpi_texture.h @@ -30,7 +30,6 @@ #pragma once -#include "core/templates/lru.h" #include "scene/resources/texture.h" class BitMap; diff --git a/scene/resources/drawable_texture_2d.cpp b/scene/resources/drawable_texture_2d.cpp index 28fd3166e4..d229c91764 100644 --- a/scene/resources/drawable_texture_2d.cpp +++ b/scene/resources/drawable_texture_2d.cpp @@ -31,6 +31,8 @@ #include "drawable_texture_2d.h" #include "core/object/class_db.h" +#include "scene/resources/atlas_texture.h" +#include "scene/resources/material.h" #include "servers/rendering/rendering_server.h" DrawableTexture2D::DrawableTexture2D() { diff --git a/scene/resources/drawable_texture_2d.h b/scene/resources/drawable_texture_2d.h index c699892075..1f25d067a9 100644 --- a/scene/resources/drawable_texture_2d.h +++ b/scene/resources/drawable_texture_2d.h @@ -30,9 +30,9 @@ #pragma once -#include "scene/resources/atlas_texture.h" -#include "scene/resources/image_texture.h" -#include "scene/resources/material.h" +#include "scene/resources/texture.h" + +class Material; class DrawableTexture2D : public Texture2D { GDCLASS(DrawableTexture2D, Texture2D); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 38bf7a71c1..4abfe35596 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -37,7 +37,6 @@ #include "core/object/class_db.h" #include "core/os/os.h" #include "core/templates/hash_map.h" -#include "core/templates/hashfuncs.h" #include "scene/resources/image_texture.h" #include "scene/resources/text_line.h" #include "scene/resources/text_paragraph.h" diff --git a/scene/resources/font.h b/scene/resources/font.h index 741a6b7eec..02252210f1 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -32,7 +32,7 @@ #include "core/io/resource.h" #include "core/templates/lru.h" -#include "scene/resources/texture.h" +#include "core/variant/typed_array.h" #include "servers/text/text_server.h" class TextLine; diff --git a/scene/resources/style_box_flat.cpp b/scene/resources/style_box_flat.cpp index bdadab21c7..fc4373f562 100644 --- a/scene/resources/style_box_flat.cpp +++ b/scene/resources/style_box_flat.cpp @@ -32,9 +32,8 @@ #include "core/config/engine.h" #include "core/object/class_db.h" -#include "scene/main/canvas_item.h" -#include "scene/main/viewport.h" #include "servers/rendering/rendering_server.h" +#include "servers/text/text_server.h" float StyleBoxFlat::get_style_margin(Side p_side) const { ERR_FAIL_INDEX_V((int)p_side, 4, 0.0); diff --git a/scene/theme/icons/default_theme_icons_builders.py b/scene/theme/icons/default_theme_icons_builders.py index 8e29af7e68..66a0680557 100644 --- a/scene/theme/icons/default_theme_icons_builders.py +++ b/scene/theme/icons/default_theme_icons_builders.py @@ -22,8 +22,6 @@ def make_default_theme_icons_action(target, source, env): with methods.generated_wrapper(str(target[0])) as file: file.write(f"""\ -#include "modules/modules_enabled.gen.h" - inline constexpr int default_theme_icons_count = {len(icons_names)}; inline constexpr const char *default_theme_icons_sources[] = {{ {icons_raw_str}