From 1c12d2c36e31be87adb600cc148053eda9031b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 1 Feb 2026 21:13:50 +0100 Subject: [PATCH] Tidy up includes in `scene/main` and `scene/debugger` --- modules/csg/csg_shape.h | 1 + .../objectdb_profiler/snapshot_collector.h | 1 + scene/3d/cpu_particles_3d.h | 1 + scene/3d/gpu_particles_3d.h | 2 ++ scene/3d/gpu_particles_collision_3d.cpp | 2 +- scene/3d/gpu_particles_collision_3d.h | 2 ++ scene/3d/lightmap_gi.cpp | 1 + scene/3d/lightmap_gi.h | 6 ++-- scene/3d/voxel_gi.cpp | 6 ++-- scene/3d/voxel_gi.h | 1 + scene/debugger/runtime_node_select.h | 2 ++ scene/debugger/scene_debugger.cpp | 7 ++-- scene/debugger/scene_debugger.h | 12 +++---- scene/debugger/scene_debugger_object.cpp | 1 + scene/debugger/scene_debugger_object.h | 8 ++++- scene/main/canvas_item.compat.inc | 14 ++++---- scene/main/canvas_item.cpp | 16 +++++---- scene/main/canvas_item.h | 35 ++++++++++--------- scene/main/canvas_layer.h | 1 + scene/main/http_request.cpp | 2 ++ scene/main/http_request.h | 4 +-- scene/main/multiplayer_api.cpp | 1 + scene/main/multiplayer_peer.h | 3 +- scene/main/node.cpp | 10 ++++-- scene/main/node.h | 8 ++--- scene/main/resource_preloader.cpp | 2 ++ scene/main/scene_tree.cpp | 2 +- scene/main/scene_tree.h | 17 ++++----- scene/main/scene_tree_fti_tests.h | 2 +- scene/main/shader_globals_override.cpp | 1 - scene/main/viewport.cpp | 8 +++-- scene/main/viewport.h | 14 ++++---- scene/main/window.h | 1 - 33 files changed, 114 insertions(+), 80 deletions(-) diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h index da3ee688fc..971afd1a16 100644 --- a/modules/csg/csg_shape.h +++ b/modules/csg/csg_shape.h @@ -41,6 +41,7 @@ #include "thirdparty/misc/mikktspace.h" +class Mesh; class NavigationMesh; class NavigationMeshSourceGeometryData3D; diff --git a/modules/objectdb_profiler/snapshot_collector.h b/modules/objectdb_profiler/snapshot_collector.h index bf22fd2da8..a6e12b994c 100644 --- a/modules/objectdb_profiler/snapshot_collector.h +++ b/modules/objectdb_profiler/snapshot_collector.h @@ -30,6 +30,7 @@ #pragma once +#include "core/variant/dictionary.h" #include "scene/debugger/scene_debugger_object.h" struct SnapshotDataTransportObject : public SceneDebuggerObject { diff --git a/scene/3d/cpu_particles_3d.h b/scene/3d/cpu_particles_3d.h index 2161020a32..e0f93a7de3 100644 --- a/scene/3d/cpu_particles_3d.h +++ b/scene/3d/cpu_particles_3d.h @@ -34,6 +34,7 @@ #include "scene/resources/curve.h" #include "scene/resources/gradient.h" +class Mesh; class RandomNumberGenerator; class CPUParticles3D : public GeometryInstance3D { diff --git a/scene/3d/gpu_particles_3d.h b/scene/3d/gpu_particles_3d.h index d76fc4c6c1..778db608b3 100644 --- a/scene/3d/gpu_particles_3d.h +++ b/scene/3d/gpu_particles_3d.h @@ -33,6 +33,8 @@ #include "scene/3d/visual_instance_3d.h" #include "scene/resources/3d/skin.h" +class Mesh; + class GPUParticles3D : public GeometryInstance3D { private: GDCLASS(GPUParticles3D, GeometryInstance3D); diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp index 9f616f2405..017783d743 100644 --- a/scene/3d/gpu_particles_collision_3d.cpp +++ b/scene/3d/gpu_particles_collision_3d.cpp @@ -32,8 +32,8 @@ #include "core/math/geometry_3d.h" #include "core/object/worker_thread_pool.h" -#include "mesh_instance_3d.h" #include "scene/3d/camera_3d.h" +#include "scene/3d/mesh_instance_3d.h" #include "scene/main/viewport.h" void GPUParticlesCollision3D::set_cull_mask(uint32_t p_cull_mask) { diff --git a/scene/3d/gpu_particles_collision_3d.h b/scene/3d/gpu_particles_collision_3d.h index 59636bceaa..2076564492 100644 --- a/scene/3d/gpu_particles_collision_3d.h +++ b/scene/3d/gpu_particles_collision_3d.h @@ -33,6 +33,8 @@ #include "core/templates/local_vector.h" #include "scene/3d/visual_instance_3d.h" +class Mesh; + class GPUParticlesCollision3D : public VisualInstance3D { GDCLASS(GPUParticlesCollision3D, VisualInstance3D); diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index b0506e2ea9..92f48b8f9d 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -35,6 +35,7 @@ #include "core/math/delaunay_3d.h" #include "core/math/geometry_3d.h" #include "core/object/object.h" +#include "scene/3d/light_3d.h" #include "scene/3d/lightmap_probe.h" #include "scene/3d/mesh_instance_3d.h" #include "scene/resources/camera_attributes.h" diff --git a/scene/3d/lightmap_gi.h b/scene/3d/lightmap_gi.h index c50cb7c4de..8555069d81 100644 --- a/scene/3d/lightmap_gi.h +++ b/scene/3d/lightmap_gi.h @@ -30,13 +30,15 @@ #pragma once +#include "core/io/resource.h" #include "core/templates/local_vector.h" -#include "scene/3d/light_3d.h" #include "scene/3d/lightmapper.h" #include "scene/3d/visual_instance_3d.h" -class Sky; class CameraAttributes; +class Light3D; +class Mesh; +class Sky; class LightmapGIData : public Resource { GDCLASS(LightmapGIData, Resource); diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp index b175716469..59dab96d54 100644 --- a/scene/3d/voxel_gi.cpp +++ b/scene/3d/voxel_gi.cpp @@ -31,10 +31,10 @@ #include "voxel_gi.h" #include "core/config/project_settings.h" -#include "mesh_instance_3d.h" -#include "multimesh_instance_3d.h" +#include "scene/3d/mesh_instance_3d.h" +#include "scene/3d/multimesh_instance_3d.h" +#include "scene/3d/voxelizer.h" #include "scene/resources/camera_attributes.h" -#include "voxelizer.h" void VoxelGIData::_set_data(const Dictionary &p_data) { ERR_FAIL_COND(!p_data.has("bounds")); diff --git a/scene/3d/voxel_gi.h b/scene/3d/voxel_gi.h index 46b0c58dce..80ed313569 100644 --- a/scene/3d/voxel_gi.h +++ b/scene/3d/voxel_gi.h @@ -33,6 +33,7 @@ #include "scene/3d/visual_instance_3d.h" class CameraAttributes; +class Mesh; class VoxelGIData : public Resource { GDCLASS(VoxelGIData, Resource); diff --git a/scene/debugger/runtime_node_select.h b/scene/debugger/runtime_node_select.h index 80fec65e64..724d821509 100644 --- a/scene/debugger/runtime_node_select.h +++ b/scene/debugger/runtime_node_select.h @@ -32,7 +32,9 @@ #ifdef DEBUG_ENABLED +#include "core/object/object.h" #include "scene/gui/view_panner.h" + #ifndef _3D_DISABLED #include "scene/resources/mesh.h" #endif // _3D_DISABLED diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index 9f5df1e7dd..8fde846dc9 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -32,19 +32,20 @@ #include "core/debugger/debugger_marshalls.h" #include "core/debugger/engine_debugger.h" +#include "core/input/shortcut.h" #include "core/io/dir_access.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/math/math_fieldwise.h" #include "core/os/time.h" #include "core/templates/local_vector.h" +#include "core/variant/array.h" #include "scene/2d/camera_2d.h" #include "scene/debugger/scene_debugger_object.h" -#include "scene/main/canvas_layer.h" +#include "scene/main/node.h" #include "scene/main/scene_tree.h" -#include "scene/main/window.h" +#include "scene/main/window.h" // SceneTree:get_root() #include "scene/resources/packed_scene.h" -#include "scene/theme/theme_db.h" #include "servers/audio/audio_server.h" #ifndef _3D_DISABLED diff --git a/scene/debugger/scene_debugger.h b/scene/debugger/scene_debugger.h index bd26aa3088..1960fc73ab 100644 --- a/scene/debugger/scene_debugger.h +++ b/scene/debugger/scene_debugger.h @@ -30,17 +30,13 @@ #pragma once -#include "core/input/shortcut.h" #include "core/object/ref_counted.h" #include "core/string/ustring.h" -#include "core/variant/array.h" -class CanvasItem; -class LiveEditor; -class PopupMenu; -class RuntimeNodeSelect; -class Script; -class SceneTree; +class Array; +class InputEvent; +class Node; +class Shortcut; class SceneDebugger { private: diff --git a/scene/debugger/scene_debugger_object.cpp b/scene/debugger/scene_debugger_object.cpp index e922d1e573..44ddc0777c 100644 --- a/scene/debugger/scene_debugger_object.cpp +++ b/scene/debugger/scene_debugger_object.cpp @@ -34,6 +34,7 @@ #include "core/io/marshalls.h" #include "core/object/script_language.h" +#include "scene/main/node.h" SceneDebuggerObject::SceneDebuggerObject(Object *p_obj) { if (!p_obj) { diff --git a/scene/debugger/scene_debugger_object.h b/scene/debugger/scene_debugger_object.h index 919e2d4282..8035d2e5e0 100644 --- a/scene/debugger/scene_debugger_object.h +++ b/scene/debugger/scene_debugger_object.h @@ -32,7 +32,13 @@ #ifdef DEBUG_ENABLED -#include "scene/main/node.h" +#include "core/object/object.h" +#include "core/string/ustring.h" +#include "core/templates/list.h" +#include "core/templates/pair.h" + +class Node; +class Script; class SceneDebuggerObject { private: diff --git a/scene/main/canvas_item.compat.inc b/scene/main/canvas_item.compat.inc index 040a3fdea1..ceb85e77cb 100644 --- a/scene/main/canvas_item.compat.inc +++ b/scene/main/canvas_item.compat.inc @@ -30,6 +30,8 @@ #ifndef DISABLE_DEPRECATED +#include "scene/resources/font.h" + void CanvasItem::_draw_string_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, const Color &p_modulate, BitField p_jst_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { draw_string(p_font, p_pos, p_text, p_alignment, p_width, p_font_size, p_modulate, p_jst_flags, p_direction, p_orientation, 0.0); } @@ -75,12 +77,12 @@ void CanvasItem::_draw_multiline_colors_bind_compat_84523(const Vector & } void CanvasItem::_bind_compatibility_methods() { - ClassDB::bind_compatibility_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "font_size", "modulate", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_string_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_compatibility_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "brk_flags", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_multiline_string_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_compatibility_method(D_METHOD("draw_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_string_outline_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_compatibility_method(D_METHOD("draw_multiline_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "brk_flags", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_multiline_string_outline_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_compatibility_method(D_METHOD("draw_char", "font", "pos", "char", "font_size", "modulate"), &CanvasItem::_draw_char_bind_compat_104872, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0))); - ClassDB::bind_compatibility_method(D_METHOD("draw_char_outline", "font", "pos", "char", "font_size", "size", "modulate"), &CanvasItem::_draw_char_outline_bind_compat_104872, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0))); + ClassDB::bind_compatibility_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "font_size", "modulate", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_string_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_compatibility_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "brk_flags", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_multiline_string_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_compatibility_method(D_METHOD("draw_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_string_outline_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_compatibility_method(D_METHOD("draw_multiline_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "brk_flags", "justification_flags", "direction", "orientation"), &CanvasItem::_draw_multiline_string_outline_bind_compat_104872, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_compatibility_method(D_METHOD("draw_char", "font", "pos", "char", "font_size", "modulate"), &CanvasItem::_draw_char_bind_compat_104872, DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0))); + ClassDB::bind_compatibility_method(D_METHOD("draw_char_outline", "font", "pos", "char", "font_size", "size", "modulate"), &CanvasItem::_draw_char_outline_bind_compat_104872, DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0))); ClassDB::bind_compatibility_method(D_METHOD("draw_circle", "position", "radius", "color"), &CanvasItem::_draw_circle_bind_compat_84472); ClassDB::bind_compatibility_method(D_METHOD("draw_rect", "rect", "color", "filled", "width"), &CanvasItem::_draw_rect_bind_compat_84523, DEFVAL(true), DEFVAL(-1.0)); ClassDB::bind_compatibility_method(D_METHOD("draw_dashed_line", "from", "to", "color", "width", "dash", "aligned"), &CanvasItem::_draw_dashed_line_bind_compat_84523, DEFVAL(-1.0), DEFVAL(2.0), DEFVAL(true)); diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index cfb07dc630..fa0ad3035e 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -36,6 +36,7 @@ #include "scene/main/window.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/font.h" +#include "scene/resources/mesh.h" #include "scene/resources/multimesh.h" #include "scene/resources/style_box.h" #include "scene/resources/world_2d.h" @@ -1329,6 +1330,9 @@ PackedStringArray CanvasItem::get_configuration_warnings() const { } void CanvasItem::_bind_methods() { + // Constant redefined in CanvasItem to allow forward-declaring Font. + static_assert(CanvasItem::DEFAULT_FONT_SIZE == Font::DEFAULT_FONT_SIZE); + ClassDB::bind_method(D_METHOD("_top_level_raise_self"), &CanvasItem::_top_level_raise_self); #ifdef TOOLS_ENABLED @@ -1405,12 +1409,12 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_primitive", "points", "colors", "uvs", "texture"), &CanvasItem::draw_primitive, DEFVAL(Ref())); ClassDB::bind_method(D_METHOD("draw_polygon", "points", "colors", "uvs", "texture"), &CanvasItem::draw_polygon, DEFVAL(PackedVector2Array()), DEFVAL(Ref())); ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture"), &CanvasItem::draw_colored_polygon, DEFVAL(PackedVector2Array()), DEFVAL(Ref())); - ClassDB::bind_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "font_size", "modulate", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "brk_flags", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("draw_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("draw_multiline_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "brk_flags", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_multiline_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("draw_char", "font", "pos", "char", "font_size", "modulate", "oversampling"), &CanvasItem::draw_char, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("draw_char_outline", "font", "pos", "char", "font_size", "size", "modulate", "oversampling"), &CanvasItem::draw_char_outline, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "font_size", "modulate", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "brk_flags", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_multiline_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "brk_flags", "justification_flags", "direction", "orientation", "oversampling"), &CanvasItem::draw_multiline_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_char", "font", "pos", "char", "font_size", "modulate", "oversampling"), &CanvasItem::draw_char, DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("draw_char_outline", "font", "pos", "char", "font_size", "size", "modulate", "oversampling"), &CanvasItem::draw_char_outline, DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(0.0)); ClassDB::bind_method(D_METHOD("draw_mesh", "mesh", "texture", "transform", "modulate"), &CanvasItem::draw_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1, 1))); ClassDB::bind_method(D_METHOD("draw_multimesh", "multimesh", "texture"), &CanvasItem::draw_multimesh); ClassDB::bind_method(D_METHOD("draw_set_transform", "position", "rotation", "scale"), &CanvasItem::draw_set_transform, DEFVAL(0.0), DEFVAL(Size2(1.0, 1.0))); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 3e838aa228..6e7482eb65 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -31,13 +31,15 @@ #pragma once #include "scene/main/node.h" -#include "scene/resources/font.h" +#include "scene/resources/texture.h" #include "servers/rendering/rendering_server.h" +#include "servers/text/text_server.h" class CanvasLayer; +class Font; +class Mesh; class MultiMesh; class StyleBox; -class SubViewport; class Window; class World2D; @@ -76,8 +78,7 @@ public: }; private: - mutable SelfList - xform_change; + mutable SelfList xform_change; RID canvas_item; StringName canvas_group; @@ -102,6 +103,8 @@ private: bool z_relative = true; bool y_sort_enabled = false; + static constexpr int DEFAULT_FONT_SIZE = 16; // Keep synced with font.h. + Window *window = nullptr; bool visible = true; bool parent_visible_in_tree = false; @@ -185,12 +188,12 @@ protected: static void _bind_methods(); #ifndef DISABLE_DEPRECATED - void _draw_string_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; - void _draw_multiline_string_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; - void _draw_string_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; - void _draw_multiline_string_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; - void _draw_char_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; - void _draw_char_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; + void _draw_string_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void _draw_multiline_string_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void _draw_string_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void _draw_multiline_string_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void _draw_char_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; + void _draw_char_outline_bind_compat_104872(const Ref &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; void _draw_circle_bind_compat_84472(const Point2 &p_pos, real_t p_radius, const Color &p_color); void _draw_rect_bind_compat_84523(const Rect2 &p_rect, const Color &p_color, bool p_filled, real_t p_width); void _draw_dashed_line_bind_compat_84523(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width, real_t p_dash, bool p_aligned); @@ -329,14 +332,14 @@ public: void draw_mesh(RequiredParam rp_mesh, const Ref &p_texture, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1)); void draw_multimesh(RequiredParam rp_multimesh, const Ref &p_texture); - void draw_string(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; - void draw_multiline_string(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; + void draw_string(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; + void draw_multiline_string(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; - void draw_string_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; - void draw_multiline_string_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; + void draw_string_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; + void draw_multiline_string_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), BitField p_brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, BitField p_jst_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL, float p_oversampling = 0.0) const; - void draw_char(RequiredParam rp_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), float p_oversampling = 0.0) const; - void draw_char_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), float p_oversampling = 0.0) const; + void draw_char(RequiredParam rp_font, const Point2 &p_pos, const String &p_char, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), float p_oversampling = 0.0) const; + void draw_char_outline(RequiredParam rp_font, const Point2 &p_pos, const String &p_char, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), float p_oversampling = 0.0) const; void draw_set_transform(const Point2 &p_offset, real_t p_rot = 0.0, const Size2 &p_scale = Size2(1.0, 1.0)); void draw_set_transform_matrix(const Transform2D &p_matrix); diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index 7bd7c54f25..3a67c2fba7 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -33,6 +33,7 @@ #include "scene/main/node.h" class Viewport; + class CanvasLayer : public Node { GDCLASS(CanvasLayer, Node); diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 46dd332117..ec3b6dabb8 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -31,6 +31,8 @@ #include "http_request.h" #include "core/io/file_access.h" +#include "core/io/stream_peer_gzip.h" +#include "core/os/thread.h" #include "scene/main/timer.h" Error HTTPRequest::_request() { diff --git a/scene/main/http_request.h b/scene/main/http_request.h index ccac9809fe..6188d5d9a1 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -31,12 +31,12 @@ #pragma once #include "core/io/http_client.h" -#include "core/io/stream_peer_gzip.h" -#include "core/os/thread.h" #include "core/templates/safe_refcount.h" #include "scene/main/node.h" +class Thread; class Timer; +class StreamPeerGZIP; class HTTPRequest : public Node { GDCLASS(HTTPRequest, Node); diff --git a/scene/main/multiplayer_api.cpp b/scene/main/multiplayer_api.cpp index f8fb159436..76978fb234 100644 --- a/scene/main/multiplayer_api.cpp +++ b/scene/main/multiplayer_api.cpp @@ -31,6 +31,7 @@ #include "multiplayer_api.h" #include "core/io/marshalls.h" + StringName MultiplayerAPI::default_interface; void MultiplayerAPI::set_default_interface(const StringName &p_interface) { diff --git a/scene/main/multiplayer_peer.h b/scene/main/multiplayer_peer.h index 24ac4f871f..96f94bb7db 100644 --- a/scene/main/multiplayer_peer.h +++ b/scene/main/multiplayer_peer.h @@ -30,9 +30,8 @@ #pragma once -#include "core/io/packet_peer.h" - #include "core/extension/ext_wrappers.gen.h" +#include "core/io/packet_peer.h" #include "core/object/gdvirtual.gen.h" #include "core/variant/native_ptr.h" diff --git a/scene/main/node.cpp b/scene/main/node.cpp index c39a66c4ab..aceb027c0c 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -39,17 +39,21 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, OS); STATIC_ASSERT_INCOMPLETE_TYPE(class, Engine); #include "core/config/project_settings.h" +#include "core/io/resource.h" #include "core/io/resource_loader.h" #include "core/object/message_queue.h" #include "core/object/script_language.h" #include "core/string/print_string.h" -#include "instance_placeholder.h" #include "scene/animation/tween.h" -#include "scene/debugger/scene_debugger.h" +#include "scene/main/instance_placeholder.h" #include "scene/main/multiplayer_api.h" +#include "scene/main/viewport.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" -#include "viewport.h" + +#ifdef DEBUG_ENABLED +#include "scene/debugger/scene_debugger.h" +#endif #ifdef DEBUG_ENABLED SafeNumeric Node::total_node_count{ 0 }; diff --git a/scene/main/node.h b/scene/main/node.h index 3af5925616..e3f50cba5c 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -31,18 +31,18 @@ #pragma once #include "core/input/input_event.h" -#include "core/io/resource.h" +#include "core/object/ref_counted.h" #include "core/string/node_path.h" #include "core/templates/iterable.h" #include "core/variant/typed_array.h" #include "scene/main/scene_tree.h" #include "scene/scene_string_names.h" -class Viewport; -class Window; +class Resource; class SceneState; class Tween; -class PropertyTweener; +class Viewport; +class Window; SAFE_FLAG_TYPE_PUN_GUARANTEES SAFE_NUMERIC_TYPE_PUN_GUARANTEES(uint32_t) diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 946014bad9..9541fc1104 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -29,7 +29,9 @@ /**************************************************************************/ #include "resource_preloader.h" + #include "core/templates/rb_set.h" + void ResourcePreloader::_set_resources(const Array &p_data) { resources.clear(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 16b4ed7619..7586c00a20 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -38,11 +38,11 @@ #include "core/object/worker_thread_pool.h" #include "core/os/os.h" #include "core/profiling/profiling.h" -#include "node.h" #include "scene/animation/tween.h" #include "scene/debugger/scene_debugger.h" #include "scene/gui/control.h" #include "scene/main/multiplayer_api.h" +#include "scene/main/node.h" #include "scene/main/viewport.h" #include "scene/main/window.h" #include "scene/resources/environment.h" diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 153a597866..3be02ca618 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -39,22 +39,19 @@ #include -#undef Window - class ArrayMesh; -class PackedScene; class InputEvent; +class Material; +class MultiplayerAPI; class Node; +class PackedScene; +class Tween; +class Viewport; +class Window; + #ifndef _3D_DISABLED class Node3D; #endif -class Window; -class Material; -class Mesh; -class MultiplayerAPI; -class SceneDebugger; -class Tween; -class Viewport; class SceneTreeTimer : public RefCounted { GDCLASS(SceneTreeTimer, RefCounted); diff --git a/scene/main/scene_tree_fti_tests.h b/scene/main/scene_tree_fti_tests.h index 38e80b0ed2..b3171bf6b0 100644 --- a/scene/main/scene_tree_fti_tests.h +++ b/scene/main/scene_tree_fti_tests.h @@ -30,7 +30,7 @@ #pragma once -#include +#include class Node3D; class Node; diff --git a/scene/main/shader_globals_override.cpp b/scene/main/shader_globals_override.cpp index cf708de58a..c2977a1831 100644 --- a/scene/main/shader_globals_override.cpp +++ b/scene/main/shader_globals_override.cpp @@ -30,7 +30,6 @@ #include "shader_globals_override.h" -#include "scene/main/node.h" #include "servers/rendering/rendering_server.h" StringName *ShaderGlobalsOverride::_remap(const StringName &p_name) const { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index dd9917fa77..a9a1090720 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -45,18 +45,18 @@ #include "scene/resources/dpi_texture.h" #include "scene/resources/mesh.h" #include "scene/resources/text_line.h" -#include "scene/resources/world_2d.h" #include "servers/audio/audio_server.h" -#include "servers/rendering/rendering_server_globals.h" // 2D. #include "scene/2d/audio_listener_2d.h" #include "scene/2d/camera_2d.h" +#include "scene/resources/world_2d.h" #ifndef _3D_DISABLED #include "scene/3d/audio_listener_3d.h" #include "scene/3d/camera_3d.h" #include "scene/3d/world_environment.h" +#include "scene/resources/3d/world_3d.h" #endif // _3D_DISABLED #ifndef PHYSICS_2D_DISABLED @@ -67,6 +67,10 @@ #include "scene/3d/physics/collision_object_3d.h" #endif // PHYSICS_3D_DISABLED +#ifndef XR_DISABLED +#include "servers/rendering/rendering_server_globals.h" +#endif // XR_DISABLED + void ViewportTexture::setup_local_to_scene() { // For the same target viewport, setup is only allowed once to prevent multiple free or multiple creations. if (!vp_changed) { diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 206631e6c2..26b65856a3 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -34,13 +34,6 @@ #include "scene/resources/texture.h" #include "servers/display/display_server.h" -#ifndef _3D_DISABLED -class Camera3D; -class CollisionObject3D; -class AudioListener3D; -class World3D; -#endif // _3D_DISABLED - class AudioListener2D; class Camera2D; class CanvasItem; @@ -52,6 +45,13 @@ class Viewport; class Window; class World2D; +#ifndef _3D_DISABLED +class AudioListener3D; +class Camera3D; +class CollisionObject3D; +class World3D; +#endif // _3D_DISABLED + class ViewportTexture : public Texture2D { GDCLASS(ViewportTexture, Texture2D); diff --git a/scene/main/window.h b/scene/main/window.h index 84a872ac1e..55623f6ff0 100644 --- a/scene/main/window.h +++ b/scene/main/window.h @@ -35,7 +35,6 @@ #include "servers/display/display_server.h" class Font; -class Shortcut; class StyleBox; class ThemeOwner; class ThemeContext;