diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 4ee09b0734..2d6c293c41 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -32,9 +32,11 @@ #include "core/input/input_map.h" #include "core/input/shortcut.h" +#include "core/math/transform_2d.h" #include "core/object/class_db.h" #include "core/os/keyboard.h" #include "core/os/os.h" +#include "core/string/ustring.h" void InputEvent::set_device(int p_device) { device = p_device; diff --git a/core/input/input_event.h b/core/input/input_event.h index 2a59d5815d..ec00dfdc58 100644 --- a/core/input/input_event.h +++ b/core/input/input_event.h @@ -32,9 +32,7 @@ #include "core/input/input_enums.h" #include "core/io/resource.h" -#include "core/math/transform_2d.h" #include "core/os/keyboard.h" -#include "core/string/ustring.h" #include "core/typedefs.h" /** @@ -43,6 +41,8 @@ */ class Shortcut; +class String; +struct Transform2D; /** * Input Modifier Status diff --git a/core/io/resource.h b/core/io/resource.h index 6528a87166..b83badf030 100644 --- a/core/io/resource.h +++ b/core/io/resource.h @@ -33,7 +33,6 @@ #include "core/io/resource_uid.h" #include "core/object/gdvirtual.gen.h" #include "core/object/ref_counted.h" -#include "core/templates/safe_refcount.h" #include "core/templates/self_list.h" class Node; @@ -68,7 +67,6 @@ protected: }; private: - friend class ResBase; friend class ResourceCache; String name; diff --git a/core/io/resource_uid.h b/core/io/resource_uid.h index 3832d25d91..618f548b1e 100644 --- a/core/io/resource_uid.h +++ b/core/io/resource_uid.h @@ -30,8 +30,8 @@ #pragma once -#include "core/object/ref_counted.h" -#include "core/string/string_name.h" +#include "core/object/object.h" +#include "core/string/ustring.h" #include "core/templates/hash_map.h" class FileAccess; diff --git a/core/object/message_queue.h b/core/object/message_queue.h index 460f02eccc..2722a1ed95 100644 --- a/core/object/message_queue.h +++ b/core/object/message_queue.h @@ -31,7 +31,7 @@ #pragma once #include "core/object/object_id.h" -#include "core/os/thread_safe.h" +#include "core/os/mutex.h" #include "core/templates/local_vector.h" #include "core/templates/paged_allocator.h" #include "core/variant/variant.h" diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index c76744cde8..87bb29673b 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -31,6 +31,7 @@ #include "keyboard.h" #include "core/os/os.h" +#include "core/string/ustring.h" struct _KeyCodeText { Key code; diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 40f1c88665..8c64522abb 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -30,7 +30,9 @@ #pragma once -#include "core/string/ustring.h" +class String; + +#include // Keep the values in this enum in sync with `_keycodes` in `keyboard.cpp`, // and the bindings in `core_constants.cpp`. diff --git a/editor/animation/animation_library_editor.cpp b/editor/animation/animation_library_editor.cpp index 0bf8ff02a6..35b61e35eb 100644 --- a/editor/animation/animation_library_editor.cpp +++ b/editor/animation/animation_library_editor.cpp @@ -46,6 +46,7 @@ #include "scene/animation/animation_mixer.h" #include "scene/gui/line_edit.h" #include "scene/gui/margin_container.h" +#include "scene/main/scene_tree.h" #include "scene/resources/packed_scene.h" void AnimationLibraryEditor::set_animation_mixer(Object *p_mixer) { diff --git a/editor/animation/animation_player_editor_plugin.cpp b/editor/animation/animation_player_editor_plugin.cpp index ec656dedf7..5b33fae7e1 100644 --- a/editor/animation/animation_player_editor_plugin.cpp +++ b/editor/animation/animation_player_editor_plugin.cpp @@ -52,6 +52,7 @@ #include "editor/themes/editor_theme_manager.h" #include "scene/animation/animation_tree.h" #include "scene/gui/separator.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/animation.h" #include "scene/resources/image_texture.h" @@ -471,12 +472,12 @@ void AnimationPlayerEditor::_animation_selected(int p_which) { Node *root = player->get_node_or_null(player->get_root_node()); // Player shouldn't access parent if it's the scene root. - if (!root || (player == get_tree()->get_edited_scene_root() && player->get_root_node() == SceneStringName(path_pp))) { + if (!root || (player == get_tree()->get_edited_scene_root() && player->get_root_node() == NodePath(".."))) { NodePath cached_root_path = player->get_path_to(get_cached_root_node()); if (player->get_node_or_null(cached_root_path) != nullptr) { player->set_root_node(cached_root_path); } else { - player->set_root_node(SceneStringName(path_pp)); // No other choice, preventing crash. + player->set_root_node(NodePath("..")); // No other choice, preventing crash. } } else { cached_root_node_id = root->get_instance_id(); // Caching as `track_editor` can lose track of player's root node. diff --git a/editor/animation/animation_track_editor.cpp b/editor/animation/animation_track_editor.cpp index 84f87d4d5a..3ad6ad9319 100644 --- a/editor/animation/animation_track_editor.cpp +++ b/editor/animation/animation_track_editor.cpp @@ -64,6 +64,7 @@ #include "scene/gui/spin_box.h" #include "scene/gui/texture_rect.h" #include "scene/gui/view_panner.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "servers/audio/audio_stream.h" diff --git a/editor/animation/animation_tree_editor_plugin.cpp b/editor/animation/animation_tree_editor_plugin.cpp index c3b2f2ea15..e0b8e7975f 100644 --- a/editor/animation/animation_tree_editor_plugin.cpp +++ b/editor/animation/animation_tree_editor_plugin.cpp @@ -45,6 +45,7 @@ #include "scene/gui/margin_container.h" #include "scene/gui/scroll_container.h" #include "scene/gui/separator.h" +#include "scene/main/scene_tree.h" void AnimationTreeEditor::edit(AnimationTree *p_tree) { if (p_tree && !p_tree->is_connected("animation_list_changed", callable_mp(this, &AnimationTreeEditor::_animation_list_changed))) { diff --git a/editor/docks/scene_tree_dock.cpp b/editor/docks/scene_tree_dock.cpp index a3cfde376b..1d1f1d5ce6 100644 --- a/editor/docks/scene_tree_dock.cpp +++ b/editor/docks/scene_tree_dock.cpp @@ -67,6 +67,7 @@ #include "scene/audio/audio_stream_player.h" #include "scene/gui/box_container.h" #include "scene/gui/check_box.h" +#include "scene/main/scene_tree.h" #include "scene/property_utils.h" #include "scene/resources/packed_scene.h" #include "servers/display/display_server.h" diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 4b9aedc2c4..cadc772054 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -32,6 +32,7 @@ #include "core/io/resource_loader.h" #include "core/object/callable_mp.h" +#include "core/object/message_queue.h" #include "core/object/undo_redo.h" #include "core/os/keyboard.h" #include "core/os/os.h" diff --git a/editor/export/editor_export_plugin.h b/editor/export/editor_export_plugin.h index d9b2a9252f..69c13d6d41 100644 --- a/editor/export/editor_export_plugin.h +++ b/editor/export/editor_export_plugin.h @@ -31,6 +31,7 @@ #pragma once #include "core/os/shared_object.h" +#include "core/variant/typed_array.h" #include "editor_export_platform.h" #include "editor_export_preset.h" #include "scene/main/node.h" diff --git a/editor/file_system/editor_file_system.cpp b/editor/file_system/editor_file_system.cpp index 69fbfb5a3a..5df769aa70 100644 --- a/editor/file_system/editor_file_system.cpp +++ b/editor/file_system/editor_file_system.cpp @@ -47,6 +47,7 @@ #include "editor/script/script_editor_plugin.h" #include "editor/settings/editor_settings.h" #include "editor/settings/project_settings_editor.h" +#include "scene/main/scene_tree.h" #include "scene/resources/packed_scene.h" #include "servers/display/display_server.h" diff --git a/editor/gui/credits_roll.cpp b/editor/gui/credits_roll.cpp index c2f9b681c5..ae279842b7 100644 --- a/editor/gui/credits_roll.cpp +++ b/editor/gui/credits_roll.cpp @@ -43,6 +43,7 @@ #include "scene/gui/color_rect.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" Label *CreditsRoll::_create_label(const String &p_with_text, LabelSize p_size) { diff --git a/editor/gui/editor_about.cpp b/editor/gui/editor_about.cpp index f372ccf90a..db1e9d4350 100644 --- a/editor/gui/editor_about.cpp +++ b/editor/gui/editor_about.cpp @@ -50,6 +50,7 @@ #include "scene/gui/tab_container.h" #include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" +#include "scene/main/scene_tree.h" #include "scene/resources/style_box.h" void EditorAbout::_notification(int p_what) { diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index 68ff49350b..abff2708da 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -32,6 +32,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "core/object/message_queue.h" #include "editor/editor_string_names.h" #include "editor/settings/editor_settings.h" #include "editor/themes/editor_scale.h" diff --git a/editor/inspector/editor_inspector.cpp b/editor/inspector/editor_inspector.cpp index 4d07334192..d0e9ba94a5 100644 --- a/editor/inspector/editor_inspector.cpp +++ b/editor/inspector/editor_inspector.cpp @@ -59,6 +59,7 @@ #include "scene/gui/separator.h" #include "scene/gui/spin_box.h" #include "scene/gui/texture_rect.h" +#include "scene/main/scene_tree.h" #include "scene/main/timer.h" #include "scene/property_utils.h" #include "scene/resources/packed_scene.h" diff --git a/editor/inspector/editor_properties.cpp b/editor/inspector/editor_properties.cpp index 1fca7e978c..c90f29de93 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/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/font.h" #include "scene/resources/mesh.h" diff --git a/editor/inspector/editor_properties_array_dict.cpp b/editor/inspector/editor_properties_array_dict.cpp index ad7c666392..4d3f66deab 100644 --- a/editor/inspector/editor_properties_array_dict.cpp +++ b/editor/inspector/editor_properties_array_dict.cpp @@ -46,6 +46,7 @@ #include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/margin_container.h" +#include "scene/main/scene_tree.h" bool EditorPropertyArrayObject::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; diff --git a/editor/inspector/editor_resource_preview.cpp b/editor/inspector/editor_resource_preview.cpp index d3f5b41106..e61ce81b43 100644 --- a/editor/inspector/editor_resource_preview.cpp +++ b/editor/inspector/editor_resource_preview.cpp @@ -36,6 +36,7 @@ #include "core/io/resource_saver.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "core/os/main_loop.h" #include "core/os/os.h" #include "core/variant/variant_utility.h" #include "editor/editor_node.h" @@ -43,6 +44,7 @@ #include "editor/file_system/editor_paths.h" #include "editor/settings/editor_settings.h" #include "editor/themes/editor_scale.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/image_texture.h" #include "servers/display/display_server.h" diff --git a/editor/run/editor_run_bar.cpp b/editor/run/editor_run_bar.cpp index e2967d4b2d..1b5f7e7373 100644 --- a/editor/run/editor_run_bar.cpp +++ b/editor/run/editor_run_bar.cpp @@ -50,6 +50,7 @@ #include "scene/gui/button.h" #include "scene/gui/menu_button.h" #include "scene/gui/panel_container.h" +#include "scene/main/scene_tree.h" #ifndef XR_DISABLED #include "servers/xr/xr_server.h" diff --git a/editor/run/game_view_plugin.cpp b/editor/run/game_view_plugin.cpp index f15d5bf703..97d816617b 100644 --- a/editor/run/game_view_plugin.cpp +++ b/editor/run/game_view_plugin.cpp @@ -56,6 +56,7 @@ #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" #include "scene/gui/separator.h" +#include "scene/main/scene_tree.h" #include "servers/display/display_server.h" void GameViewDebugger::_session_started(Ref p_session) { diff --git a/editor/scene/2d/abstract_polygon_2d_editor.cpp b/editor/scene/2d/abstract_polygon_2d_editor.cpp index f4567876e0..3b6e79b584 100644 --- a/editor/scene/2d/abstract_polygon_2d_editor.cpp +++ b/editor/scene/2d/abstract_polygon_2d_editor.cpp @@ -41,6 +41,7 @@ #include "editor/themes/editor_scale.h" #include "scene/gui/button.h" #include "scene/gui/dialogs.h" +#include "scene/main/scene_tree.h" bool AbstractPolygon2DEditor::Vertex::operator==(const AbstractPolygon2DEditor::Vertex &p_vertex) const { return polygon == p_vertex.polygon && vertex == p_vertex.vertex; diff --git a/editor/scene/2d/physics/cast_2d_editor_plugin.cpp b/editor/scene/2d/physics/cast_2d_editor_plugin.cpp index e9eab537db..729222e7b4 100644 --- a/editor/scene/2d/physics/cast_2d_editor_plugin.cpp +++ b/editor/scene/2d/physics/cast_2d_editor_plugin.cpp @@ -36,6 +36,7 @@ #include "editor/scene/canvas_item_editor_plugin.h" #include "scene/2d/physics/ray_cast_2d.h" #include "scene/2d/physics/shape_cast_2d.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" void Cast2DEditor::_notification(int p_what) { diff --git a/editor/scene/2d/physics/collision_shape_2d_editor_plugin.cpp b/editor/scene/2d/physics/collision_shape_2d_editor_plugin.cpp index b05f621f3a..3383dc001a 100644 --- a/editor/scene/2d/physics/collision_shape_2d_editor_plugin.cpp +++ b/editor/scene/2d/physics/collision_shape_2d_editor_plugin.cpp @@ -37,6 +37,7 @@ #include "editor/editor_undo_redo_manager.h" #include "editor/scene/canvas_item_editor_plugin.h" #include "editor/settings/editor_settings.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" #include "scene/resources/2d/capsule_shape_2d.h" #include "scene/resources/2d/circle_shape_2d.h" diff --git a/editor/scene/2d/polygon_2d_editor_plugin.cpp b/editor/scene/2d/polygon_2d_editor_plugin.cpp index 4650faf0d7..ad8dee0064 100644 --- a/editor/scene/2d/polygon_2d_editor_plugin.cpp +++ b/editor/scene/2d/polygon_2d_editor_plugin.cpp @@ -56,6 +56,7 @@ #include "scene/gui/spin_box.h" #include "scene/gui/split_container.h" #include "scene/gui/view_panner.h" +#include "scene/main/scene_tree.h" #include "servers/rendering/rendering_server.h" Node2D *Polygon2DEditor::_get_node() const { diff --git a/editor/scene/2d/sprite_2d_editor_plugin.cpp b/editor/scene/2d/sprite_2d_editor_plugin.cpp index 84af8cead6..e9b46ea427 100644 --- a/editor/scene/2d/sprite_2d_editor_plugin.cpp +++ b/editor/scene/2d/sprite_2d_editor_plugin.cpp @@ -48,6 +48,7 @@ #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" #include "scene/gui/view_panner.h" +#include "scene/main/scene_tree.h" #include "scene/resources/mesh.h" #include "thirdparty/clipper2/include/clipper2/clipper.h" diff --git a/editor/scene/2d/tiles/tile_data_editors.cpp b/editor/scene/2d/tiles/tile_data_editors.cpp index 7db36289da..fe0075731e 100644 --- a/editor/scene/2d/tiles/tile_data_editors.cpp +++ b/editor/scene/2d/tiles/tile_data_editors.cpp @@ -37,6 +37,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "core/os/keyboard.h" +#include "scene/main/scene_tree.h" #include "editor/editor_node.h" #include "editor/editor_string_names.h" diff --git a/editor/scene/2d/tiles/tile_map_layer_editor.cpp b/editor/scene/2d/tiles/tile_map_layer_editor.cpp index d9c5d0fb70..2843288b31 100644 --- a/editor/scene/2d/tiles/tile_map_layer_editor.cpp +++ b/editor/scene/2d/tiles/tile_map_layer_editor.cpp @@ -51,6 +51,7 @@ #include "scene/2d/tile_map_layer.h" #include "scene/gui/grid_container.h" #include "scene/gui/split_container.h" +#include "scene/main/scene_tree.h" void SwitchSeparator::set_vertical(bool p_vertical) { h_separator->set_visible(p_vertical); diff --git a/editor/scene/2d/tiles/tiles_editor_plugin.cpp b/editor/scene/2d/tiles/tiles_editor_plugin.cpp index 9e57009197..18d2e04ed9 100644 --- a/editor/scene/2d/tiles/tiles_editor_plugin.cpp +++ b/editor/scene/2d/tiles/tiles_editor_plugin.cpp @@ -48,6 +48,7 @@ #include "scene/2d/tile_map_layer.h" #include "scene/gui/button.h" #include "scene/gui/control.h" +#include "scene/main/scene_tree.h" #include "scene/resources/2d/tile_set.h" #include "scene/resources/image_texture.h" #include "servers/rendering/rendering_server.h" diff --git a/editor/scene/3d/gpu_particles_collision_sdf_editor_plugin.cpp b/editor/scene/3d/gpu_particles_collision_sdf_editor_plugin.cpp index 48903e6540..5b8a49ab8c 100644 --- a/editor/scene/3d/gpu_particles_collision_sdf_editor_plugin.cpp +++ b/editor/scene/3d/gpu_particles_collision_sdf_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "editor/editor_node.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "scene/main/scene_tree.h" void GPUParticlesCollisionSDF3DEditorPlugin::_bake() { if (col_sdf) { diff --git a/editor/scene/3d/lightmap_gi_editor_plugin.cpp b/editor/scene/3d/lightmap_gi_editor_plugin.cpp index 27547779f7..373a31c50a 100644 --- a/editor/scene/3d/lightmap_gi_editor_plugin.cpp +++ b/editor/scene/3d/lightmap_gi_editor_plugin.cpp @@ -36,6 +36,7 @@ #include "editor/editor_node.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "scene/main/scene_tree.h" #include "servers/display/display_server.h" #include "servers/rendering/rendering_server.h" diff --git a/editor/scene/3d/mesh_instance_3d_editor_plugin.cpp b/editor/scene/3d/mesh_instance_3d_editor_plugin.cpp index 18a53829c8..e49841fb3c 100644 --- a/editor/scene/3d/mesh_instance_3d_editor_plugin.cpp +++ b/editor/scene/3d/mesh_instance_3d_editor_plugin.cpp @@ -45,6 +45,7 @@ #include "scene/gui/dialogs.h" #include "scene/gui/menu_button.h" #include "scene/gui/spin_box.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/box_shape_3d.h" #include "scene/resources/3d/capsule_shape_3d.h" #include "scene/resources/3d/concave_polygon_shape_3d.h" diff --git a/editor/scene/3d/node_3d_editor_gizmos.cpp b/editor/scene/3d/node_3d_editor_gizmos.cpp index b7caf8a658..1dc497091d 100644 --- a/editor/scene/3d/node_3d_editor_gizmos.cpp +++ b/editor/scene/3d/node_3d_editor_gizmos.cpp @@ -37,6 +37,7 @@ #include "editor/editor_string_names.h" #include "editor/scene/3d/node_3d_editor_plugin.h" #include "editor/settings/editor_settings.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/primitive_meshes.h" #include "servers/rendering/rendering_server.h" diff --git a/editor/scene/3d/node_3d_editor_plugin.cpp b/editor/scene/3d/node_3d_editor_plugin.cpp index 7a397df852..0515c163ab 100644 --- a/editor/scene/3d/node_3d_editor_plugin.cpp +++ b/editor/scene/3d/node_3d_editor_plugin.cpp @@ -105,6 +105,7 @@ #include "scene/gui/separator.h" #include "scene/gui/split_container.h" #include "scene/gui/subviewport_container.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/sky_material.h" #include "scene/resources/packed_scene.h" #include "scene/resources/sky.h" diff --git a/editor/scene/3d/occluder_instance_3d_editor_plugin.cpp b/editor/scene/3d/occluder_instance_3d_editor_plugin.cpp index b8cb563fad..ce6c44c37a 100644 --- a/editor/scene/3d/occluder_instance_3d_editor_plugin.cpp +++ b/editor/scene/3d/occluder_instance_3d_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "editor/editor_node.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "scene/main/scene_tree.h" void OccluderInstance3DEditorPlugin::_bake_select_file(const String &p_file) { if (occluder_instance) { diff --git a/editor/scene/3d/polygon_3d_editor_plugin.cpp b/editor/scene/3d/polygon_3d_editor_plugin.cpp index af11024f6c..a503e1bec6 100644 --- a/editor/scene/3d/polygon_3d_editor_plugin.cpp +++ b/editor/scene/3d/polygon_3d_editor_plugin.cpp @@ -42,6 +42,7 @@ #include "editor/scene/canvas_item_editor_plugin.h" #include "editor/settings/editor_settings.h" #include "scene/3d/camera_3d.h" +#include "scene/main/scene_tree.h" void Polygon3DEditor::_notification(int p_what) { switch (p_what) { diff --git a/editor/scene/3d/skeleton_3d_editor_plugin.cpp b/editor/scene/3d/skeleton_3d_editor_plugin.cpp index 3f65eb86a7..a73e62fd2c 100644 --- a/editor/scene/3d/skeleton_3d_editor_plugin.cpp +++ b/editor/scene/3d/skeleton_3d_editor_plugin.cpp @@ -48,6 +48,7 @@ #include "scene/3d/physics/physical_bone_simulator_3d.h" #include "scene/gui/separator.h" #include "scene/gui/texture_rect.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/capsule_shape_3d.h" #include "scene/resources/skeleton_profile.h" #include "scene/resources/surface_tool.h" diff --git a/editor/scene/3d/voxel_gi_editor_plugin.cpp b/editor/scene/3d/voxel_gi_editor_plugin.cpp index e3eeda9bcf..7ef0187ab8 100644 --- a/editor/scene/3d/voxel_gi_editor_plugin.cpp +++ b/editor/scene/3d/voxel_gi_editor_plugin.cpp @@ -37,6 +37,7 @@ #include "editor/editor_node.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" +#include "scene/main/scene_tree.h" void VoxelGIEditorPlugin::_bake() { if (voxel_gi) { diff --git a/editor/scene/canvas_item_editor_plugin.cpp b/editor/scene/canvas_item_editor_plugin.cpp index ab1b925295..24c56032ad 100644 --- a/editor/scene/canvas_item_editor_plugin.cpp +++ b/editor/scene/canvas_item_editor_plugin.cpp @@ -68,6 +68,7 @@ #include "scene/gui/subviewport_container.h" #include "scene/gui/view_panner.h" #include "scene/main/canvas_layer.h" +#include "scene/main/scene_tree.h" #include "scene/main/timer.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" diff --git a/editor/scene/connections_dialog.cpp b/editor/scene/connections_dialog.cpp index 137aaf362b..594f9f7930 100644 --- a/editor/scene/connections_dialog.cpp +++ b/editor/scene/connections_dialog.cpp @@ -56,6 +56,7 @@ #include "scene/gui/margin_container.h" #include "scene/gui/popup_menu.h" #include "scene/gui/spin_box.h" +#include "scene/main/scene_tree.h" #include "servers/display/display_server.h" static Node *_find_first_script(Node *p_root, Node *p_node) { diff --git a/editor/scene/gui/theme_editor_preview.h b/editor/scene/gui/theme_editor_preview.h index bddcfc4448..28f56d43c7 100644 --- a/editor/scene/gui/theme_editor_preview.h +++ b/editor/scene/gui/theme_editor_preview.h @@ -37,6 +37,7 @@ class Button; class ColorPickerButton; class ColorRect; class MarginContainer; +class PackedScene; class ScrollContainer; class ThemeEditorPreview : public VBoxContainer { diff --git a/editor/scene/packed_scene_editor_plugin.h b/editor/scene/packed_scene_editor_plugin.h index 2463f19118..ba22cf75f9 100644 --- a/editor/scene/packed_scene_editor_plugin.h +++ b/editor/scene/packed_scene_editor_plugin.h @@ -34,6 +34,8 @@ #include "editor/plugins/editor_plugin.h" #include "scene/gui/box_container.h" +class PackedScene; + class PackedSceneEditor : public VBoxContainer { GDCLASS(PackedSceneEditor, VBoxContainer); diff --git a/editor/scene/scene_tree_editor.cpp b/editor/scene/scene_tree_editor.cpp index de9f145a34..7fe1bf079b 100644 --- a/editor/scene/scene_tree_editor.cpp +++ b/editor/scene/scene_tree_editor.cpp @@ -54,6 +54,7 @@ #include "scene/gui/flow_container.h" #include "scene/gui/label.h" #include "scene/gui/texture_rect.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" diff --git a/editor/scene/sprite_frames_editor_plugin.cpp b/editor/scene/sprite_frames_editor_plugin.cpp index 051165b90a..0ff33bdf58 100644 --- a/editor/scene/sprite_frames_editor_plugin.cpp +++ b/editor/scene/sprite_frames_editor_plugin.cpp @@ -56,6 +56,7 @@ #include "scene/gui/panel_container.h" #include "scene/gui/separator.h" #include "scene/gui/split_container.h" +#include "scene/main/scene_tree.h" #include "scene/resources/atlas_texture.h" static void _draw_shadowed_line(Control *p_control, const Point2 &p_from, const Size2 &p_size, const Size2 &p_shadow_offset, Color p_color, Color p_shadow_color) { diff --git a/editor/scene/texture/texture_region_editor_plugin.cpp b/editor/scene/texture/texture_region_editor_plugin.cpp index 3ec4e2fab1..2672e7ffbb 100644 --- a/editor/scene/texture/texture_region_editor_plugin.cpp +++ b/editor/scene/texture/texture_region_editor_plugin.cpp @@ -47,6 +47,7 @@ #include "scene/gui/separator.h" #include "scene/gui/spin_box.h" #include "scene/gui/view_panner.h" +#include "scene/main/scene_tree.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/style_box_texture.h" #include "servers/rendering/rendering_server.h" diff --git a/editor/script/find_in_files.cpp b/editor/script/find_in_files.cpp index afe0f05039..ff340d0c3e 100644 --- a/editor/script/find_in_files.cpp +++ b/editor/script/find_in_files.cpp @@ -50,6 +50,7 @@ #include "scene/gui/progress_bar.h" #include "scene/gui/tab_container.h" #include "scene/gui/tree.h" +#include "scene/main/scene_tree.h" const char *FindInFiles::SIGNAL_RESULT_FOUND = "result_found"; diff --git a/editor/script/script_editor_plugin.cpp b/editor/script/script_editor_plugin.cpp index e0899f5644..eb03a12d71 100644 --- a/editor/script/script_editor_plugin.cpp +++ b/editor/script/script_editor_plugin.cpp @@ -77,6 +77,7 @@ #include "scene/gui/tab_container.h" #include "scene/gui/texture_rect.h" #include "scene/main/node.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "servers/display/display_server.h" diff --git a/editor/script/script_text_editor.cpp b/editor/script/script_text_editor.cpp index 7756839a8f..277ca4c919 100644 --- a/editor/script/script_text_editor.cpp +++ b/editor/script/script_text_editor.cpp @@ -56,6 +56,7 @@ #include "scene/gui/menu_button.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/split_container.h" +#include "scene/main/scene_tree.h" #include "scene/resources/style_box_flat.h" #include "servers/rendering/rendering_server.h" diff --git a/editor/settings/editor_autoload_settings.cpp b/editor/settings/editor_autoload_settings.cpp index 3613125d55..863b3c0c72 100644 --- a/editor/settings/editor_autoload_settings.cpp +++ b/editor/settings/editor_autoload_settings.cpp @@ -43,6 +43,7 @@ #include "editor/settings/project_settings_editor.h" #include "scene/gui/button.h" #include "scene/gui/tree.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" diff --git a/editor/shader/shader_create_dialog.cpp b/editor/shader/shader_create_dialog.cpp index 6378b0b7b7..df031576e6 100644 --- a/editor/shader/shader_create_dialog.cpp +++ b/editor/shader/shader_create_dialog.cpp @@ -39,6 +39,7 @@ #include "editor/gui/editor_validation_panel.h" #include "editor/shader/editor_shader_language_plugin.h" #include "editor/themes/editor_scale.h" +#include "scene/main/scene_tree.h" #include "scene/resources/shader_include.h" #include "servers/rendering/shader_types.h" diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 720ee4e808..8119666f44 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -34,6 +34,7 @@ #include "core/math/geometry_2d.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h" #include "scene/resources/navigation_mesh.h" #include "servers/rendering/rendering_server.h" diff --git a/modules/csg/editor/csg_gizmos.cpp b/modules/csg/editor/csg_gizmos.cpp index 91e6e17ffc..0ff2417313 100644 --- a/modules/csg/editor/csg_gizmos.cpp +++ b/modules/csg/editor/csg_gizmos.cpp @@ -43,6 +43,7 @@ #include "scene/3d/physics/collision_shape_3d.h" #include "scene/gui/dialogs.h" #include "scene/gui/menu_button.h" +#include "scene/main/scene_tree.h" void CSGShapeEditor::_node_removed(Node *p_node) { if (p_node == node) { diff --git a/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp b/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp index 904613ff1f..4d00b2b6b9 100644 --- a/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp +++ b/modules/gltf/editor/editor_scene_exporter_gltf_plugin.cpp @@ -40,6 +40,7 @@ #include "editor/inspector/editor_inspector.h" #include "editor/themes/editor_scale.h" #include "scene/gui/dialogs.h" +#include "scene/main/scene_tree.h" String SceneExporterGLTFPlugin::get_plugin_name() const { return "ConvertGLTF2"; diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 9eb8cce812..379a08ad9e 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -55,6 +55,7 @@ #include "scene/gui/separator.h" #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "servers/rendering/rendering_server.h" diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp index 5dd0af8eff..b0c9ff94e3 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -34,6 +34,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "core/object/message_queue.h" #include "editor/editor_node.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp index 58dd7e4b05..1dbb5aea16 100644 --- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp +++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp @@ -39,6 +39,7 @@ #include "editor/docks/editor_dock_manager.h" #include "editor/editor_interface.h" #include "editor/editor_node.h" +#include "scene/main/scene_tree.h" void MultiplayerEditorDebugger::_bind_methods() { ADD_SIGNAL(MethodInfo("open_request", PropertyInfo(Variant::STRING, "path"))); diff --git a/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp b/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp index 89f350ff6d..b954c90b70 100644 --- a/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp +++ b/modules/navigation_2d/2d/nav_mesh_generator_2d.cpp @@ -33,6 +33,7 @@ #include "nav_mesh_generator_2d.h" #include "core/config/project_settings.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/modules/navigation_2d/editor/navigation_link_2d_editor_plugin.cpp b/modules/navigation_2d/editor/navigation_link_2d_editor_plugin.cpp index 699e4d31f1..63b79981db 100644 --- a/modules/navigation_2d/editor/navigation_link_2d_editor_plugin.cpp +++ b/modules/navigation_2d/editor/navigation_link_2d_editor_plugin.cpp @@ -35,6 +35,7 @@ #include "editor/editor_undo_redo_manager.h" #include "editor/scene/canvas_item_editor_plugin.h" #include "editor/settings/editor_settings.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" void NavigationLink2DEditor::_notification(int p_what) { diff --git a/modules/navigation_3d/3d/nav_mesh_generator_3d.cpp b/modules/navigation_3d/3d/nav_mesh_generator_3d.cpp index bd7e23373b..200794df16 100644 --- a/modules/navigation_3d/3d/nav_mesh_generator_3d.cpp +++ b/modules/navigation_3d/3d/nav_mesh_generator_3d.cpp @@ -33,6 +33,7 @@ #include "core/config/project_settings.h" #include "core/os/thread.h" #include "scene/3d/node_3d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h" #include "scene/resources/navigation_mesh.h" diff --git a/modules/navigation_3d/editor/navigation_obstacle_3d_editor_plugin.cpp b/modules/navigation_3d/editor/navigation_obstacle_3d_editor_plugin.cpp index 0378b73ee7..59542c2c6e 100644 --- a/modules/navigation_3d/editor/navigation_obstacle_3d_editor_plugin.cpp +++ b/modules/navigation_3d/editor/navigation_obstacle_3d_editor_plugin.cpp @@ -41,6 +41,7 @@ #include "scene/3d/navigation/navigation_obstacle_3d.h" #include "scene/gui/button.h" #include "scene/gui/dialogs.h" +#include "scene/main/scene_tree.h" #include "servers/navigation_3d/navigation_server_3d.h" #include "servers/rendering/rendering_server.h" diff --git a/modules/navigation_3d/editor/navigation_region_3d_editor_plugin.cpp b/modules/navigation_3d/editor/navigation_region_3d_editor_plugin.cpp index 8d3990ff16..6c84681922 100644 --- a/modules/navigation_3d/editor/navigation_region_3d_editor_plugin.cpp +++ b/modules/navigation_3d/editor/navigation_region_3d_editor_plugin.cpp @@ -40,6 +40,7 @@ #include "scene/gui/button.h" #include "scene/gui/dialogs.h" #include "scene/gui/label.h" +#include "scene/main/scene_tree.h" #include "servers/navigation_3d/navigation_server_3d.h" void NavigationRegion3DEditor::_node_removed(Node *p_node) { diff --git a/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp b/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp index 9e698b3d00..8fed31c313 100644 --- a/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp +++ b/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp @@ -35,6 +35,7 @@ #include "editor/themes/editor_scale.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/split_container.h" +#include "scene/main/scene_tree.h" SnapshotRefCountedView::SnapshotRefCountedView() { set_name(TTRC("RefCounted")); diff --git a/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp b/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp index 78c7779623..2b69d5a1cf 100644 --- a/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp +++ b/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp @@ -52,6 +52,7 @@ #include "scene/gui/option_button.h" #include "scene/gui/split_container.h" #include "scene/gui/tab_container.h" +#include "scene/main/scene_tree.h" // ObjectDB snapshots are very large. In remote_debugger_peer.cpp, the max in_buf and out_buf size is 8mb. // Snapshots are typically larger than that, so we send them 6mb at a time. Leaving 2mb for other data. diff --git a/platform/macos/key_mapping_macos.mm b/platform/macos/key_mapping_macos.mm index 07cad71895..640598020b 100644 --- a/platform/macos/key_mapping_macos.mm +++ b/platform/macos/key_mapping_macos.mm @@ -30,6 +30,7 @@ #import "key_mapping_macos.h" +#include "core/string/ustring.h" #include "core/templates/hash_map.h" #include "core/templates/hash_set.h" diff --git a/platform/web/audio_driver_web.cpp b/platform/web/audio_driver_web.cpp index c870554127..22635cfcbe 100644 --- a/platform/web/audio_driver_web.cpp +++ b/platform/web/audio_driver_web.cpp @@ -34,6 +34,7 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" +#include "core/math/math_funcs_binary.h" #include "core/object/object.h" #include "scene/main/node.h" #include "servers/audio/audio_stream.h" diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 013f2cbd23..3b3e0f7f78 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -35,6 +35,7 @@ #include "core/input/input.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" void Camera2D::_update_scroll() { diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 6e1e52efbd..0de9d8a231 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -31,6 +31,7 @@ #include "canvas_modulate.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "servers/rendering/rendering_server.h" void CanvasModulate::_on_in_canvas_visibility_changed(bool p_new_visibility) { diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index f108868003..dfc0768cec 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -37,6 +37,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/2d/gpu_particles_2d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/canvas_item_material.h" #include "scene/resources/curve_texture.h" diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 2091018007..156bced6ae 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -32,6 +32,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "servers/rendering/rendering_server.h" void Light2D::owner_changed_notify() { diff --git a/scene/2d/navigation/navigation_agent_2d.cpp b/scene/2d/navigation/navigation_agent_2d.cpp index 21fcbeb8c9..2fbb7cac4c 100644 --- a/scene/2d/navigation/navigation_agent_2d.cpp +++ b/scene/2d/navigation/navigation_agent_2d.cpp @@ -34,6 +34,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/2d/navigation/navigation_link_2d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/world_2d.h" #include "servers/navigation_2d/navigation_server_2d.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/2d/navigation/navigation_obstacle_2d.cpp b/scene/2d/navigation/navigation_obstacle_2d.cpp index 7de62154ab..f20e5e7e5a 100644 --- a/scene/2d/navigation/navigation_obstacle_2d.cpp +++ b/scene/2d/navigation/navigation_obstacle_2d.cpp @@ -34,6 +34,7 @@ #include "core/math/geometry_2d.h" #include "core/object/callable_mp.h" #include "core/object/class_db.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" #include "scene/resources/world_2d.h" diff --git a/scene/2d/navigation/navigation_region_2d.cpp b/scene/2d/navigation/navigation_region_2d.cpp index f05e287874..91a1ddea7c 100644 --- a/scene/2d/navigation/navigation_region_2d.cpp +++ b/scene/2d/navigation/navigation_region_2d.cpp @@ -34,6 +34,7 @@ #include "core/math/random_pcg.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "scene/resources/world_2d.h" #include "servers/navigation_2d/navigation_server_2d.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/2d/physics/collision_polygon_2d.cpp b/scene/2d/physics/collision_polygon_2d.cpp index 5e58d2cc7e..61bcedadc5 100644 --- a/scene/2d/physics/collision_polygon_2d.cpp +++ b/scene/2d/physics/collision_polygon_2d.cpp @@ -35,6 +35,7 @@ #include "core/object/class_db.h" #include "scene/2d/physics/area_2d.h" #include "scene/2d/physics/collision_object_2d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/2d/concave_polygon_shape_2d.h" #include "scene/resources/2d/convex_polygon_shape_2d.h" diff --git a/scene/2d/physics/joints/damped_spring_joint_2d.cpp b/scene/2d/physics/joints/damped_spring_joint_2d.cpp index 3ea4b2e21b..9af1ff85ce 100644 --- a/scene/2d/physics/joints/damped_spring_joint_2d.cpp +++ b/scene/2d/physics/joints/damped_spring_joint_2d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/2d/physics/physics_body_2d.h" +#include "scene/main/scene_tree.h" void DampedSpringJoint2D::_notification(int p_what) { switch (p_what) { diff --git a/scene/2d/physics/joints/groove_joint_2d.cpp b/scene/2d/physics/joints/groove_joint_2d.cpp index 40c89ed98c..f2e7a06ff7 100644 --- a/scene/2d/physics/joints/groove_joint_2d.cpp +++ b/scene/2d/physics/joints/groove_joint_2d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/2d/physics/physics_body_2d.h" +#include "scene/main/scene_tree.h" void GrooveJoint2D::_notification(int p_what) { switch (p_what) { diff --git a/scene/2d/physics/joints/pin_joint_2d.cpp b/scene/2d/physics/joints/pin_joint_2d.cpp index 193991419c..400a9da2ea 100644 --- a/scene/2d/physics/joints/pin_joint_2d.cpp +++ b/scene/2d/physics/joints/pin_joint_2d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/2d/physics/physics_body_2d.h" +#include "scene/main/scene_tree.h" void PinJoint2D::_notification(int p_what) { switch (p_what) { diff --git a/scene/2d/physics/ray_cast_2d.cpp b/scene/2d/physics/ray_cast_2d.cpp index 7244068601..abfd314764 100644 --- a/scene/2d/physics/ray_cast_2d.cpp +++ b/scene/2d/physics/ray_cast_2d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/2d/physics/collision_object_2d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/world_2d.h" void RayCast2D::set_target_position(const Vector2 &p_point) { diff --git a/scene/2d/physics/shape_cast_2d.cpp b/scene/2d/physics/shape_cast_2d.cpp index b81df9c5c5..2d1dba7336 100644 --- a/scene/2d/physics/shape_cast_2d.cpp +++ b/scene/2d/physics/shape_cast_2d.cpp @@ -34,6 +34,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/2d/physics/collision_object_2d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/world_2d.h" #include "servers/physics_2d/physics_server_2d.h" diff --git a/scene/2d/physics/touch_screen_button.cpp b/scene/2d/physics/touch_screen_button.cpp index 3bf6b2e81f..3693910638 100644 --- a/scene/2d/physics/touch_screen_button.cpp +++ b/scene/2d/physics/touch_screen_button.cpp @@ -34,6 +34,7 @@ #include "core/input/input.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" #include "servers/display/accessibility_server.h" #include "servers/display/display_server.h" diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index bb45757961..91ee328e72 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -34,6 +34,7 @@ #include "core/config/project_settings.h" #include "core/object/class_db.h" #include "core/os/os.h" +#include "scene/main/scene_tree.h" #include "servers/rendering/rendering_server.h" void Light3D::set_param(Param p_param, real_t p_value) { diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 6e2380d0eb..e3141d6c88 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -33,6 +33,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/3d/skeleton_3d.h" +#include "scene/main/scene_tree.h" #ifndef PHYSICS_3D_DISABLED #include "scene/3d/physics/collision_shape_3d.h" diff --git a/scene/3d/navigation/navigation_agent_3d.cpp b/scene/3d/navigation/navigation_agent_3d.cpp index 9603a254e2..900811186c 100644 --- a/scene/3d/navigation/navigation_agent_3d.cpp +++ b/scene/3d/navigation/navigation_agent_3d.cpp @@ -34,6 +34,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/3d/navigation/navigation_link_3d.h" +#include "scene/main/scene_tree.h" #include "servers/navigation_3d/navigation_server_3d.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/navigation/navigation_agent_3d.h b/scene/3d/navigation/navigation_agent_3d.h index 03a92b7bc7..7d6a55477b 100644 --- a/scene/3d/navigation/navigation_agent_3d.h +++ b/scene/3d/navigation/navigation_agent_3d.h @@ -35,6 +35,7 @@ #include "servers/navigation_3d/navigation_path_query_parameters_3d.h" #include "servers/navigation_3d/navigation_path_query_result_3d.h" +class ArrayMesh; class Node3D; class StandardMaterial3D; diff --git a/scene/3d/navigation/navigation_link_3d.h b/scene/3d/navigation/navigation_link_3d.h index ff0c371251..23aeadff60 100644 --- a/scene/3d/navigation/navigation_link_3d.h +++ b/scene/3d/navigation/navigation_link_3d.h @@ -32,6 +32,8 @@ #include "scene/3d/node_3d.h" +class ArrayMesh; + class NavigationLink3D : public Node3D { GDCLASS(NavigationLink3D, Node3D); diff --git a/scene/3d/navigation/navigation_obstacle_3d.cpp b/scene/3d/navigation/navigation_obstacle_3d.cpp index 94bd5f7d6a..7e988c63c8 100644 --- a/scene/3d/navigation/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation/navigation_obstacle_3d.cpp @@ -34,6 +34,7 @@ #include "core/math/geometry_2d.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h" #include "scene/resources/navigation_mesh.h" #include "servers/navigation_3d/navigation_server_3d.h" diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h index 59cbca06ca..9f77c699e3 100644 --- a/scene/3d/node_3d.h +++ b/scene/3d/node_3d.h @@ -31,7 +31,6 @@ #pragma once #include "scene/main/node.h" -#include "scene/main/scene_tree.h" #include "scene/resources/3d/world_3d.h" class Node3DGizmo : public RefCounted { @@ -233,7 +232,7 @@ protected: public: enum { - NOTIFICATION_TRANSFORM_CHANGED = SceneTree::NOTIFICATION_TRANSFORM_CHANGED, + NOTIFICATION_TRANSFORM_CHANGED = 2000, // Keep in sync with SceneTree. NOTIFICATION_ENTER_WORLD = 41, NOTIFICATION_EXIT_WORLD = 42, NOTIFICATION_VISIBILITY_CHANGED = 43, diff --git a/scene/3d/occluder_instance_3d.h b/scene/3d/occluder_instance_3d.h index 1078317f9e..4c040c9787 100644 --- a/scene/3d/occluder_instance_3d.h +++ b/scene/3d/occluder_instance_3d.h @@ -32,6 +32,8 @@ #include "scene/3d/visual_instance_3d.h" +class ArrayMesh; + class Occluder3D : public Resource { GDCLASS(Occluder3D, Resource); RES_BASE_EXTENSION("occ"); diff --git a/scene/3d/path_3d.h b/scene/3d/path_3d.h index be7e5e3db9..bd073083b2 100644 --- a/scene/3d/path_3d.h +++ b/scene/3d/path_3d.h @@ -34,6 +34,8 @@ #include "scene/resources/curve.h" #include "scene/resources/material.h" +class ArrayMesh; + class Path3D : public Node3D { GDCLASS(Path3D, Node3D); diff --git a/scene/3d/physics/collision_object_3d.cpp b/scene/3d/physics/collision_object_3d.cpp index 90559334ab..88cf223fad 100644 --- a/scene/3d/physics/collision_object_3d.cpp +++ b/scene/3d/physics/collision_object_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/main/scene_tree.h" #include "scene/resources/3d/shape_3d.h" #include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/physics/ray_cast_3d.cpp b/scene/3d/physics/ray_cast_3d.cpp index c70bf2ed49..51d1d7c525 100644 --- a/scene/3d/physics/ray_cast_3d.cpp +++ b/scene/3d/physics/ray_cast_3d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/3d/physics/collision_object_3d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/physics/ray_cast_3d.h b/scene/3d/physics/ray_cast_3d.h index 1c467f0531..5a1c4dc6b3 100644 --- a/scene/3d/physics/ray_cast_3d.h +++ b/scene/3d/physics/ray_cast_3d.h @@ -33,6 +33,7 @@ #include "scene/3d/node_3d.h" #include "scene/resources/material.h" +class ArrayMesh; class CollisionObject3D; class RayCast3D : public Node3D { diff --git a/scene/3d/physics/shape_cast_3d.cpp b/scene/3d/physics/shape_cast_3d.cpp index a75c9d0cea..e2cedb40b0 100644 --- a/scene/3d/physics/shape_cast_3d.cpp +++ b/scene/3d/physics/shape_cast_3d.cpp @@ -34,6 +34,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/3d/physics/collision_object_3d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/concave_polygon_shape_3d.h" #include "scene/resources/mesh.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/physics/spring_arm_3d.cpp b/scene/3d/physics/spring_arm_3d.cpp index bad2f59623..878fddec7f 100644 --- a/scene/3d/physics/spring_arm_3d.cpp +++ b/scene/3d/physics/spring_arm_3d.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/class_db.h" #include "scene/3d/camera_3d.h" +#include "scene/main/scene_tree.h" #include "scene/resources/3d/shape_3d.h" void SpringArm3D::_notification(int p_what) { diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp index 505d5aaffa..86bb3d1740 100644 --- a/scene/3d/visual_instance_3d.cpp +++ b/scene/3d/visual_instance_3d.cpp @@ -36,6 +36,7 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer); #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "core/os/os.h" +#include "scene/main/scene_tree.h" #include "scene/resources/material.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/3d/visual_instance_3d.h b/scene/3d/visual_instance_3d.h index 3e7b671aaa..48e26e0c7d 100644 --- a/scene/3d/visual_instance_3d.h +++ b/scene/3d/visual_instance_3d.h @@ -33,6 +33,7 @@ #include "scene/3d/node_3d.h" #include "servers/rendering/rendering_server_enums.h" +class Material; class TriangleMesh; class VisualInstance3D : public Node3D { diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp index e13531d375..fc091b30e5 100644 --- a/scene/3d/voxel_gi.cpp +++ b/scene/3d/voxel_gi.cpp @@ -36,6 +36,7 @@ #include "scene/3d/mesh_instance_3d.h" #include "scene/3d/multimesh_instance_3d.h" #include "scene/3d/voxelizer.h" +#include "scene/main/scene_tree.h" #include "scene/resources/camera_attributes.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index fe103534f8..436dfbc13e 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -2489,7 +2489,7 @@ void AnimationMixer::_bind_methods() { } AnimationMixer::AnimationMixer() { - root_node = SceneStringName(path_pp); + root_node = NodePath(".."); } AnimationMixer::~AnimationMixer() { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 5d1400573d..c87ce8404e 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -35,6 +35,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "core/os/os.h" +#include "scene/main/scene_tree.h" bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 9de9abfe0b..d5cecba78c 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -848,7 +848,7 @@ void AnimationTree::_notification(int p_what) { void AnimationTree::set_animation_player(const NodePath &p_path) { animation_player = p_path; if (p_path.is_empty()) { - set_root_node(SceneStringName(path_pp)); + set_root_node(NodePath("..")); while (animation_libraries.size()) { remove_animation_library(animation_libraries[0].name); } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 86abba1a4e..9e0d7a2223 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -33,6 +33,7 @@ #include "core/object/class_db.h" #include "scene/animation/easing_equations.h" #include "scene/main/node.h" +#include "scene/main/scene_tree.h" #include "scene/resources/animation.h" #define CHECK_VALID() \ diff --git a/scene/audio/audio_stream_player_internal.cpp b/scene/audio/audio_stream_player_internal.cpp index adac5c96a8..133d16c78b 100644 --- a/scene/audio/audio_stream_player_internal.cpp +++ b/scene/audio/audio_stream_player_internal.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/callable_mp.h" #include "scene/main/node.h" +#include "scene/main/scene_tree.h" #include "servers/audio/audio_stream.h" void AudioStreamPlayerInternal::_set_process(bool p_enabled) { diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index a3329ed2ca..df8a005e62 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -51,6 +51,7 @@ #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" #include "scene/gui/texture_rect.h" +#include "scene/main/scene_tree.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/color_palette.h" #include "scene/resources/image_texture.h" diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index baed743fe8..2586cabdd0 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -44,6 +44,7 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer); #include "scene/gui/container.h" #include "scene/gui/scroll_container.h" #include "scene/main/canvas_layer.h" +#include "scene/main/scene_tree.h" #include "scene/main/window.h" #include "scene/theme/theme_db.h" #include "scene/theme/theme_owner.h" diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 599d7ae3e8..0e07326fbc 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -35,6 +35,7 @@ #include "scene/gui/box_container.h" #include "scene/gui/graph_edit.h" #include "scene/gui/label.h" +#include "scene/main/scene_tree.h" #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 1f4f09af75..9366834a43 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -33,6 +33,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "scene/gui/container.h" +#include "scene/main/scene_tree.h" #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" #include "servers/rendering/rendering_server.h" diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index f3db9b7691..7efded00e2 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -38,6 +38,7 @@ #include "core/object/callable_mp.h" #include "core/object/class_db.h" #include "core/os/keyboard.h" +#include "core/os/main_loop.h" #include "core/os/os.h" #include "core/string/alt_codes.h" #include "core/string/translation_server.h" diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 2bc1cdeb3f..a98609943d 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -43,6 +43,7 @@ #include "scene/gui/popup_menu.h" #include "scene/gui/rich_text_effect.h" #include "scene/gui/scroll_bar.h" +#include "scene/main/scene_tree.h" #include "scene/main/timer.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/text_paragraph.h" diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 9cae3825fc..76b4c232b3 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -39,6 +39,7 @@ #include "core/object/class_db.h" #include "core/object/script_language.h" #include "core/os/keyboard.h" +#include "core/os/main_loop.h" #include "core/os/os.h" #include "core/string/alt_codes.h" #include "core/string/string_builder.h" diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 6282ecc8a7..93cfbf2239 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -44,6 +44,7 @@ #include "scene/gui/scroll_bar.h" #include "scene/gui/slider.h" #include "scene/gui/text_edit.h" +#include "scene/main/scene_tree.h" #include "scene/main/timer.h" #include "scene/main/window.h" #include "scene/theme/theme_db.h" diff --git a/scene/gui/video_stream_player.cpp b/scene/gui/video_stream_player.cpp index 39bda2d3c5..19e0479659 100644 --- a/scene/gui/video_stream_player.cpp +++ b/scene/gui/video_stream_player.cpp @@ -33,6 +33,7 @@ #include "core/config/engine.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "scene/main/scene_tree.h" #include "servers/audio/audio_server.h" #include "servers/display/accessibility_server.h" diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 8982d04a4c..cbe8758492 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -41,6 +41,7 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer); #include "scene/main/window.h" #include "scene/resources/atlas_texture.h" #include "scene/resources/font.h" +#include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/multimesh.h" #include "scene/resources/style_box.h" diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index aac64576f9..9dd741a0d9 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -31,13 +31,13 @@ #pragma once #include "scene/main/node.h" -#include "scene/main/scene_tree.h" #include "scene/resources/texture.h" #include "servers/rendering/rendering_server_enums.h" #include "servers/text/text_server.h" class CanvasLayer; class Font; +class Material; class Mesh; class MultiMesh; class StyleBox; @@ -211,7 +211,7 @@ protected: public: enum { - NOTIFICATION_TRANSFORM_CHANGED = SceneTree::NOTIFICATION_TRANSFORM_CHANGED, //unique + NOTIFICATION_TRANSFORM_CHANGED = 2000, // Keep in sync with SceneTree. NOTIFICATION_DRAW = 30, NOTIFICATION_VISIBILITY_CHANGED = 31, NOTIFICATION_ENTER_CANVAS = 32, diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 983397b6ee..6a2df1ae75 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -49,6 +49,7 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, Engine); #include "scene/animation/tween.h" #include "scene/main/instance_placeholder.h" #include "scene/main/multiplayer_api.h" +#include "scene/main/scene_tree.h" #include "scene/main/viewport.h" #include "scene/main/window.h" #include "scene/resources/packed_scene.h" @@ -971,6 +972,10 @@ void Node::set_physics_interpolation_mode(PhysicsInterpolationMode p_mode) { } } +bool Node::is_physics_interpolated_and_enabled() const { + return SceneTree::is_fti_enabled() && is_physics_interpolated(); +} + void Node::reset_physics_interpolation() { if (SceneTree::is_fti_enabled() && is_inside_tree()) { propagate_notification(NOTIFICATION_RESET_PHYSICS_INTERPOLATION); diff --git a/scene/main/node.h b/scene/main/node.h index 0be4f94c62..a06bd7dedb 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -31,19 +31,21 @@ #pragma once #include "core/input/input_event.h" +#include "core/object/gdvirtual.gen.h" #include "core/object/object.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 MultiplayerAPI; +class NodePath; class Resource; class SceneState; +class SceneTree; class Tween; class Viewport; class Window; +struct SceneTreeGroup; SAFE_FLAG_TYPE_PUN_GUARANTEES SAFE_NUMERIC_TYPE_PUN_GUARANTEES(uint32_t) @@ -169,7 +171,7 @@ public: private: struct GroupData { bool persistent = false; - SceneTree::Group *group = nullptr; + SceneTreeGroup *group = nullptr; }; struct ComparatorByIndex { @@ -485,16 +487,17 @@ public: NOTIFICATION_VP_MOUSE_EXIT = 1011, NOTIFICATION_WM_POSITION_CHANGED = 1012, - NOTIFICATION_OS_MEMORY_WARNING = MainLoop::NOTIFICATION_OS_MEMORY_WARNING, - NOTIFICATION_TRANSLATION_CHANGED = MainLoop::NOTIFICATION_TRANSLATION_CHANGED, - NOTIFICATION_WM_ABOUT = MainLoop::NOTIFICATION_WM_ABOUT, - NOTIFICATION_CRASH = MainLoop::NOTIFICATION_CRASH, - NOTIFICATION_OS_IME_UPDATE = MainLoop::NOTIFICATION_OS_IME_UPDATE, - NOTIFICATION_APPLICATION_RESUMED = MainLoop::NOTIFICATION_APPLICATION_RESUMED, - NOTIFICATION_APPLICATION_PAUSED = MainLoop::NOTIFICATION_APPLICATION_PAUSED, - NOTIFICATION_APPLICATION_FOCUS_IN = MainLoop::NOTIFICATION_APPLICATION_FOCUS_IN, - NOTIFICATION_APPLICATION_FOCUS_OUT = MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT, - NOTIFICATION_TEXT_SERVER_CHANGED = MainLoop::NOTIFICATION_TEXT_SERVER_CHANGED, + // Keep these in sync with MainLoop. + NOTIFICATION_OS_MEMORY_WARNING = 2009, + NOTIFICATION_TRANSLATION_CHANGED = 2010, + NOTIFICATION_WM_ABOUT = 2011, + NOTIFICATION_CRASH = 2012, + NOTIFICATION_OS_IME_UPDATE = 2013, + NOTIFICATION_APPLICATION_RESUMED = 2014, + NOTIFICATION_APPLICATION_PAUSED = 2015, + NOTIFICATION_APPLICATION_FOCUS_IN = 2016, + NOTIFICATION_APPLICATION_FOCUS_OUT = 2017, + NOTIFICATION_TEXT_SERVER_CHANGED = 2018, // Editor specific node notifications NOTIFICATION_EDITOR_PRE_SAVE = 9001, @@ -751,7 +754,7 @@ public: void set_physics_interpolation_mode(PhysicsInterpolationMode p_mode); PhysicsInterpolationMode get_physics_interpolation_mode() const { return data.physics_interpolation_mode; } _FORCE_INLINE_ bool is_physics_interpolated() const { return data.physics_interpolated; } - _FORCE_INLINE_ bool is_physics_interpolated_and_enabled() const { return SceneTree::is_fti_enabled() && is_physics_interpolated(); } + bool is_physics_interpolated_and_enabled() const; void reset_physics_interpolation(); bool is_enabled() const; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 44ec0f7770..994a474bfe 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -39,7 +39,6 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer); #include "core/io/resource_loader.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" -#include "core/object/message_queue.h" #include "core/object/worker_thread_pool.h" #include "core/os/os.h" #include "core/profiling/profiling.h" @@ -172,12 +171,12 @@ void SceneTree::node_renamed(Node *p_node) { emit_signal(node_renamed_name, p_node); } -SceneTree::Group *SceneTree::add_to_group(const StringName &p_group, Node *p_node) { +SceneTreeGroup *SceneTree::add_to_group(const StringName &p_group, Node *p_node) { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { - E = group_map.insert(p_group, Group()); + E = group_map.insert(p_group, SceneTreeGroup()); } ERR_FAIL_COND_V_MSG(E->value.nodes.has(p_node), &E->value, "Already in group: " + p_group + "."); @@ -189,7 +188,7 @@ SceneTree::Group *SceneTree::add_to_group(const StringName &p_group, Node *p_nod void SceneTree::remove_from_group(const StringName &p_group, Node *p_node) { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); ERR_FAIL_COND(!E); E->value.nodes.erase(p_node); @@ -338,7 +337,7 @@ void SceneTree::_flush_ugc() { ugc_locked = false; } -void SceneTree::_update_group_order(Group &g) { +void SceneTree::_update_group_order(SceneTreeGroup &g) { if (!g.changed) { return; } @@ -361,11 +360,11 @@ void SceneTree::call_group_flagsp(uint32_t p_call_flags, const StringName &p_gro { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return; } - Group &g = E->value; + SceneTreeGroup &g = E->value; if (g.nodes.is_empty()) { return; } @@ -452,11 +451,11 @@ void SceneTree::notify_group_flags(uint32_t p_call_flags, const StringName &p_gr Vector nodes_copy; { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return; } - Group &g = E->value; + SceneTreeGroup &g = E->value; if (g.nodes.is_empty()) { return; } @@ -515,11 +514,11 @@ void SceneTree::set_group_flags(uint32_t p_call_flags, const StringName &p_group { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return; } - Group &g = E->value; + SceneTreeGroup &g = E->value; if (g.nodes.is_empty()) { return; } @@ -1426,11 +1425,11 @@ void SceneTree::_call_input_pause(const StringName &p_group, CallInputType p_cal { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return; } - Group &g = E->value; + SceneTreeGroup &g = E->value; if (g.nodes.is_empty()) { return; } @@ -1549,7 +1548,7 @@ int64_t SceneTree::get_frame() const { TypedArray SceneTree::_get_nodes_in_group(const StringName &p_group) { _THREAD_SAFE_METHOD_ TypedArray ret; - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return ret; } @@ -1577,7 +1576,7 @@ bool SceneTree::has_group(const StringName &p_identifier) const { int SceneTree::get_node_count_in_group(const StringName &p_group) const { _THREAD_SAFE_METHOD_ - HashMap::ConstIterator E = group_map.find(p_group); + HashMap::ConstIterator E = group_map.find(p_group); if (!E) { return 0; } @@ -1587,7 +1586,7 @@ int SceneTree::get_node_count_in_group(const StringName &p_group) const { Node *SceneTree::get_first_node_in_group(const StringName &p_group) { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return nullptr; // No group. } @@ -1603,7 +1602,7 @@ Node *SceneTree::get_first_node_in_group(const StringName &p_group) { Vector SceneTree::get_nodes_in_group(const StringName &p_group) { _THREAD_SAFE_METHOD_ - HashMap::Iterator E = group_map.find(p_group); + HashMap::Iterator E = group_map.find(p_group); if (!E) { return {}; } diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 2887960142..b3a3757a17 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -81,6 +81,11 @@ public: void release_connections(); }; +struct SceneTreeGroup { + Vector nodes; + bool changed = false; +}; + class SceneTree : public MainLoop { _THREAD_SAFE_CLASS_ @@ -118,11 +123,6 @@ private: bool node_threading_disabled = false; - struct Group { - Vector nodes; - bool changed = false; - }; - #ifndef _3D_DISABLED struct ClientPhysicsInterpolation { SelfList::List _node_3d_list; @@ -145,7 +145,7 @@ private: bool paused = false; bool suspended = false; - HashMap group_map; + HashMap group_map; bool _quit = false; // Static so we can get directly instead of via SceneTree pointer. @@ -196,7 +196,7 @@ private: bool ugc_locked = false; void _flush_ugc(); - _FORCE_INLINE_ void _update_group_order(Group &g); + _FORCE_INLINE_ void _update_group_order(SceneTreeGroup &g); TypedArray _get_nodes_in_group(const StringName &p_group); @@ -234,7 +234,7 @@ private: void process_timers(double p_delta, bool p_physics_frame); void process_tweens(double p_delta, bool p_physics_frame); - Group *add_to_group(const StringName &p_group, Node *p_node); + SceneTreeGroup *add_to_group(const StringName &p_group, Node *p_node); void remove_from_group(const StringName &p_group, Node *p_node); void _process_group(ProcessGroup *p_group, bool p_physics); @@ -289,6 +289,7 @@ protected: public: enum { + // Keep in sync with CanvasItem and Node3D. NOTIFICATION_TRANSFORM_CHANGED = 2000 }; diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 74ebbd8b61..f95b4bf313 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -33,6 +33,8 @@ #include "core/io/resource.h" #include "scene/main/node.h" +class PackedScene; + class SceneState : public RefCounted { GDCLASS(SceneState, RefCounted); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 355e7889f0..b4827345a6 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -30,7 +30,6 @@ #pragma once -#include "core/string/node_path.h" #include "core/string/string_name.h" class SceneStringNames { @@ -126,8 +125,6 @@ public: const StringName blend_times = "blend_times"; const StringName speed = "speed"; - const NodePath path_pp = NodePath(".."); - const StringName default_ = "default"; // default would conflict with C++ keyword. const StringName output = "output"; diff --git a/scene/theme/theme_db.cpp b/scene/theme/theme_db.cpp index 792acfd57a..931f324991 100644 --- a/scene/theme/theme_db.cpp +++ b/scene/theme/theme_db.cpp @@ -35,6 +35,7 @@ #include "core/io/resource_loader.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" +#include "core/object/message_queue.h" #include "scene/gui/control.h" #include "scene/main/node.h" #include "scene/main/window.h"