summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/config/project_settings.cpp2
-rw-r--r--core/extension/gdextension.cpp2
-rw-r--r--core/math/basis.cpp2
-rw-r--r--core/object/script_instance.h2
-rw-r--r--core/object/worker_thread_pool.cpp2
-rw-r--r--core/string/ustring.cpp2
-rw-r--r--core/templates/rid_owner.h2
-rw-r--r--core/variant/variant_construct.h2
-rw-r--r--doc/classes/Engine.xml170
-rw-r--r--doc/classes/Mesh.xml8
-rw-r--r--doc/classes/PhysicalBone3D.xml1
-rw-r--r--doc/classes/PhysicsMaterial.xml1
-rw-r--r--doc/classes/Quaternion.xml99
-rw-r--r--doc/classes/SceneTree.xml122
-rw-r--r--doc/classes/Skeleton3D.xml5
-rw-r--r--doc/classes/String.xml4
-rw-r--r--doc/classes/Vector2.xml6
-rw-r--r--doc/classes/Vector3.xml6
-rw-r--r--doc/classes/Viewport.xml1
-rw-r--r--drivers/d3d12/rendering_device_driver_d3d12.cpp2
-rw-r--r--drivers/gles3/effects/copy_effects.cpp6
-rw-r--r--drivers/gles3/effects/glow.cpp3
-rw-r--r--drivers/gles3/effects/post_effects.cpp3
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp6
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp4
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp12
-rw-r--r--drivers/gles3/storage/light_storage.cpp4
-rw-r--r--drivers/gles3/storage/light_storage.h2
-rw-r--r--drivers/gles3/storage/mesh_storage.cpp5
-rw-r--r--drivers/gles3/storage/particles_storage.cpp6
-rw-r--r--drivers/gles3/storage/render_scene_buffers_gles3.cpp14
-rw-r--r--drivers/gles3/storage/texture_storage.cpp8
-rw-r--r--editor/animation_track_editor.cpp4
-rw-r--r--editor/animation_track_editor.h4
-rw-r--r--editor/code_editor.cpp5
-rw-r--r--editor/connections_dialog.cpp4
-rw-r--r--editor/connections_dialog.h4
-rw-r--r--editor/create_dialog.cpp2
-rw-r--r--editor/create_dialog.h2
-rw-r--r--editor/debugger/editor_debugger_node.cpp4
-rw-r--r--editor/debugger/editor_debugger_node.h4
-rw-r--r--editor/debugger/editor_file_server.cpp2
-rw-r--r--editor/debugger/editor_performance_profiler.cpp2
-rw-r--r--editor/debugger/editor_performance_profiler.h2
-rw-r--r--editor/debugger/script_editor_debugger.cpp2
-rw-r--r--editor/debugger/script_editor_debugger.h2
-rw-r--r--editor/editor_autoload_settings.cpp6
-rw-r--r--editor/editor_autoload_settings.h6
-rw-r--r--editor/editor_data.cpp2
-rw-r--r--editor/editor_data.h2
-rw-r--r--editor/editor_file_system.cpp4
-rw-r--r--editor/editor_file_system.h4
-rw-r--r--editor/editor_inspector.cpp37
-rw-r--r--editor/editor_inspector.h10
-rw-r--r--editor/editor_log.h2
-rw-r--r--editor/editor_properties.cpp7
-rw-r--r--editor/editor_properties.h6
-rw-r--r--editor/editor_properties_array_dict.cpp3
-rw-r--r--editor/editor_properties_array_dict.h2
-rw-r--r--editor/editor_resource_picker.cpp2
-rw-r--r--editor/editor_resource_picker.h2
-rw-r--r--editor/editor_resource_preview.cpp33
-rw-r--r--editor/editor_resource_preview.h13
-rw-r--r--editor/editor_run_native.cpp27
-rw-r--r--editor/editor_run_native.h4
-rw-r--r--editor/editor_settings.cpp16
-rw-r--r--editor/editor_settings.h10
-rw-r--r--editor/editor_vcs_interface.cpp52
-rw-r--r--editor/editor_vcs_interface.h52
-rw-r--r--editor/export/editor_export_platform.cpp4
-rw-r--r--editor/export/editor_export_platform.h5
-rw-r--r--editor/filesystem_dock.cpp10
-rw-r--r--editor/filesystem_dock.h10
-rw-r--r--editor/find_in_files.cpp28
-rw-r--r--editor/find_in_files.h26
-rw-r--r--editor/gui/editor_file_dialog.cpp2
-rw-r--r--editor/gui/editor_file_dialog.h2
-rw-r--r--editor/gui/editor_toaster.cpp6
-rw-r--r--editor/gui/editor_toaster.h6
-rw-r--r--editor/gui/scene_tree_editor.cpp4
-rw-r--r--editor/gui/scene_tree_editor.h2
-rw-r--r--editor/import/3d/collada.cpp10
-rw-r--r--editor/import/3d/collada.h10
-rw-r--r--editor/import/3d/editor_import_collada.cpp23
-rw-r--r--editor/import/3d/resource_importer_obj.cpp20
-rw-r--r--editor/import/3d/resource_importer_scene.cpp16
-rw-r--r--editor/import/3d/resource_importer_scene.h22
-rw-r--r--editor/import/3d/scene_import_settings.cpp4
-rw-r--r--editor/import/3d/scene_import_settings.h4
-rw-r--r--editor/inspector_dock.cpp2
-rw-r--r--editor/inspector_dock.h2
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp4
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.h4
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.h2
-rw-r--r--editor/plugins/animation_library_editor.cpp2
-rw-r--r--editor/plugins/animation_library_editor.h2
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.h2
-rw-r--r--editor/plugins/audio_stream_randomizer_editor_plugin.cpp2
-rw-r--r--editor/plugins/audio_stream_randomizer_editor_plugin.h2
-rw-r--r--editor/plugins/bone_map_editor_plugin.cpp12
-rw-r--r--editor/plugins/bone_map_editor_plugin.h12
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h4
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp16
-rw-r--r--editor/plugins/editor_debugger_plugin.cpp2
-rw-r--r--editor/plugins/editor_debugger_plugin.h2
-rw-r--r--editor/plugins/editor_preview_plugins.cpp48
-rw-r--r--editor/plugins/editor_preview_plugins.h15
-rw-r--r--editor/plugins/font_config_plugin.cpp6
-rw-r--r--editor/plugins/font_config_plugin.h6
-rw-r--r--editor/plugins/gdextension_export_plugin.h2
-rw-r--r--editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp18
-rw-r--r--editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/material_editor_plugin.cpp6
-rw-r--r--editor/plugins/material_editor_plugin.h4
-rw-r--r--editor/plugins/mesh_instance_3d_editor_plugin.cpp6
-rw-r--r--editor/plugins/mesh_library_editor_plugin.h2
-rw-r--r--editor/plugins/navigation_obstacle_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/navigation_obstacle_3d_editor_plugin.h2
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp9
-rw-r--r--editor/plugins/node_3d_editor_plugin.h2
-rw-r--r--editor/plugins/polygon_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/polygon_3d_editor_plugin.h2
-rw-r--r--editor/plugins/script_editor_plugin.cpp26
-rw-r--r--editor/plugins/script_editor_plugin.h20
-rw-r--r--editor/plugins/script_text_editor.cpp8
-rw-r--r--editor/plugins/script_text_editor.h8
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp5
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.h2
-rw-r--r--editor/plugins/text_editor.cpp2
-rw-r--r--editor/plugins/text_editor.h2
-rw-r--r--editor/plugins/text_shader_editor.cpp6
-rw-r--r--editor/plugins/text_shader_editor.h2
-rw-r--r--editor/plugins/tiles/atlas_merging_dialog.cpp4
-rw-r--r--editor/plugins/tiles/atlas_merging_dialog.h6
-rw-r--r--editor/plugins/tiles/tile_atlas_view.h2
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp28
-rw-r--r--editor/plugins/tiles/tile_data_editors.h32
-rw-r--r--editor/plugins/tiles/tile_map_layer_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_map_layer_editor.h4
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp10
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.h12
-rw-r--r--editor/plugins/tiles/tile_set_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_set_editor.h6
-rw-r--r--editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_set_scenes_collection_source_editor.h6
-rw-r--r--editor/plugins/tiles/tiles_editor_plugin.cpp2
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp18
-rw-r--r--editor/plugins/version_control_editor_plugin.h18
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp18
-rw-r--r--editor/plugins/visual_shader_editor_plugin.h16
-rw-r--r--editor/project_converter_3_to_4.cpp18
-rw-r--r--editor/project_converter_3_to_4.h12
-rw-r--r--editor/rename_dialog.cpp4
-rw-r--r--editor/rename_dialog.h4
-rw-r--r--editor/scene_tree_dock.cpp12
-rw-r--r--editor/scene_tree_dock.h12
-rw-r--r--editor/script_create_dialog.cpp4
-rw-r--r--editor/themes/editor_color_map.cpp2
-rw-r--r--editor/themes/editor_color_map.h2
-rw-r--r--editor/themes/editor_theme_manager.cpp21
-rw-r--r--editor/window_wrapper.cpp2
-rw-r--r--editor/window_wrapper.h2
-rw-r--r--misc/extension_api_validation/4.2-stable.expected9
-rw-r--r--modules/csg/csg_shape.h2
-rw-r--r--modules/gdscript/gdscript.cpp13
-rw-r--r--modules/gdscript/gdscript.h5
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp17
-rw-r--r--modules/gdscript/gdscript_cache.cpp79
-rw-r--r--modules/gdscript/gdscript_cache.h6
-rw-r--r--modules/gdscript/gdscript_parser.cpp4
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp4
-rw-r--r--modules/gdscript/language_server/godot_lsp.h2
-rw-r--r--modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp2
-rw-r--r--modules/gltf/extensions/physics/gltf_physics_shape.cpp14
-rw-r--r--modules/gltf/gltf_document.cpp17
-rw-r--r--modules/gltf/structures/gltf_mesh.cpp2
-rw-r--r--modules/gltf/structures/gltf_mesh.h2
-rw-r--r--modules/gltf/structures/gltf_skin.cpp2
-rw-r--r--modules/gltf/structures/gltf_skin.h2
-rw-r--r--modules/gridmap/grid_map.cpp4
-rw-r--r--modules/gridmap/grid_map.h2
-rw-r--r--modules/mono/csharp_script.cpp17
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs1
-rw-r--r--modules/mono/editor/bindings_generator.cpp671
-rw-r--r--modules/mono/editor/bindings_generator.h21
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs12
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs12
-rw-r--r--modules/multiplayer/editor/replication_editor.cpp2
-rw-r--r--modules/multiplayer/scene_multiplayer.cpp2
-rw-r--r--modules/multiplayer/scene_replication_interface.cpp2
-rw-r--r--modules/navigation/2d/godot_navigation_server_2d.cpp (renamed from modules/navigation/godot_navigation_server_2d.cpp)0
-rw-r--r--modules/navigation/2d/godot_navigation_server_2d.h (renamed from modules/navigation/godot_navigation_server_2d.h)10
-rw-r--r--modules/navigation/2d/nav_mesh_generator_2d.cpp (renamed from modules/navigation/nav_mesh_generator_2d.cpp)10
-rw-r--r--modules/navigation/2d/nav_mesh_generator_2d.h (renamed from modules/navigation/nav_mesh_generator_2d.h)0
-rw-r--r--modules/navigation/3d/godot_navigation_server_3d.cpp (renamed from modules/navigation/godot_navigation_server.cpp)274
-rw-r--r--modules/navigation/3d/godot_navigation_server_3d.h (renamed from modules/navigation/godot_navigation_server.h)28
-rw-r--r--modules/navigation/3d/nav_mesh_generator_3d.cpp (renamed from modules/navigation/nav_mesh_generator_3d.cpp)20
-rw-r--r--modules/navigation/3d/nav_mesh_generator_3d.h (renamed from modules/navigation/nav_mesh_generator_3d.h)0
-rw-r--r--modules/navigation/3d/navigation_mesh_generator.cpp (renamed from modules/navigation/navigation_mesh_generator.cpp)0
-rw-r--r--modules/navigation/3d/navigation_mesh_generator.h (renamed from modules/navigation/navigation_mesh_generator.h)0
-rw-r--r--modules/navigation/SCsub3
-rw-r--r--modules/navigation/register_types.cpp12
-rw-r--r--modules/openxr/extensions/openxr_eye_gaze_interaction.cpp7
-rw-r--r--modules/openxr/register_types.cpp4
-rw-r--r--platform/android/export/export_plugin.cpp9
-rw-r--r--platform/android/export/export_plugin.h3
-rw-r--r--platform/macos/dir_access_macos.mm7
-rw-r--r--platform/macos/godot_application_delegate.mm3
-rw-r--r--platform/windows/display_server_windows.cpp60
-rw-r--r--scene/2d/collision_object_2d.h2
-rw-r--r--scene/2d/collision_polygon_2d.cpp4
-rw-r--r--scene/2d/collision_shape_2d.cpp4
-rw-r--r--scene/2d/collision_shape_2d.h2
-rw-r--r--scene/2d/shape_cast_2d.cpp2
-rw-r--r--scene/2d/shape_cast_2d.h2
-rw-r--r--scene/2d/skeleton_2d.h2
-rw-r--r--scene/2d/tile_map.h2
-rw-r--r--scene/2d/tile_map_layer.cpp4
-rw-r--r--scene/2d/tile_map_layer.h2
-rw-r--r--scene/2d/tile_map_layer_group.cpp2
-rw-r--r--scene/2d/touch_screen_button.h2
-rw-r--r--scene/3d/collision_object_3d.cpp2
-rw-r--r--scene/3d/collision_polygon_3d.cpp2
-rw-r--r--scene/3d/collision_polygon_3d.h2
-rw-r--r--scene/3d/collision_shape_3d.cpp6
-rw-r--r--scene/3d/collision_shape_3d.h2
-rw-r--r--scene/3d/gpu_particles_3d.h2
-rw-r--r--scene/3d/importer_mesh_instance_3d.cpp2
-rw-r--r--scene/3d/importer_mesh_instance_3d.h2
-rw-r--r--scene/3d/mesh_instance_3d.cpp4
-rw-r--r--scene/3d/node_3d.h2
-rw-r--r--scene/3d/occluder_instance_3d.cpp2
-rw-r--r--scene/3d/shape_cast_3d.cpp2
-rw-r--r--scene/3d/shape_cast_3d.h2
-rw-r--r--scene/3d/skeleton_3d.compat.inc41
-rw-r--r--scene/3d/skeleton_3d.cpp10
-rw-r--r--scene/3d/skeleton_3d.h10
-rw-r--r--scene/3d/spring_arm_3d.cpp2
-rw-r--r--scene/gui/button.cpp16
-rw-r--r--scene/gui/button.h3
-rw-r--r--scene/gui/check_box.cpp16
-rw-r--r--scene/gui/check_button.cpp16
-rw-r--r--scene/gui/option_button.cpp2
-rw-r--r--scene/gui/text_edit.cpp6
-rw-r--r--scene/main/node.cpp8
-rw-r--r--scene/main/scene_tree.cpp2
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/register_scene_types.cpp68
-rw-r--r--scene/resources/2d/SCsub6
-rw-r--r--scene/resources/2d/capsule_shape_2d.cpp (renamed from scene/resources/capsule_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/capsule_shape_2d.h (renamed from scene/resources/capsule_shape_2d.h)2
-rw-r--r--scene/resources/2d/circle_shape_2d.cpp (renamed from scene/resources/circle_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/circle_shape_2d.h (renamed from scene/resources/circle_shape_2d.h)2
-rw-r--r--scene/resources/2d/concave_polygon_shape_2d.cpp (renamed from scene/resources/concave_polygon_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/concave_polygon_shape_2d.h (renamed from scene/resources/concave_polygon_shape_2d.h)2
-rw-r--r--scene/resources/2d/convex_polygon_shape_2d.cpp (renamed from scene/resources/convex_polygon_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/convex_polygon_shape_2d.h (renamed from scene/resources/convex_polygon_shape_2d.h)2
-rw-r--r--scene/resources/2d/polygon_path_finder.cpp (renamed from scene/resources/polygon_path_finder.cpp)0
-rw-r--r--scene/resources/2d/polygon_path_finder.h (renamed from scene/resources/polygon_path_finder.h)0
-rw-r--r--scene/resources/2d/rectangle_shape_2d.cpp (renamed from scene/resources/rectangle_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/rectangle_shape_2d.h (renamed from scene/resources/rectangle_shape_2d.h)2
-rw-r--r--scene/resources/2d/segment_shape_2d.cpp (renamed from scene/resources/segment_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/segment_shape_2d.h (renamed from scene/resources/segment_shape_2d.h)2
-rw-r--r--scene/resources/2d/separation_ray_shape_2d.cpp (renamed from scene/resources/separation_ray_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/separation_ray_shape_2d.h (renamed from scene/resources/separation_ray_shape_2d.h)2
-rw-r--r--scene/resources/2d/shape_2d.cpp (renamed from scene/resources/shape_2d.cpp)0
-rw-r--r--scene/resources/2d/shape_2d.h (renamed from scene/resources/shape_2d.h)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d.cpp (renamed from scene/resources/skeleton_modification_2d.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d.h (renamed from scene/resources/skeleton_modification_2d.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.cpp (renamed from scene/resources/skeleton_modification_2d_ccdik.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.h (renamed from scene/resources/skeleton_modification_2d_ccdik.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.cpp (renamed from scene/resources/skeleton_modification_2d_fabrik.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.h (renamed from scene/resources/skeleton_modification_2d_fabrik.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.cpp (renamed from scene/resources/skeleton_modification_2d_jiggle.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.h (renamed from scene/resources/skeleton_modification_2d_jiggle.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_lookat.cpp (renamed from scene/resources/skeleton_modification_2d_lookat.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_lookat.h (renamed from scene/resources/skeleton_modification_2d_lookat.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.cpp (renamed from scene/resources/skeleton_modification_2d_physicalbones.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.h (renamed from scene/resources/skeleton_modification_2d_physicalbones.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.cpp (renamed from scene/resources/skeleton_modification_2d_stackholder.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.h (renamed from scene/resources/skeleton_modification_2d_stackholder.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.cpp (renamed from scene/resources/skeleton_modification_2d_twoboneik.cpp)12
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.h (renamed from scene/resources/skeleton_modification_2d_twoboneik.h)2
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_stack_2d.cpp (renamed from scene/resources/skeleton_modification_stack_2d.cpp)0
-rw-r--r--scene/resources/2d/skeleton/skeleton_modification_stack_2d.h (renamed from scene/resources/skeleton_modification_stack_2d.h)2
-rw-r--r--scene/resources/2d/tile_set.compat.inc (renamed from scene/resources/tile_set.compat.inc)0
-rw-r--r--scene/resources/2d/tile_set.cpp (renamed from scene/resources/tile_set.cpp)1
-rw-r--r--scene/resources/2d/tile_set.h (renamed from scene/resources/tile_set.h)4
-rw-r--r--scene/resources/2d/world_boundary_shape_2d.cpp (renamed from scene/resources/world_boundary_shape_2d.cpp)0
-rw-r--r--scene/resources/2d/world_boundary_shape_2d.h (renamed from scene/resources/world_boundary_shape_2d.h)2
-rw-r--r--scene/resources/3d/SCsub6
-rw-r--r--scene/resources/3d/box_shape_3d.cpp (renamed from scene/resources/box_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/box_shape_3d.h (renamed from scene/resources/box_shape_3d.h)2
-rw-r--r--scene/resources/3d/capsule_shape_3d.cpp (renamed from scene/resources/capsule_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/capsule_shape_3d.h (renamed from scene/resources/capsule_shape_3d.h)2
-rw-r--r--scene/resources/3d/concave_polygon_shape_3d.cpp (renamed from scene/resources/concave_polygon_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/concave_polygon_shape_3d.h (renamed from scene/resources/concave_polygon_shape_3d.h)2
-rw-r--r--scene/resources/3d/convex_polygon_shape_3d.cpp (renamed from scene/resources/convex_polygon_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/convex_polygon_shape_3d.h (renamed from scene/resources/convex_polygon_shape_3d.h)2
-rw-r--r--scene/resources/3d/cylinder_shape_3d.cpp (renamed from scene/resources/cylinder_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/cylinder_shape_3d.h (renamed from scene/resources/cylinder_shape_3d.h)2
-rw-r--r--scene/resources/3d/fog_material.cpp (renamed from scene/resources/fog_material.cpp)0
-rw-r--r--scene/resources/3d/fog_material.h (renamed from scene/resources/fog_material.h)0
-rw-r--r--scene/resources/3d/height_map_shape_3d.cpp (renamed from scene/resources/height_map_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/height_map_shape_3d.h (renamed from scene/resources/height_map_shape_3d.h)2
-rw-r--r--scene/resources/3d/importer_mesh.cpp (renamed from scene/resources/importer_mesh.cpp)0
-rw-r--r--scene/resources/3d/importer_mesh.h (renamed from scene/resources/importer_mesh.h)4
-rw-r--r--scene/resources/3d/mesh_library.cpp (renamed from scene/resources/mesh_library.cpp)0
-rw-r--r--scene/resources/3d/mesh_library.h (renamed from scene/resources/mesh_library.h)0
-rw-r--r--scene/resources/3d/primitive_meshes.cpp (renamed from scene/resources/primitive_meshes.cpp)0
-rw-r--r--scene/resources/3d/primitive_meshes.h (renamed from scene/resources/primitive_meshes.h)0
-rw-r--r--scene/resources/3d/separation_ray_shape_3d.cpp (renamed from scene/resources/separation_ray_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/separation_ray_shape_3d.h (renamed from scene/resources/separation_ray_shape_3d.h)2
-rw-r--r--scene/resources/3d/shape_3d.cpp (renamed from scene/resources/shape_3d.cpp)0
-rw-r--r--scene/resources/3d/shape_3d.h (renamed from scene/resources/shape_3d.h)0
-rw-r--r--scene/resources/3d/skin.cpp (renamed from scene/resources/skin.cpp)0
-rw-r--r--scene/resources/3d/skin.h (renamed from scene/resources/skin.h)0
-rw-r--r--scene/resources/3d/sky_material.cpp (renamed from scene/resources/sky_material.cpp)0
-rw-r--r--scene/resources/3d/sky_material.h (renamed from scene/resources/sky_material.h)0
-rw-r--r--scene/resources/3d/sphere_shape_3d.cpp (renamed from scene/resources/sphere_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/sphere_shape_3d.h (renamed from scene/resources/sphere_shape_3d.h)2
-rw-r--r--scene/resources/3d/world_3d.cpp (renamed from scene/resources/world_3d.cpp)0
-rw-r--r--scene/resources/3d/world_3d.h (renamed from scene/resources/world_3d.h)0
-rw-r--r--scene/resources/3d/world_boundary_shape_3d.cpp (renamed from scene/resources/world_boundary_shape_3d.cpp)0
-rw-r--r--scene/resources/3d/world_boundary_shape_3d.h (renamed from scene/resources/world_boundary_shape_3d.h)2
-rw-r--r--scene/resources/SCsub3
-rw-r--r--scene/resources/immediate_mesh.cpp2
-rw-r--r--scene/resources/mesh.cpp4
-rw-r--r--scene/resources/mesh.h1
-rw-r--r--scene/resources/surface_tool.cpp6
-rw-r--r--scu_builders.py2
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp2
-rw-r--r--servers/rendering/rendering_device.cpp10
-rw-r--r--servers/rendering_server.cpp8
-rw-r--r--tests/scene/test_arraymesh.h2
-rw-r--r--tests/scene/test_navigation_region_3d.h2
-rw-r--r--tests/scene/test_primitives.h2
-rw-r--r--tests/scene/test_viewport.h2
-rw-r--r--tests/servers/test_navigation_server_3d.h2
-rw-r--r--thirdparty/README.md2
-rw-r--r--thirdparty/openxr/include/openxr/openxr.h265
-rw-r--r--thirdparty/openxr/include/openxr/openxr_reflection.h1016
-rw-r--r--thirdparty/openxr/include/openxr/openxr_reflection_structs.h10
-rw-r--r--thirdparty/openxr/src/common/platform_utils.hpp2
-rw-r--r--thirdparty/openxr/src/loader/api_layer_interface.cpp20
-rw-r--r--thirdparty/openxr/src/loader/loader_init_data.cpp6
-rw-r--r--thirdparty/openxr/src/loader/loader_init_data.hpp2
-rw-r--r--thirdparty/openxr/src/loader/manifest_file.cpp76
-rw-r--r--thirdparty/openxr/src/loader/manifest_file.hpp14
-rw-r--r--thirdparty/openxr/src/loader/runtime_interface.cpp7
354 files changed, 3505 insertions, 1349 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index d3cbae2f29..d9a5a5094a 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1093,7 +1093,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
} else if (p_path.ends_with(".binary")) {
return _save_settings_binary(p_path, save_props, p_custom, save_features);
} else {
- ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unknown config file format: " + p_path + ".");
+ ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unknown config file format: " + p_path);
}
}
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp
index c1298c8687..5d43dceece 100644
--- a/core/extension/gdextension.cpp
+++ b/core/extension/gdextension.cpp
@@ -431,7 +431,7 @@ void GDExtension::_register_extension_class_internal(GDExtensionClassLibraryPtr
//inheriting from engine class
}
} else {
- ERR_FAIL_MSG("Attempt to register an extension class '" + String(class_name) + "' using non-existing parent class '" + String(parent_class_name) + "'");
+ ERR_FAIL_MSG("Attempt to register an extension class '" + String(class_name) + "' using non-existing parent class '" + String(parent_class_name) + "'.");
}
#ifdef TOOLS_ENABLED
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 1ff6cdd588..5c31095960 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -685,7 +685,7 @@ void Basis::set_euler(const Vector3 &p_euler, EulerOrder p_order) {
*this = zmat * ymat * xmat;
} break;
default: {
- ERR_FAIL_MSG("Invalid order parameter for set_euler(vec3,order)");
+ ERR_FAIL_MSG("Invalid Euler order parameter.");
}
}
}
diff --git a/core/object/script_instance.h b/core/object/script_instance.h
index df978a25ea..45d51534fc 100644
--- a/core/object/script_instance.h
+++ b/core/object/script_instance.h
@@ -76,7 +76,7 @@ public:
}
//this is used by script languages that keep a reference counter of their own
- //you can make make Ref<> not die when it reaches zero, so deleting the reference
+ //you can make Ref<> not die when it reaches zero, so deleting the reference
//depends entirely from the script
virtual void refcount_incremented() {}
diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp
index e2ab473b01..ef3d315e4b 100644
--- a/core/object/worker_thread_pool.cpp
+++ b/core/object/worker_thread_pool.cpp
@@ -551,7 +551,7 @@ void WorkerThreadPool::wait_for_group_task_completion(GroupID p_group) {
Group **groupp = groups.getptr(p_group);
task_mutex.unlock();
if (!groupp) {
- ERR_FAIL_MSG("Invalid Group ID");
+ ERR_FAIL_MSG("Invalid Group ID.");
}
{
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 540891b3b0..a8a96e6e3f 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -1536,7 +1536,7 @@ String String::num(double p_num, int p_decimals) {
fmt[5] = 'f';
fmt[6] = 0;
}
- // if we want to convert a double with as much decimal places as as
+ // if we want to convert a double with as much decimal places as
// DBL_MAX or DBL_MIN then we would theoretically need a buffer of at least
// DBL_MAX_10_EXP + 2 for DBL_MAX and DBL_MAX_10_EXP + 4 for DBL_MIN.
// BUT those values where still giving me exceptions, so I tested from
diff --git a/core/templates/rid_owner.h b/core/templates/rid_owner.h
index e6c62ebf43..f92e0f4162 100644
--- a/core/templates/rid_owner.h
+++ b/core/templates/rid_owner.h
@@ -270,7 +270,7 @@ public:
if (THREAD_SAFE) {
spin_lock.unlock();
}
- ERR_FAIL_MSG("Attempted to free an uninitialized or invalid RID");
+ ERR_FAIL_MSG("Attempted to free an uninitialized or invalid RID.");
} else if (unlikely(validator_chunks[idx_chunk][idx_element] != validator)) {
if (THREAD_SAFE) {
spin_lock.unlock();
diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h
index ef7bf2dfc2..36935907ae 100644
--- a/core/variant/variant_construct.h
+++ b/core/variant/variant_construct.h
@@ -661,7 +661,7 @@ public:
VariantInternal::clear(r_ret);
}
static void ptr_construct(void *base, const void **p_args) {
- ERR_FAIL_MSG("can't ptrcall nil constructor");
+ ERR_FAIL_MSG("Cannot ptrcall nil constructor");
}
static int get_argument_count() {
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index 580756c12d..f9c9b72ed7 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -4,7 +4,7 @@
Provides access to engine properties.
</brief_description>
<description>
- The [Engine] singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others.
+ The [Engine] singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. It also stores information about the current build of Godot, such as the current version.
</description>
<tutorials>
</tutorials>
@@ -12,8 +12,8 @@
<method name="get_architecture_name" qualifiers="const">
<return type="String" />
<description>
- Returns the name of the CPU architecture the Godot binary was built for. Possible return values are [code]x86_64[/code], [code]x86_32[/code], [code]arm64[/code], [code]arm32[/code], [code]rv64[/code], [code]riscv[/code], [code]ppc64[/code], [code]ppc[/code], [code]wasm64[/code] and [code]wasm32[/code].
- To detect whether the current CPU architecture is 64-bit, you can use the fact that all 64-bit architecture names have [code]64[/code] in their name:
+ Returns the name of the CPU architecture the Godot binary was built for. Possible return values include [code]"x86_64"[/code], [code]"x86_32"[/code], [code]"arm64"[/code], [code]"arm32"[/code], [code]"rv64"[/code], [code]"riscv"[/code], [code]"ppc64"[/code], [code]"ppc"[/code], [code]"wasm64"[/code], and [code]"wasm32"[/code].
+ To detect whether the current build is 64-bit, you can use the fact that all 64-bit architecture names contain [code]64[/code] in their name:
[codeblocks]
[gdscript]
if "64" in Engine.get_architecture_name():
@@ -28,74 +28,74 @@
GD.Print("Running a 32-bit build of Godot.");
[/csharp]
[/codeblocks]
- [b]Note:[/b] [method get_architecture_name] does [i]not[/i] return the name of the host CPU architecture. For example, if running an x86_32 Godot binary on a x86_64 system, the returned value will be [code]x86_32[/code].
+ [b]Note:[/b] This method does [i]not[/i] return the name of the system's CPU architecture (like [method OS.get_processor_name]). For example, when running a [code]x86_32[/code] Godot binary on a [code]x86_64[/code] system, the returned value will still be [code]"x86_32"[/code].
</description>
</method>
<method name="get_author_info" qualifiers="const">
<return type="Dictionary" />
<description>
- Returns engine author information in a Dictionary.
- [code]lead_developers[/code] - Array of Strings, lead developer names
- [code]founders[/code] - Array of Strings, founder names
- [code]project_managers[/code] - Array of Strings, project manager names
- [code]developers[/code] - Array of Strings, developer names
+ Returns the engine author information as a [Dictionary], where each entry is an [Array] of strings with the names of notable contributors to the Godot Engine: [code]lead_developers[/code], [code]founders[/code], [code]project_managers[/code], and [code]developers[/code].
</description>
</method>
<method name="get_copyright_info" qualifiers="const">
<return type="Dictionary[]" />
<description>
- Returns an Array of copyright information Dictionaries.
- [code]name[/code] - String, component name
- [code]parts[/code] - Array of Dictionaries {[code]files[/code], [code]copyright[/code], [code]license[/code]} describing subsections of the component
+ Returns an [Array] of dictionaries with copyright information for every component of Godot's source code.
+ Every [Dictionary] contains a [code]name[/code] identifier, and a [code]parts[/code] array of dictionaries. It describes the component in detail with the following entries:
+ - [code]files[/code] - [Array] of file paths from the source code affected by this component;
+ - [code]copyright[/code] - [Array] of owners of this component;
+ - [code]license[/code] - The license applied to this component (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]" or "[url=https://creativecommons.org/licenses/by/4.0/]CC-BY-4.0[/url]").
</description>
</method>
<method name="get_donor_info" qualifiers="const">
<return type="Dictionary" />
<description>
- Returns a Dictionary of Arrays of donor names.
+ Returns a [Dictionary] of categorized donor names. Each entry is an [Array] of strings:
{[code]platinum_sponsors[/code], [code]gold_sponsors[/code], [code]silver_sponsors[/code], [code]bronze_sponsors[/code], [code]mini_sponsors[/code], [code]gold_donors[/code], [code]silver_donors[/code], [code]bronze_donors[/code]}
</description>
</method>
<method name="get_frames_drawn">
<return type="int" />
<description>
- Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with [code]--disable-render-loop[/code] via command line, [method get_frames_drawn] always returns [code]0[/code]. See [method get_process_frames].
+ Returns the total number of frames drawn since the engine started.
+ [b]Note:[/b] On headless platforms, or if rendering is disabled with [code]--disable-render-loop[/code] via command line, this method always returns [code]0[/code]. See also [method get_process_frames].
</description>
</method>
<method name="get_frames_per_second" qualifiers="const">
<return type="float" />
<description>
- Returns the frames per second of the running game.
+ Returns the average frames rendered every second (FPS), also known as the framerate.
</description>
</method>
<method name="get_license_info" qualifiers="const">
<return type="Dictionary" />
<description>
- Returns Dictionary of licenses used by Godot and included third party components.
+ Returns a [Dictionary] of licenses used by Godot and included third party components. Each entry is a license name (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]") and its associated text.
</description>
</method>
<method name="get_license_text" qualifiers="const">
<return type="String" />
<description>
- Returns Godot license text.
+ Returns the full Godot license text.
</description>
</method>
<method name="get_main_loop" qualifiers="const">
<return type="MainLoop" />
<description>
- Returns the main loop object (see [MainLoop] and [SceneTree]).
+ Returns the instance of the [MainLoop]. This is usually the main [SceneTree] and is the same as [method Node.get_tree].
+ [b]Note:[/b] The type instantiated as the main loop can changed with [member ProjectSettings.application/run/main_loop_type].
</description>
</method>
<method name="get_physics_frames" qualifiers="const">
<return type="int" />
<description>
- Returns the total number of frames passed since engine initialization which is advanced on each [b]physics frame[/b]. See also [method get_process_frames].
- [method get_physics_frames] can be used to run expensive logic less often without relying on a [Timer]:
+ Returns the total number of frames passed since the engine started. This number is increased every [b]physics frame[/b]. See also [method get_process_frames].
+ This method can be used to run expensive logic less often without relying on a [Timer]:
[codeblocks]
[gdscript]
func _physics_process(_delta):
if Engine.get_physics_frames() % 2 == 0:
- pass # Run expensive logic only once every 2 physics frames here.
+ pass # Run expensive logic only once every 2 physics frames here.
[/gdscript]
[csharp]
public override void _PhysicsProcess(double delta)
@@ -120,22 +120,22 @@
<method name="get_process_frames" qualifiers="const">
<return type="int" />
<description>
- Returns the total number of frames passed since engine initialization which is advanced on each [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames].
- [method get_process_frames] can be used to run expensive logic less often without relying on a [Timer]:
+ Returns the total number of frames passed since the engine started. This number is increased every [b]process frame[/b], regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames].
+ This method can be used to run expensive logic less often without relying on a [Timer]:
[codeblocks]
[gdscript]
func _process(_delta):
- if Engine.get_process_frames() % 2 == 0:
- pass # Run expensive logic only once every 2 process (render) frames here.
+ if Engine.get_process_frames() % 5 == 0:
+ pass # Run expensive logic only once every 5 process (render) frames here.
[/gdscript]
[csharp]
public override void _Process(double delta)
{
base._Process(delta);
- if (Engine.GetProcessFrames() % 2 == 0)
+ if (Engine.GetProcessFrames() % 5 == 0)
{
- // Run expensive logic only once every 2 physics frames here.
+ // Run expensive logic only once every 5 process (render) frames here.
}
}
[/csharp]
@@ -146,7 +146,7 @@
<return type="ScriptLanguage" />
<param index="0" name="index" type="int" />
<description>
- Returns an instance of a [ScriptLanguage] with the given index.
+ Returns an instance of a [ScriptLanguage] with the given [param index].
</description>
</method>
<method name="get_script_language_count">
@@ -159,43 +159,45 @@
<return type="Object" />
<param index="0" name="name" type="StringName" />
<description>
- Returns a global singleton with given [param name]. Often used for plugins, e.g. GodotPayments.
+ Returns the global singleton with the given [param name], or [code]null[/code] if it does not exist. Often used for plugins. See also [method has_singleton] and [method get_singleton_list].
+ [b]Note:[/b] Global singletons are not the same as autoloaded nodes, which are configurable in the project settings.
</description>
</method>
<method name="get_singleton_list" qualifiers="const">
<return type="PackedStringArray" />
<description>
- Returns a list of available global singletons.
+ Returns a list of names of all available global singletons. See also [method get_singleton].
</description>
</method>
<method name="get_version_info" qualifiers="const">
<return type="Dictionary" />
<description>
- Returns the current engine version information in a Dictionary.
- [code]major[/code] - Holds the major version number as an int
- [code]minor[/code] - Holds the minor version number as an int
- [code]patch[/code] - Holds the patch version number as an int
- [code]hex[/code] - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below)
- [code]status[/code] - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
- [code]build[/code] - Holds the build name (e.g. "custom_build") as a String
- [code]hash[/code] - Holds the full Git commit hash as a String
- [code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String
- The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code:
+ Returns the current engine version information as a [Dictionary] containing the following entries:
+ - [code]major[/code] - Major version number as an int;
+ - [code]minor[/code] - Minor version number as an int;
+ - [code]patch[/code] - Patch version number as an int;
+ - [code]hex[/code] - Full version encoded as a hexadecimal int with one byte (2 hex digits) per number (see example below);
+ - [code]status[/code] - Status (such as "beta", "rc1", "rc2", "stable", etc.) as a String;
+ - [code]build[/code] - Build name (e.g. "custom_build") as a String;
+ - [code]hash[/code] - Full Git commit hash as a String;
+ - [code]string[/code] - [code]major[/code], [code]minor[/code], [code]patch[/code], [code]status[/code], and [code]build[/code] in a single String.
+ The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code].
+ [b]Note:[/b] The [code]hex[/code] value is still an [int] internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for quick version comparisons from code:
[codeblocks]
[gdscript]
- if Engine.get_version_info().hex &gt;= 0x030200:
- # Do things specific to version 3.2 or later
+ if Engine.get_version_info().hex &gt;= 0x040100:
+ pass # Do things specific to version 4.1 or later.
else:
- # Do things specific to versions before 3.2
+ pass # Do things specific to versions before 4.1.
[/gdscript]
[csharp]
- if ((int)Engine.GetVersionInfo()["hex"] &gt;= 0x030200)
+ if ((int)Engine.GetVersionInfo()["hex"] &gt;= 0x040100)
{
- // Do things specific to version 3.2 or later
+ // Do things specific to version 4.1 or later.
}
else
{
- // Do things specific to versions before 3.2
+ // Do things specific to versions before 4.1.
}
[/csharp]
[/codeblocks]
@@ -204,20 +206,35 @@
<method name="get_write_movie_path" qualifiers="const">
<return type="String" />
<description>
- Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. This path can be absolute or relative depending on how the user specified it.
+ Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. The default path can be changed in [member ProjectSettings.editor/movie_writer/movie_file].
</description>
</method>
<method name="has_singleton" qualifiers="const">
<return type="bool" />
<param index="0" name="name" type="StringName" />
<description>
- Returns [code]true[/code] if a singleton with given [param name] exists in global scope.
+ Returns [code]true[/code] if a singleton with the given [param name] exists in the global scope. See also [method get_singleton].
+ [codeblocks]
+ [gdscript]
+ print(Engine.has_singleton("OS")) # Prints true
+ print(Engine.has_singleton("Engine")) # Prints true
+ print(Engine.has_singleton("AudioServer")) # Prints true
+ print(Engine.has_singleton("Unknown")) # Prints false
+ [/gdscript]
+ [csharp]
+ GD.Print(Engine.HasSingleton("OS")); // Prints true
+ GD.Print(Engine.HasSingleton("Engine")); // Prints true
+ GD.Print(Engine.HasSingleton("AudioServer")); // Prints true
+ GD.Print(Engine.HasSingleton("Unknown")); // Prints false
+ [/csharp]
+ [/codeblocks]
+ [b]Note:[/b] Global singletons are not the same as autoloaded nodes, which are configurable in the project settings.
</description>
</method>
<method name="is_editor_hint" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the script is currently running inside the editor, [code]false[/code] otherwise. This is useful for [code]@tool[/code] scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor:
+ Returns [code]true[/code] if the script is currently running inside the editor, otherwise returns [code]false[/code]. This is useful for [code]@tool[/code] scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor:
[codeblocks]
[gdscript]
if Engine.is_editor_hint():
@@ -233,13 +250,25 @@
[/csharp]
[/codeblocks]
See [url=$DOCS_URL/tutorials/plugins/running_code_in_the_editor.html]Running code in the editor[/url] in the documentation for more information.
- [b]Note:[/b] To detect whether the script is run from an editor [i]build[/i] (e.g. when pressing [kbd]F5[/kbd]), use [method OS.has_feature] with the [code]"editor"[/code] argument instead. [code]OS.has_feature("editor")[/code] will evaluate to [code]true[/code] both when the code is running in the editor and when running the project from the editor, but it will evaluate to [code]false[/code] when the code is run from an exported project.
+ [b]Note:[/b] To detect whether the script is running on an editor [i]build[/i] (such as when pressing [kbd]F5[/kbd]), use [method OS.has_feature] with the [code]"editor"[/code] argument instead. [code]OS.has_feature("editor")[/code] evaluate to [code]true[/code] both when the script is running in the editor and when running the project from the editor, but returns [code]false[/code] when run from an exported project.
</description>
</method>
<method name="is_in_physics_frame" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if the game is inside the fixed process and physics phase of the game loop.
+ Returns [code]true[/code] if the engine is inside the fixed physics process step of the main loop.
+ [codeblock]
+ func _enter_tree():
+ # Depending on when the node is added to the tree,
+ # prints either "true" or "false".
+ print(Engine.is_in_physics_frame())
+
+ func _process(delta):
+ print(Engine.is_in_physics_frame()) # Prints false
+
+ func _physics_process(delta):
+ print(Engine.is_in_physics_frame()) # Prints true
+ [/codeblock]
</description>
</method>
<method name="register_script_language">
@@ -248,9 +277,9 @@
<description>
Registers a [ScriptLanguage] instance to be available with [code]ScriptServer[/code].
Returns:
- - [constant OK] on success
- - [constant ERR_UNAVAILABLE] if [code]ScriptServer[/code] has reached it limit and cannot register any new language
- - [constant ERR_ALREADY_EXISTS] if [code]ScriptServer[/code] already contains a language with similar extension/name/type
+ - [constant OK] on success;
+ - [constant ERR_UNAVAILABLE] if [code]ScriptServer[/code] has reached the limit and cannot register any new language;
+ - [constant ERR_ALREADY_EXISTS] if [code]ScriptServer[/code] already contains a language with similar extension/name/type.
</description>
</method>
<method name="register_singleton">
@@ -258,7 +287,7 @@
<param index="0" name="name" type="StringName" />
<param index="1" name="instance" type="Object" />
<description>
- Registers the given object as a singleton, globally available under [param name].
+ Registers the given [Object] [param instance] as a singleton, available globally under [param name]. Useful for plugins.
</description>
</method>
<method name="unregister_script_language">
@@ -267,33 +296,36 @@
<description>
Unregisters the [ScriptLanguage] instance from [code]ScriptServer[/code].
Returns:
- - [constant OK] on success
- - [constant ERR_DOES_NOT_EXIST] if the language is already not registered in [code]ScriptServer[/code]
+ - [constant OK] on success;
+ - [constant ERR_DOES_NOT_EXIST] if the language is not registered in [code]ScriptServer[/code].
</description>
</method>
<method name="unregister_singleton">
<return type="void" />
<param index="0" name="name" type="StringName" />
<description>
- Unregisters the singleton registered under [param name]. The singleton object is not freed. Only works with user-defined singletons created with [method register_singleton].
+ Removes the singleton registered under [param name]. The singleton object is [i]not[/i] freed. Only works with user-defined singletons registered with [method register_singleton].
</description>
</method>
</methods>
<members>
<member name="max_fps" type="int" setter="set_max_fps" getter="get_max_fps" default="0">
- The maximum number of frames per second that can be rendered. A value of [code]0[/code] means "no limit". The actual number of frames per second may still be below this value if the CPU or GPU cannot keep up with the project logic and rendering.
- Limiting the FPS can be useful to reduce system power consumption, which reduces heat and noise emissions (and improves battery life on mobile devices).
- If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Enabled[/code] or [code]Adaptive[/code], it takes precedence and the forced FPS number cannot exceed the monitor's refresh rate.
+ The maximum number of frames per second (FPS) that can be rendered. A value of [code]0[/code] means the framerate is uncapped.
+ Limiting the FPS can be useful to reduce the host machine's power consumption, which reduces heat, noise emissions, and improves battery life.
+ If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Enabled[/code] or [code]Adaptive[/code], the setting takes precedence and the max FPS number cannot exceed the monitor's refresh rate.
If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Enabled[/code], on monitors with variable refresh rate enabled (G-Sync/FreeSync), using a FPS limit a few frames lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url].
- If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Disabled[/code], limiting the FPS to a high value that can be consistently reached on the system can reduce input lag compared to an uncapped framerate. Since this works by ensuring the GPU load is lower than 100%, this latency reduction is only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked scenarios.
See also [member physics_ticks_per_second] and [member ProjectSettings.application/run/max_fps].
+ [b]Note:[/b] The actual number of frames per second may still be below this value if the CPU or GPU cannot keep up with the project's logic and rendering.
+ [b]Note:[/b] If [member ProjectSettings.display/window/vsync/vsync_mode] is [code]Disabled[/code], limiting the FPS to a high value that can be consistently reached on the system can reduce input lag compared to an uncapped framerate. Since this works by ensuring the GPU load is lower than 100%, this latency reduction is only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked scenarios.
</member>
<member name="max_physics_steps_per_frame" type="int" setter="set_max_physics_steps_per_frame" getter="get_max_physics_steps_per_frame" default="8">
- Controls the maximum number of physics steps that can be simulated each rendered frame. The default value is tuned to avoid "spiral of death" situations where expensive physics simulations trigger more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value.
+ The maximum number of physics steps that can be simulated each rendered frame.
+ [b]Note:[/b] The default value is tuned to prevent expensive physics simulations from triggering even more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than [code]1 / max_physics_steps_per_frame[/code] of [member physics_ticks_per_second]. This occurs even if [code]delta[/code] is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value.
</member>
<member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5">
- Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
- [b]Note:[/b] For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics_jitter_fix] to [code]0[/code].
+ How much physics ticks are synchronized with real time. If [code]0[/code] or less, the ticks are fully synchronized. Higher values cause the in-game clock to deviate more from the real clock, but they smooth out framerate jitters.
+ [b]Note:[/b] The default value of [code]0.5[/code] should be good enough for most cases; values above [code]2[/code] could cause the game to react to dropped frames with a noticeable delay and are not recommended.
+ [b]Note:[/b] When using a custom physics interpolation solution, or within a network game, it's recommended to disable the physics jitter fix by setting this property to [code]0[/code].
</member>
<member name="physics_ticks_per_second" type="int" setter="set_physics_ticks_per_second" getter="get_physics_ticks_per_second" default="60">
The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to [code]60[/code] or above, as Godot doesn't interpolate the physics step. As a result, values lower than [code]60[/code] will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also [member max_fps] and [member ProjectSettings.physics/common/physics_ticks_per_second].
@@ -301,13 +333,15 @@
</member>
<member name="print_error_messages" type="bool" setter="set_print_error_messages" getter="is_printing_error_messages" default="true">
If [code]false[/code], stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [member ProjectSettings.application/run/disable_stderr] project setting.
- [b]Warning:[/b] If you set this to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. If this is set to [code]false[/code] in a [code]@tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default).
[b]Note:[/b] This property does not impact the editor's Errors tab when running a project from the editor.
+ [b]Warning:[/b] If set to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a [code]@tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default).
</member>
<member name="time_scale" type="float" setter="set_time_scale" getter="get_time_scale" default="1.0">
- Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. This also affects [Timer] and [SceneTreeTimer] (see [method SceneTree.create_timer] for how to control this).
+ The speed multiplier at which the in-game clock updates, compared to real time. For example, if set to [code]2.0[/code] the game runs twice as fast, and if set to [code]0.5[/code] the game runs half as fast.
+ This value affects [Timer], [SceneTreeTimer], and all other simulations that make use of [code]delta[/code] time (such as [method Node._process] and [method Node._physics_process]).
+ [b]Note:[/b] It's recommended to keep this property above [code]0.0[/code], as the game may behave unexpectedly otherwise.
[b]Note:[/b] This does not affect audio playback speed. Use [member AudioServer.playback_speed_scale] to adjust audio playback speed independently of [member Engine.time_scale].
- [b]Note:[/b] This does not automatically adjust [member physics_ticks_per_second], which means that with time scales above 1.0, physics simulation may become less precise (as each physics tick will stretch over a larger period of engine time). If you're using [member Engine.time_scale] to speed up simulation by a large factor, consider increasing [member physics_ticks_per_second] as well to improve physics reliability.
+ [b]Note:[/b] This does not automatically adjust [member physics_ticks_per_second]. With values above [code]1.0[/code] physics simulation may become less precise, as each physics tick will stretch over a larger period of engine time. If you're modifying [member Engine.time_scale] to speed up simulation by a large factor, consider also increasing [member physics_ticks_per_second] to make the simulation more reliable.
</member>
</members>
</class>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 2b2dc63a33..3f8ed91ad7 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -237,16 +237,16 @@
[PackedVector2Array] for second UV coordinates.
</constant>
<constant name="ARRAY_CUSTOM0" value="6" enum="ArrayType">
- Contains custom color channel 0. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
+ Contains custom color channel 0. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
</constant>
<constant name="ARRAY_CUSTOM1" value="7" enum="ArrayType">
- Contains custom color channel 1. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
+ Contains custom color channel 1. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
</constant>
<constant name="ARRAY_CUSTOM2" value="8" enum="ArrayType">
- Contains custom color channel 2. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
+ Contains custom color channel 2. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
</constant>
<constant name="ARRAY_CUSTOM3" value="9" enum="ArrayType">
- Contains custom color channel 3. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RG_HALF] or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
+ Contains custom color channel 3. [PackedByteArray] if [code](format &gt;&gt; Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) &amp; Mesh.ARRAY_FORMAT_CUSTOM_MASK[/code] is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise.
</constant>
<constant name="ARRAY_BONES" value="10" enum="ArrayType">
[PackedFloat32Array] or [PackedInt32Array] of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] flag.
diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml
index b62cebfdad..c3b202e0a5 100644
--- a/doc/classes/PhysicalBone3D.xml
+++ b/doc/classes/PhysicalBone3D.xml
@@ -61,6 +61,7 @@
</member>
<member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0">
The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness).
+ [b]Note:[/b] Even with [member bounce] set to [code]1.0[/code], some energy will be lost over time due to linear and angular damping. To have a [PhysicalBone3D] that preserves all its energy over time, set [member bounce] to [code]1.0[/code], [member linear_damp_mode] to [constant DAMP_MODE_REPLACE], [member linear_damp] to [code]0.0[/code], [member angular_damp_mode] to [constant DAMP_MODE_REPLACE], and [member angular_damp] to [code]0.0[/code].
</member>
<member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" default="true">
If [code]true[/code], the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force.
diff --git a/doc/classes/PhysicsMaterial.xml b/doc/classes/PhysicsMaterial.xml
index 30c2400775..1601a1040e 100644
--- a/doc/classes/PhysicsMaterial.xml
+++ b/doc/classes/PhysicsMaterial.xml
@@ -14,6 +14,7 @@
</member>
<member name="bounce" type="float" setter="set_bounce" getter="get_bounce" default="0.0">
The body's bounciness. Values range from [code]0[/code] (no bounce) to [code]1[/code] (full bounciness).
+ [b]Note:[/b] Even with [member bounce] set to [code]1.0[/code], some energy will be lost over time due to linear and angular damping. To have a [PhysicsBody3D] that preserves all its energy over time, set [member bounce] to [code]1.0[/code], the body's linear damp mode to [b]Replace[/b] (if applicable), its linear damp to [code]0.0[/code], its angular damp mode to [b]Replace[/b] (if applicable), and its angular damp to [code]0.0[/code].
</member>
<member name="friction" type="float" setter="set_friction" getter="get_friction" default="1.0">
The body's friction. Values range from [code]0[/code] (frictionless) to [code]1[/code] (maximum friction).
diff --git a/doc/classes/Quaternion.xml b/doc/classes/Quaternion.xml
index 411935aa79..8b59448555 100644
--- a/doc/classes/Quaternion.xml
+++ b/doc/classes/Quaternion.xml
@@ -4,19 +4,24 @@
A unit quaternion used for representing 3D rotations.
</brief_description>
<description>
- Quaternions are similar to [Basis], which implements the matrix representation of rotations. Unlike [Basis], which stores rotation, scale, and shearing, quaternions only store rotation.
- Quaternions can be parametrized using both an axis-angle pair or Euler angles. Due to their compactness and the way they are stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors.
- [b]Note:[/b] Quaternions need to be normalized before being used for rotation.
+ The [Quaternion] built-in [Variant] type is a 4D data structure that represents rotation in the form of a [url=https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation]Hamilton convention quaternion[/url]. Compared to the [Basis] type which can store both rotation and scale, quaternions can [i]only[/i] store rotation.
+ A [Quaternion] is composed by 4 floating-point components: [member w], [member x], [member y], and [member z]. These components are very compact in memory, and because of this some operations are more efficient and less likely to cause floating-point errors. Methods such as [method get_angle], [method get_axis], and [method slerp] are faster than their [Basis] counterparts.
+ For a great introduction to quaternions, see [url=https://www.youtube.com/watch?v=d4EgbgTm0Bg]this video by 3Blue1Brown[/url]. You do not need to know the math behind quaternions, as Godot provides several helper methods that handle it for you. These include [method slerp] and [method spherical_cubic_interpolate], as well as the [code]*[/code] operator.
+ [b]Note:[/b] Quaternions must be normalized before being used for rotation (see [method normalized]).
+ [b]Note:[/b] Similarly to [Vector2] and [Vector3], the components of a quaternion use 32-bit precision by default, unlike [float] which is always 64-bit. If double precision is needed, compile the engine with the option [code]precision=double[/code].
</description>
<tutorials>
+ <link title="3Blue1Brown&apos;s video on Quaternions">https://www.youtube.com/watch?v=d4EgbgTm0Bg</link>
+ <link title="Online Quaternion Visualization">https://quaternions.online/</link>
<link title="Using 3D transforms">$DOCS_URL/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link>
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
+ <link title="Advanced Quaternion Visualization">https://iwatake2222.github.io/rotation_master/rotation_master.html</link>
</tutorials>
<constructors>
<constructor name="Quaternion">
<return type="Quaternion" />
<description>
- Constructs a default-initialized quaternion with all components set to [code]0[/code].
+ Constructs a [Quaternion] identical to the [constant IDENTITY].
</description>
</constructor>
<constructor name="Quaternion">
@@ -31,7 +36,7 @@
<param index="0" name="arc_from" type="Vector3" />
<param index="1" name="arc_to" type="Vector3" />
<description>
- Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of [code]1.0[/code].
+ Constructs a [Quaternion] representing the shortest arc between [param arc_from] and [param arc_to]. These can be imagined as two points intersecting a sphere's surface, with a radius of [code]1.0[/code].
</description>
</constructor>
<constructor name="Quaternion">
@@ -39,14 +44,15 @@
<param index="0" name="axis" type="Vector3" />
<param index="1" name="angle" type="float" />
<description>
- Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
+ Constructs a [Quaternion] representing rotation around the [param axis] by the given [param angle], in radians. The axis must be a normalized vector.
</description>
</constructor>
<constructor name="Quaternion">
<return type="Quaternion" />
<param index="0" name="from" type="Basis" />
<description>
- Constructs a quaternion from the given [Basis].
+ Constructs a [Quaternion] from the given rotation [Basis].
+ This constructor is faster than [method Basis.get_rotation_quaternion], but the given basis must be [i]orthonormalized[/i] (see [method Basis.orthonormalized]). Otherwise, the constructor fails and returns [constant IDENTITY].
</description>
</constructor>
<constructor name="Quaternion">
@@ -56,7 +62,8 @@
<param index="2" name="z" type="float" />
<param index="3" name="w" type="float" />
<description>
- Constructs a quaternion defined by the given values.
+ Constructs a [Quaternion] defined by the given values.
+ [b]Note:[/b] Only normalized quaternions represent rotation; if these values are not normalized, the new [Quaternion] will not be a valid rotation.
</description>
</constructor>
</constructors>
@@ -73,7 +80,8 @@
<return type="float" />
<param index="0" name="with" type="Quaternion" />
<description>
- Returns the dot product of two quaternions.
+ Returns the dot product between this quaternion and [param with].
+ This is equivalent to [code](quat.x * with.x) + (quat.y * with.y) + (quat.z * with.z) + (quat.w * with.w)[/code].
</description>
</method>
<method name="exp" qualifiers="const">
@@ -86,7 +94,7 @@
<return type="Quaternion" />
<param index="0" name="euler" type="Vector3" />
<description>
- Constructs a Quaternion from Euler angles in YXZ rotation order.
+ Constructs a new [Quaternion] from the given [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians. This method always uses the YXZ convention ([constant EULER_ORDER_YXZ]).
</description>
</method>
<method name="get_angle" qualifiers="const">
@@ -106,13 +114,14 @@
<return type="Vector3" />
<param index="0" name="order" type="int" default="2" />
<description>
- Returns the quaternion's rotation in the form of Euler angles. The Euler order depends on the [param order] parameter, for example using the YXZ convention: since this method decomposes, first Z, then X, and Y last. See the [enum EulerOrder] enum for possible values. The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
+ Returns this quaternion's rotation as a [Vector3] of [url=https://en.wikipedia.org/wiki/Euler_angles]Euler angles[/url], in radians.
+ The order of each consecutive rotation can be changed with [param order] (see [enum EulerOrder] constants). By default, the YXZ convention is used ([constant EULER_ORDER_YXZ]): Z (roll) is calculated first, then X (pitch), and lastly Y (yaw). When using the opposite method [method from_euler], this order is reversed.
</description>
</method>
<method name="inverse" qualifiers="const">
<return type="Quaternion" />
<description>
- Returns the inverse of the quaternion.
+ Returns the inverse version of this quaternion, inverting the sign of every component except [member w].
</description>
</method>
<method name="is_equal_approx" qualifiers="const">
@@ -131,31 +140,32 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
- Returns whether the quaternion is normalized or not.
+ Returns [code]true[/code] if this quaternion is normalized. See also [method normalized].
</description>
</method>
<method name="length" qualifiers="const" keywords="size">
<return type="float" />
<description>
- Returns the length of the quaternion.
+ Returns this quaternion's length, also called magnitude.
</description>
</method>
<method name="length_squared" qualifiers="const">
<return type="float" />
<description>
- Returns the length of the quaternion, squared.
+ Returns this quaternion's length, squared.
+ [b]Note:[/b] This method is faster than [method length], so prefer it if you only need to compare quaternion lengths.
</description>
</method>
<method name="log" qualifiers="const">
<return type="Quaternion" />
<description>
- Returns the logarithm of this quaternion. The vector part of the result is the rotation axis of this quaternion multiplied by its rotation angle, the real part of the result is zero.
+ Returns the logarithm of this quaternion. Multiplies this quaternion's rotation axis by its rotation angle, and stores the result in the returned quaternion's vector part ([member x], [member y], and [member z]). The returned quaternion's real part ([member w]) is always [code]0.0[/code].
</description>
</method>
<method name="normalized" qualifiers="const">
<return type="Quaternion" />
<description>
- Returns a copy of the quaternion, normalized to unit length.
+ Returns a copy of this quaternion, normalized so that its length is [code]1.0[/code]. See also [method is_normalized].
</description>
</method>
<method name="slerp" qualifiers="const" keywords="interpolate">
@@ -163,8 +173,7 @@
<param index="0" name="to" type="Quaternion" />
<param index="1" name="weight" type="float" />
<description>
- Returns the result of the spherical linear interpolation between this quaternion and [param to] by amount [param weight].
- [b]Note:[/b] Both quaternions must be normalized.
+ Performs a spherical-linear interpolation with the [param to] quaternion, given a [param weight] and returns the result. Both this quaternion and [param to] must be normalized.
</description>
</method>
<method name="slerpni" qualifiers="const">
@@ -172,7 +181,7 @@
<param index="0" name="to" type="Quaternion" />
<param index="1" name="weight" type="float" />
<description>
- Returns the result of the spherical linear interpolation between this quaternion and [param to] by amount [param weight], but without checking if the rotation path is not bigger than 90 degrees.
+ Performs a spherical-linear interpolation with the [param to] quaternion, given a [param weight] and returns the result. Unlike [method slerp], this method does not check if the rotation path is smaller than 90 degrees. Both this quaternion and [param to] must be normalized.
</description>
</method>
<method name="spherical_cubic_interpolate" qualifiers="const">
@@ -202,25 +211,26 @@
</methods>
<members>
<member name="w" type="float" setter="" getter="" default="1.0">
- W component of the quaternion (real part).
- Quaternion components should usually not be manipulated directly.
+ W component of the quaternion. This is the "real" part.
+ [b]Note:[/b] Quaternion components should usually not be manipulated directly.
</member>
<member name="x" type="float" setter="" getter="" default="0.0">
- X component of the quaternion (imaginary [code]i[/code] axis part).
- Quaternion components should usually not be manipulated directly.
+ X component of the quaternion. This is the value along the "imaginary" [code]i[/code] axis.
+ [b]Note:[/b] Quaternion components should usually not be manipulated directly.
</member>
<member name="y" type="float" setter="" getter="" default="0.0">
- Y component of the quaternion (imaginary [code]j[/code] axis part).
- Quaternion components should usually not be manipulated directly.
+ Y component of the quaternion. This is the value along the "imaginary" [code]j[/code] axis.
+ [b]Note:[/b] Quaternion components should usually not be manipulated directly.
</member>
<member name="z" type="float" setter="" getter="" default="0.0">
- Z component of the quaternion (imaginary [code]k[/code] axis part).
- Quaternion components should usually not be manipulated directly.
+ Z component of the quaternion. This is the value along the "imaginary" [code]k[/code] axis.
+ [b]Note:[/b] Quaternion components should usually not be manipulated directly.
</member>
</members>
<constants>
<constant name="IDENTITY" value="Quaternion(0, 0, 0, 1)">
- The identity quaternion, representing no rotation. Equivalent to an identity [Basis] matrix. If a vector is transformed by an identity quaternion, it will not change.
+ The identity quaternion, representing no rotation. This has the same rotation as [constant Basis.IDENTITY].
+ If a [Vector3] is rotated (multiplied) by this quaternion, it does not change.
</constant>
</constants>
<operators>
@@ -228,7 +238,7 @@
<return type="bool" />
<param index="0" name="right" type="Quaternion" />
<description>
- Returns [code]true[/code] if the quaternions are not equal.
+ Returns [code]true[/code] if the components of both quaternions are not exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
@@ -236,63 +246,69 @@
<return type="Quaternion" />
<param index="0" name="right" type="Quaternion" />
<description>
- Composes these two quaternions by multiplying them together. This has the effect of rotating the second quaternion (the child) by the first quaternion (the parent).
+ Composes (multiplies) two quaternions. This rotates the [param right] quaternion (the child) by this quaternion (the parent).
</description>
</operator>
<operator name="operator *">
<return type="Vector3" />
<param index="0" name="right" type="Vector3" />
<description>
- Rotates (multiplies) the [Vector3] by the given [Quaternion].
+ Rotates (multiplies) the [param right] vector by this quaternion, returning a [Vector3].
</description>
</operator>
<operator name="operator *">
<return type="Quaternion" />
<param index="0" name="right" type="float" />
<description>
- Multiplies each component of the [Quaternion] by the given value. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Multiplies each component of the [Quaternion] by the right [float] value.
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator *">
<return type="Quaternion" />
<param index="0" name="right" type="int" />
<description>
- Multiplies each component of the [Quaternion] by the given value. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Multiplies each component of the [Quaternion] by the right [int] value.
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator +">
<return type="Quaternion" />
<param index="0" name="right" type="Quaternion" />
<description>
- Adds each component of the left [Quaternion] to the right [Quaternion]. This operation is not meaningful on its own, but it can be used as a part of a larger expression, such as approximating an intermediate rotation between two nearby rotations.
+ Adds each component of the left [Quaternion] to the right [Quaternion].
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression, such as approximating an intermediate rotation between two nearby rotations.
</description>
</operator>
<operator name="operator -">
<return type="Quaternion" />
<param index="0" name="right" type="Quaternion" />
<description>
- Subtracts each component of the left [Quaternion] by the right [Quaternion]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Subtracts each component of the left [Quaternion] by the right [Quaternion].
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator /">
<return type="Quaternion" />
<param index="0" name="right" type="float" />
<description>
- Divides each component of the [Quaternion] by the given value. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Divides each component of the [Quaternion] by the right [float] value.
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator /">
<return type="Quaternion" />
<param index="0" name="right" type="int" />
<description>
- Divides each component of the [Quaternion] by the given value. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
+ Divides each component of the [Quaternion] by the right [int] value.
+ This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="Quaternion" />
<description>
- Returns [code]true[/code] if the quaternions are exactly equal.
+ Returns [code]true[/code] if the components of both quaternions are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>
@@ -300,7 +316,8 @@
<return type="float" />
<param index="0" name="index" type="int" />
<description>
- Access quaternion components using their index. [code]q[0][/code] is equivalent to [code]q.x[/code], [code]q[1][/code] is equivalent to [code]q.y[/code], [code]q[2][/code] is equivalent to [code]q.z[/code], and [code]q[3][/code] is equivalent to [code]q.w[/code].
+ Accesses each component of this quaternion by their index.
+ Index [code]0[/code] is the same as [member x], index [code]1[/code] is the same as [member y], index [code]2[/code] is the same as [member z], and index [code]3[/code] is the same as [member w].
</description>
</operator>
<operator name="operator unary+">
@@ -312,7 +329,7 @@
<operator name="operator unary-">
<return type="Quaternion" />
<description>
- Returns the negative value of the [Quaternion]. This is the same as writing [code]Quaternion(-q.x, -q.y, -q.z, -q.w)[/code]. This operation results in a quaternion that represents the same rotation.
+ Returns the negative value of the [Quaternion]. This is the same as multiplying all components by [code]-1[/code]. This operation results in a quaternion that represents the same rotation.
</description>
</operator>
</operators>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index 1a846140e5..aad2d853c2 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -4,9 +4,9 @@
Manages the game loop via a hierarchy of nodes.
</brief_description>
<description>
- As one of the most important classes, the [SceneTree] manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
- You can also use the [SceneTree] to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once.
- [SceneTree] is the default [MainLoop] implementation used by scenes, and is thus in charge of the game loop.
+ As one of the most important classes, the [SceneTree] manages the hierarchy of nodes in a scene, as well as scenes themselves. Nodes can be added, fetched and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded.
+ You can also use the [SceneTree] to organize your nodes into [b]groups[/b]: every node can be added to as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the nodes belonging to any given group.
+ [SceneTree] is the default [MainLoop] implementation used by the engine, and is thus in charge of the game loop.
</description>
<tutorials>
<link title="SceneTree">$DOCS_URL/tutorials/scripting/scene_tree.html</link>
@@ -18,8 +18,9 @@
<param index="0" name="group" type="StringName" />
<param index="1" name="method" type="StringName" />
<description>
- Calls [param method] on each member of the given group. You can pass arguments to [param method] by specifying them at the end of the method call. If a node doesn't have the given method or the argument list does not match (either in count or in types), it will be skipped.
- [b]Note:[/b] [method call_group] will call methods immediately on all members at once, which can cause stuttering if an expensive method is called on lots of members.
+ Calls [param method] on each node inside this tree added to the given [param group]. You can pass arguments to [param method] by specifying them at the end of this method call. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored. See also [method set_group] and [method notify_group].
+ [b]Note:[/b] This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
+ [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="call_group_flags" qualifiers="vararg">
@@ -28,12 +29,14 @@
<param index="1" name="group" type="StringName" />
<param index="2" name="method" type="StringName" />
<description>
- Calls [param method] on each member of the given group, respecting the given [enum GroupCallFlags]. You can pass arguments to [param method] by specifying them at the end of the method call. If a node doesn't have the given method or the argument list does not match (either in count or in types), it will be skipped.
+ Calls the given [param method] on each node inside this tree added to the given [param group]. Use [param flags] to customize this method's behavior (see [enum GroupCallFlags]). Additional arguments for [param method] can be passed at the end of this method. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored.
[codeblock]
- # Call the method in a deferred manner and in reverse order.
- get_tree().call_group_flags(SceneTree.GROUP_CALL_DEFERRED | SceneTree.GROUP_CALL_REVERSE)
+ # Calls "hide" to all nodes of the "enemies" group, at the end of the frame and in reverse tree order.
+ get_tree().call_group_flags(
+ SceneTree.GROUP_CALL_DEFERRED | SceneTree.GROUP_CALL_REVERSE,
+ "enemies", "hide")
[/codeblock]
- [b]Note:[/b] Group call flags are used to control the method calling behavior. By default, methods will be called immediately in a way similar to [method call_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [param flags] argument, methods will be called at the end of the frame in a way similar to [method Object.set_deferred].
+ [b]Note:[/b] In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the [code]MethodName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="change_scene_to_file">
@@ -64,11 +67,11 @@
<param index="2" name="process_in_physics" type="bool" default="false" />
<param index="3" name="ignore_time_scale" type="bool" default="false" />
<description>
- Returns a [SceneTreeTimer] which will emit [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree].
- If [param process_always] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer.
- If [param process_in_physics] is set to [code]true[/code], will update the [SceneTreeTimer] during the physics frame instead of the process frame (fixed framerate processing).
- If [param ignore_time_scale] is set to [code]true[/code], will ignore [member Engine.time_scale] and update the [SceneTreeTimer] with the actual frame delta.
- Commonly used to create a one-shot delay timer as in the following example:
+ Returns a new [SceneTreeTimer]. After [param time_sec] in seconds have passed, the timer will emit [signal SceneTreeTimer.timeout] and will be automatically freed.
+ If [param process_always] is [code]false[/code], the timer will be paused when setting [member SceneTree.paused] to [code]true[/code].
+ If [param process_in_physics] is [code]true[/code], the timer will update at the end of the physics frame, instead of the process frame.
+ If [param ignore_time_scale] is [code]true[/code], the timer will ignore [member Engine.time_scale] and update with the real, elapsed time.
+ This method is commonly used to create a one-shot delay timer, as in the following example:
[codeblocks]
[gdscript]
func some_function():
@@ -85,28 +88,27 @@
}
[/csharp]
[/codeblocks]
- The timer will be automatically freed after its time elapses.
- [b]Note:[/b] The timer is processed after all of the nodes in the current frame, i.e. node's [method Node._process] method would be called before the timer (or [method Node._physics_process] if [param process_in_physics] is set to [code]true[/code]).
+ [b]Note:[/b] The timer is always updated [i]after[/i] all of the nodes in the tree. A node's [method Node._process] method would be called before the timer updates (or [method Node._physics_process] if [param process_in_physics] is set to [code]true[/code]).
</description>
</method>
<method name="create_tween">
<return type="Tween" />
<description>
- Creates and returns a new [Tween]. The Tween will start automatically on the next process frame or physics frame (depending on [enum Tween.TweenProcessMode]).
- [b]Note:[/b] When creating a [Tween] using this method, the [Tween] will not be tied to the [Node] that called it. It will continue to animate even if the [Node] is freed, but it will automatically finish if there's nothing left to animate. If you want the [Tween] to be automatically killed when the [Node] is freed, use [method Node.create_tween] or [method Tween.bind_node].
+ Creates and returns a new [Tween] processed in this tree. The Tween will start automatically on the next process frame or physics frame (depending on its [enum Tween.TweenProcessMode]).
+ [b]Note:[/b] A [Tween] created using this method is not bound to any [Node]. It may keep working until there is nothing left to animate. If you want the [Tween] to be automatically killed when the [Node] is freed, use [method Node.create_tween] or [method Tween.bind_node].
</description>
</method>
<method name="get_first_node_in_group">
<return type="Node" />
<param index="0" name="group" type="StringName" />
<description>
- Returns the first node in the specified group, or [code]null[/code] if the group is empty or does not exist.
+ Returns the first [Node] found inside the tree, that has been added to the given [param group], in scene hierarchy order. Returns [code]null[/code] if no match is found. See also [method get_nodes_in_group].
</description>
</method>
<method name="get_frame" qualifiers="const">
<return type="int" />
<description>
- Returns the current frame number, i.e. the total frame count since the application started.
+ Returns how many frames have been processed, since the application started. This is [i]not[/i] a measurement of elapsed time.
</description>
</method>
<method name="get_multiplayer" qualifiers="const">
@@ -119,7 +121,7 @@
<method name="get_node_count" qualifiers="const">
<return type="int" />
<description>
- Returns the number of nodes in this [SceneTree].
+ Returns the number of nodes inside this tree.
</description>
</method>
<method name="get_node_count_in_group" qualifiers="const">
@@ -133,21 +135,20 @@
<return type="Node[]" />
<param index="0" name="group" type="StringName" />
<description>
- Returns a list of all nodes assigned to the given group.
+ Returns an [Array] containing all nodes inside this tree, that have been added to the given [param group], in scene hierarchy order.
</description>
</method>
<method name="get_processed_tweens">
<return type="Tween[]" />
<description>
- Returns an array of currently existing [Tween]s in the [SceneTree] (both running and paused).
+ Returns an [Array] of currently existing [Tween]s in the tree, including paused tweens.
</description>
</method>
<method name="has_group" qualifiers="const">
<return type="bool" />
<param index="0" name="name" type="StringName" />
<description>
- Returns [code]true[/code] if the given group exists.
- A group exists if any [Node] in the tree belongs to it (see [method Node.add_to_group]). Groups without nodes are removed automatically.
+ Returns [code]true[/code] if a node added to the given group [param name] exists in the tree.
</description>
</method>
<method name="notify_group">
@@ -155,8 +156,8 @@
<param index="0" name="group" type="StringName" />
<param index="1" name="notification" type="int" />
<description>
- Sends the given notification to all members of the [param group].
- [b]Note:[/b] [method notify_group] will immediately notify all members at once, which can cause stuttering if an expensive method is called as a result of sending the notification to lots of members.
+ Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. See also [method call_group] and [method set_group].
+ [b]Note:[/b] This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
</description>
</method>
<method name="notify_group_flags">
@@ -165,32 +166,30 @@
<param index="1" name="group" type="StringName" />
<param index="2" name="notification" type="int" />
<description>
- Sends the given notification to all members of the [param group], respecting the given [enum GroupCallFlags].
- [b]Note:[/b] Group call flags are used to control the notification sending behavior. By default, notifications will be sent immediately in a way similar to [method notify_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [param call_flags] argument, notifications will be sent at the end of the current frame in a way similar to using [code]Object.call_deferred("notification", ...)[/code].
+ Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]).
</description>
</method>
<method name="queue_delete">
<return type="void" />
<param index="0" name="obj" type="Object" />
<description>
- Queues the given object for deletion, delaying the call to [method Object.free] to the end of the current frame.
+ Queues the given [param obj] to be deleted, calling its [method Object.free] at the end of the current frame. This method is similar to [method Node.queue_free].
</description>
</method>
<method name="quit">
<return type="void" />
<param index="0" name="exit_code" type="int" default="0" />
<description>
- Quits the application at the end of the current iteration. Argument [param exit_code] can optionally be given (defaulting to 0) to customize the exit status code.
- By convention, an exit code of [code]0[/code] indicates success whereas a non-zero exit code indicates an error.
- For portability reasons, the exit code should be set between 0 and 125 (inclusive).
- [b]Note:[/b] On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, the user is expected to close apps via the Home button.
+ Quits the application at the end of the current iteration, with the given [param exit_code].
+ By convention, an exit code of [code]0[/code] indicates success, whereas any other exit code indicates an error. For portability reasons, it should be between [code]0[/code] and [code]125[/code] (inclusive).
+ [b]Note:[/b] On iOS this method doesn't work. Instead, as recommended by the [url=https://developer.apple.com/library/archive/qa/qa1561/_index.html]iOS Human Interface Guidelines[/url], the user is expected to close apps via the Home button.
</description>
</method>
<method name="reload_current_scene">
<return type="int" enum="Error" />
<description>
- Reloads the currently active scene.
- Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] was defined yet, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
+ Reloads the currently active scene, replacing [member current_scene] with a new instance of its original [PackedScene].
+ Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] is defined, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
</description>
</method>
<method name="set_group">
@@ -199,8 +198,9 @@
<param index="1" name="property" type="String" />
<param index="2" name="value" type="Variant" />
<description>
- Sets the given [param property] to [param value] on all members of the given group.
- [b]Note:[/b] [method set_group] will set the property immediately on all members at once, which can cause stuttering if a property with an expensive setter is set on lots of members.
+ Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. See also [method call_group] and [method notify_group].
+ [b]Note:[/b] This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
+ [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="set_group_flags">
@@ -210,8 +210,8 @@
<param index="2" name="property" type="String" />
<param index="3" name="value" type="Variant" />
<description>
- Sets the given [param property] to [param value] on all members of the given group, respecting the given [enum GroupCallFlags].
- [b]Note:[/b] Group call flags are used to control the property setting behavior. By default, properties will be set immediately in a way similar to [method set_group]. However, if the [constant GROUP_CALL_DEFERRED] flag is present in the [param call_flags] argument, properties will be set at the end of the frame in a way similar to [method Object.call_deferred].
+ Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]).
+ [b]Note:[/b] In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the [code]PropertyName[/code] class to avoid allocating a new [StringName] on each call.
</description>
</method>
<method name="set_multiplayer">
@@ -236,8 +236,8 @@
For mobile platforms, see [member quit_on_go_back].
</member>
<member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene">
- Returns the root node of the currently running scene, regardless of its structure.
- [b]Warning:[/b] Setting this directly might not work as expected, and will [i]not[/i] add or remove any nodes from the tree, consider using [method change_scene_to_file] or [method change_scene_to_packed] instead.
+ The root node of the currently loaded main scene, usually as a direct child of [member root]. See also [method change_scene_to_file], [method change_scene_to_packed], and [method reload_current_scene].
+ [b]Warning:[/b] Setting this property directly may not work as expected, as it does [i]not[/i] add or remove any nodes from this tree.
</member>
<member name="debug_collisions_hint" type="bool" setter="set_debug_collisions_hint" getter="is_debugging_collisions_hint" default="false">
If [code]true[/code], collision shapes will be visible when running the game from the editor for debugging purposes.
@@ -252,84 +252,86 @@
[b]Note:[/b] This property is not designed to be changed at run-time. Changing the value of [member debug_paths_hint] while the project is running will not have the desired effect.
</member>
<member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root">
- The root of the edited scene.
+ The root of the scene currently being edited in the editor. This is usually a direct child of [member root].
+ [b]Note:[/b] This property does nothing in release builds.
</member>
<member name="multiplayer_poll" type="bool" setter="set_multiplayer_poll_enabled" getter="is_multiplayer_poll_enabled" default="true">
If [code]true[/code] (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame].
If [code]false[/code], you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
</member>
<member name="paused" type="bool" setter="set_pause" getter="is_paused" default="false">
- If [code]true[/code], the [SceneTree] is paused. Doing so will have the following behavior:
- - 2D and 3D physics will be stopped. This includes signals and collision detection.
- - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes.
+ If [code]true[/code], the scene tree is considered paused. This causes the following behavior:
+ - 2D and 3D physics will be stopped, as well as collision detection and related signals.
+ - Depending on each node's [member Node.process_mode], their [method Node._process], [method Node._physics_process] and [method Node._input] callback methods may not called anymore.
</member>
<member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true">
If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST].
</member>
<member name="root" type="Window" setter="" getter="get_root">
- The [SceneTree]'s root [Window].
+ The tree's root [Window]. This is top-most [Node] of the scene tree, and is always present. An absolute [NodePath] always starts from this node. Children of the root node may include the loaded [member current_scene], as well as any [url=$DOCS_URL/tutorials/scripting/singletons_autoload.html]AutoLoad[/url] configured in the Project Settings.
+ [b]Warning:[/b] Do not delete this node. This will result in unstable behavior, followed by a crash.
</member>
</members>
<signals>
<signal name="node_added">
<param index="0" name="node" type="Node" />
<description>
- Emitted whenever a node is added to the [SceneTree].
+ Emitted when the [param node] enters this tree.
</description>
</signal>
<signal name="node_configuration_warning_changed">
<param index="0" name="node" type="Node" />
<description>
- Emitted when a node's configuration changed. Only emitted in [code]tool[/code] mode.
+ Emitted when the [param node]'s [method Node.update_configuration_warnings] is called. Only emitted in the editor.
</description>
</signal>
<signal name="node_removed">
<param index="0" name="node" type="Node" />
<description>
- Emitted whenever a node is removed from the [SceneTree].
+ Emitted when the [param node] exits this tree.
</description>
</signal>
<signal name="node_renamed">
<param index="0" name="node" type="Node" />
<description>
- Emitted whenever a node is renamed.
+ Emitted when the [param node]'s [member Node.name] is changed.
</description>
</signal>
<signal name="physics_frame">
<description>
- Emitted immediately before [method Node._physics_process] is called on every node in the [SceneTree].
+ Emitted immediately before [method Node._physics_process] is called on every node in this tree.
</description>
</signal>
<signal name="process_frame">
<description>
- Emitted immediately before [method Node._process] is called on every node in the [SceneTree].
+ Emitted immediately before [method Node._process] is called on every node in this tree.
</description>
</signal>
<signal name="tree_changed">
<description>
- Emitted whenever the [SceneTree] hierarchy changed (children being moved or renamed, etc.).
+ Emitted any time the tree's hierarchy changes (nodes being moved, renamed, etc).
</description>
</signal>
<signal name="tree_process_mode_changed">
<description>
- This signal is only emitted in the editor, it allows the editor to update the visibility of disabled nodes. Emitted whenever any node's [member Node.process_mode] is changed.
+ Emitted when the [member Node.process_mode] of any node inside the tree is changed. Only emitted in the editor, to update the visibility of disabled nodes.
</description>
</signal>
</signals>
<constants>
<constant name="GROUP_CALL_DEFAULT" value="0" enum="GroupCallFlags">
- Call a group with no flags (default).
+ Call nodes within a group with no special behavior (default).
</constant>
<constant name="GROUP_CALL_REVERSE" value="1" enum="GroupCallFlags">
- Call a group in reverse scene order.
+ Call nodes within a group in reverse tree hierarchy order (all nested children are called before their respective parent nodes).
</constant>
<constant name="GROUP_CALL_DEFERRED" value="2" enum="GroupCallFlags">
- Call a group at the end of the current frame (process or physics).
+ Call nodes within a group at the end of the current frame (can be either process or physics frame), similar to [method Object.call_deferred].
</constant>
<constant name="GROUP_CALL_UNIQUE" value="4" enum="GroupCallFlags">
- Call a group only once even if the call is executed many times.
- [b]Note:[/b] Arguments are not taken into account when deciding whether the call is unique or not. Therefore when the same method is called with different arguments, only the first call will be performed.
+ Call nodes within a group only once, even if the call is executed many times in the same frame. Must be combined with [constant GROUP_CALL_DEFERRED] to work.
+ [b]Note:[/b] Different arguments are not taken into account. Therefore, when the same call is executed with different arguments, only the first call will be performed.
</constant>
</constants>
</class>
diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml
index 2c55f0dcd1..b6be0e92a3 100644
--- a/doc/classes/Skeleton3D.xml
+++ b/doc/classes/Skeleton3D.xml
@@ -14,10 +14,11 @@
</tutorials>
<methods>
<method name="add_bone">
- <return type="void" />
+ <return type="int" />
<param index="0" name="name" type="String" />
<description>
- Adds a bone, with name [param name]. [method get_bone_count] will become the bone index.
+ Adds a new bone with the given name. Returns the new bone's index, or [code]-1[/code] if this method fails.
+ [b]Note:[/b] Bone names should be unique, non empty, and cannot include the [code]:[/code] and [code]/[/code] characters.
</description>
</method>
<method name="clear_bones">
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index cffe9e219d..17f953f48f 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -651,8 +651,8 @@
[codeblocks]
[gdscript]
var n = -5.2e8
- print(n) # Prints -520000000
- print(String.NumScientific(n)) # Prints -5.2e+08
+ print(n) # Prints -520000000
+ print(String.num_scientific(n)) # Prints -5.2e+08
[/gdscript]
[csharp]
// This method is not implemented in C#.
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 76f97d0968..bdc49b5c31 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -315,7 +315,8 @@
<return type="Vector2" />
<param index="0" name="b" type="Vector2" />
<description>
- Returns the result of projecting the vector onto the given vector [param b].
+ Returns a new vector resulting from projecting this vector onto the given vector [param b]. The resulting new vector is parallel to [param b]. See also [method slide].
+ [b]Note:[/b] If the vector [param b] is a zero vector, the components of the resulting new vector will be [constant @GDScript.NAN].
</description>
</method>
<method name="reflect" qualifiers="const">
@@ -357,7 +358,8 @@
<return type="Vector2" />
<param index="0" name="n" type="Vector2" />
<description>
- Returns the result of sliding the vector along a plane defined by the given normal.
+ Returns a new vector resulting from sliding this vector along a line with normal [param n]. The resulting new vector is perpendicular to [param n], and is equivalent to this vector minus its projection on [param n]. See also [method project].
+ [b]Note:[/b] The vector [param n] must be normalized. See also [method normalized].
</description>
</method>
<method name="snapped" qualifiers="const">
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 5730826043..b9b0346250 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -299,7 +299,8 @@
<return type="Vector3" />
<param index="0" name="b" type="Vector3" />
<description>
- Returns the result of projecting the vector onto the given vector [param b].
+ Returns a new vector resulting from projecting this vector onto the given vector [param b]. The resulting new vector is parallel to [param b]. See also [method slide].
+ [b]Note:[/b] If the vector [param b] is a zero vector, the components of the resulting new vector will be [constant @GDScript.NAN].
</description>
</method>
<method name="reflect" qualifiers="const">
@@ -350,7 +351,8 @@
<return type="Vector3" />
<param index="0" name="n" type="Vector3" />
<description>
- Returns a new vector slid along a plane defined by the given normal.
+ Returns a new vector resulting from sliding this vector along a plane with normal [param n]. The resulting new vector is perpendicular to [param n], and is equivalent to this vector minus its projection on [param n]. See also [method project].
+ [b]Note:[/b] The vector [param n] must be normalized. See also [method normalized].
</description>
</method>
<method name="snapped" qualifiers="const">
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 930e437aa5..7c593fefd9 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -414,6 +414,7 @@
<param index="0" name="node" type="Control" />
<description>
Emitted when a Control node grabs keyboard focus.
+ [b]Note:[/b] A Control node losing focus doesn't cause this signal to be emitted.
</description>
</signal>
<signal name="size_changed">
diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp
index 6efef0fb34..e74ea910a0 100644
--- a/drivers/d3d12/rendering_device_driver_d3d12.cpp
+++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp
@@ -1860,7 +1860,7 @@ void RenderingDeviceDriverD3D12::command_pipeline_barrier(
VectorView<RDD::BufferBarrier> p_buffer_barriers,
VectorView<RDD::TextureBarrier> p_texture_barriers) {
if (p_src_stages.has_flag(PIPELINE_STAGE_ALL_COMMANDS_BIT) && p_dst_stages.has_flag(PIPELINE_STAGE_ALL_COMMANDS_BIT)) {
- // Looks like the intent is a a full barrier.
+ // Looks like the intent is a full barrier.
// In the resource barriers world, we can force a full barrier by discarding some resource, as per
// https://microsoft.github.io/DirectX-Specs/d3d/D3D12EnhancedBarriers.html#synchronous-copy-discard-and-resolve.
const CommandBufferInfo *cmd_buf_info = (const CommandBufferInfo *)p_cmd_buffer.id;
diff --git a/drivers/gles3/effects/copy_effects.cpp b/drivers/gles3/effects/copy_effects.cpp
index 43bc6d5476..6e64652982 100644
--- a/drivers/gles3/effects/copy_effects.cpp
+++ b/drivers/gles3/effects/copy_effects.cpp
@@ -207,8 +207,8 @@ void CopyEffects::bilinear_blur(GLuint p_source_texture, int p_mipmap_count, con
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffers[i % 2]);
source_region = dest_region;
}
- glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteFramebuffers(2, framebuffers);
}
@@ -274,7 +274,7 @@ void CopyEffects::gaussian_blur(GLuint p_source_texture, int p_mipmap_count, con
source_region = dest_region;
normalized_source_region = normalized_dest_region;
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteFramebuffers(1, &framebuffer);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
diff --git a/drivers/gles3/effects/glow.cpp b/drivers/gles3/effects/glow.cpp
index 9fc2eef65b..9728b089aa 100644
--- a/drivers/gles3/effects/glow.cpp
+++ b/drivers/gles3/effects/glow.cpp
@@ -31,6 +31,7 @@
#ifdef GLES3_ENABLED
#include "glow.h"
+#include "../storage/texture_storage.h"
using namespace GLES3;
@@ -166,7 +167,7 @@ void Glow::process_glow(GLuint p_source_color, Size2i p_size, const Glow::GLOWLE
glDepthMask(GL_TRUE);
glUseProgram(0);
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
#endif // GLES3_ENABLED
diff --git a/drivers/gles3/effects/post_effects.cpp b/drivers/gles3/effects/post_effects.cpp
index 75af068ab5..8ad872f319 100644
--- a/drivers/gles3/effects/post_effects.cpp
+++ b/drivers/gles3/effects/post_effects.cpp
@@ -31,6 +31,7 @@
#ifdef GLES3_ENABLED
#include "post_effects.h"
+#include "../storage/texture_storage.h"
using namespace GLES3;
@@ -146,7 +147,7 @@ void PostEffects::post_copy(GLuint p_dest_framebuffer, Size2i p_dest_size, GLuin
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glUseProgram(0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
#endif // GLES3_ENABLED
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 80daa9a907..11975c1a75 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1689,7 +1689,7 @@ void RasterizerCanvasGLES3::light_update_shadow(RID p_rid, int p_shadow_index, c
}
glBindVertexArray(0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
@@ -1797,7 +1797,7 @@ void RasterizerCanvasGLES3::light_update_directional_shadow(RID p_rid, int p_sha
cl->shadow.directional_xform = to_shadow * to_light_xform;
glBindVertexArray(0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
@@ -1911,7 +1911,7 @@ void RasterizerCanvasGLES3::render_sdf(RID p_render_target, LightOccluderInstanc
texture_storage->render_target_sdf_process(p_render_target); //done rendering, process it
glBindVertexArray(0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
RID RasterizerCanvasGLES3::occluder_polygon_create() {
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index da2320c23d..73ee277074 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -418,7 +418,7 @@ void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, Display
GL_COLOR_BUFFER_BIT, GL_NEAREST);
if (read_fbo != 0) {
- glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteFramebuffers(1, &read_fbo);
}
}
@@ -442,7 +442,7 @@ void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_c
Size2i win_size = DisplayServer::get_singleton()->window_get_size();
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glViewport(0, 0, win_size.width, win_size.height);
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE);
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 59894ca4e3..ba7d102230 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1107,7 +1107,7 @@ void RasterizerSceneGLES3::_filter_sky_radiance(Sky *p_sky, int p_base_layer) {
}
glBindVertexArray(0);
glViewport(0, 0, p_sky->screen_size.x, p_sky->screen_size.y);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
Ref<Image> RasterizerSceneGLES3::sky_bake_panorama(RID p_sky, float p_energy, bool p_bake_irradiance, const Size2i &p_size) {
@@ -1148,7 +1148,7 @@ Ref<Image> RasterizerSceneGLES3::sky_bake_panorama(RID p_sky, float p_energy, bo
copy_effects->copy_cube_to_panorama(p_bake_irradiance ? float(sky->mipmap_count) : 0.0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteFramebuffers(1, &rad_fbo);
// Create a dummy texture so we can use texture_2d_get.
RID tex_rid = GLES3::TextureStorage::get_singleton()->texture_allocate();
@@ -2303,7 +2303,7 @@ void RasterizerSceneGLES3::_render_shadow_pass(RID p_light, RID p_shadow_atlas,
scene_state.enable_gl_depth_draw(true);
glDisable(GL_CULL_FACE);
scene_state.cull_mode = GLES3::SceneShaderData::CULL_DISABLED;
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray<RenderGeometryInstance *> &p_instances, const PagedArray<RID> &p_lights, const PagedArray<RID> &p_reflection_probes, const PagedArray<RID> &p_voxel_gi_instances, const PagedArray<RID> &p_decals, const PagedArray<RID> &p_lightmaps, const PagedArray<RID> &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_compositor, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, const RenderSDFGIUpdateData *p_sdfgi_update_data, RenderingMethod::RenderInfo *r_render_info) {
@@ -3573,7 +3573,7 @@ void RasterizerSceneGLES3::render_particle_collider_heightfield(RID p_collider,
_render_list_template<PASS_MODE_SHADOW>(&render_list_params, &render_data, 0, render_list[RENDER_LIST_SECONDARY].elements.size());
glColorMask(1, 1, 1, 1);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
void RasterizerSceneGLES3::_render_uv2(const PagedArray<RenderGeometryInstance *> &p_instances, GLuint p_framebuffer, const Rect2i &p_region) {
@@ -3655,7 +3655,7 @@ void RasterizerSceneGLES3::_render_uv2(const PagedArray<RenderGeometryInstance *
GLuint db = GL_COLOR_ATTACHMENT0;
glDrawBuffers(1, &db);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
}
@@ -3759,7 +3759,7 @@ void RasterizerSceneGLES3::_render_buffers_debug_draw(Ref<RenderSceneBuffersGLES
copy_effects->copy_to_rect(Rect2(Vector2(), Vector2(0.5, 0.5)));
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
}
if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS) {
diff --git a/drivers/gles3/storage/light_storage.cpp b/drivers/gles3/storage/light_storage.cpp
index 5421f57646..2259c61e5b 100644
--- a/drivers/gles3/storage/light_storage.cpp
+++ b/drivers/gles3/storage/light_storage.cpp
@@ -1044,7 +1044,7 @@ bool LightStorage::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_i
glBindTexture(GL_TEXTURE_2D, 0);
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
r_quadrant = qidx;
r_shadow = shadow_atlas->quadrants[qidx].textures.size();
@@ -1135,7 +1135,7 @@ void LightStorage::update_directional_shadow_atlas() {
glClear(GL_DEPTH_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
void LightStorage::directional_shadow_atlas_set_size(int p_size, bool p_16_bits) {
diff --git a/drivers/gles3/storage/light_storage.h b/drivers/gles3/storage/light_storage.h
index 96e6200219..a6b236f3ec 100644
--- a/drivers/gles3/storage/light_storage.h
+++ b/drivers/gles3/storage/light_storage.h
@@ -686,7 +686,7 @@ public:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, atlas->debug_texture, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
return atlas->debug_fbo;
}
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp
index 8ab66e2bc6..e073db3cfd 100644
--- a/drivers/gles3/storage/mesh_storage.cpp
+++ b/drivers/gles3/storage/mesh_storage.cpp
@@ -33,6 +33,7 @@
#include "mesh_storage.h"
#include "config.h"
#include "material_storage.h"
+#include "texture_storage.h"
#include "utilities.h"
using namespace GLES3;
@@ -219,7 +220,7 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
glGenBuffers(1, &s->vertex_buffer);
glBindBuffer(GL_ARRAY_BUFFER, s->vertex_buffer);
// If we have an uncompressed surface that contains normals, but not tangents, we need to differentiate the array
- // from a compressed array in the shader. To do so, we allow the the normal to read 4 components out of the buffer
+ // from a compressed array in the shader. To do so, we allow the normal to read 4 components out of the buffer
// But only give it 2 components per normal. So essentially, each vertex reads the next normal in normal.zw.
// This allows us to avoid adding a shader permutation, and avoid passing dummy tangents. Since the stride is kept small
// this should still be a net win for bandwidth.
@@ -1248,7 +1249,7 @@ void MeshStorage::update_mesh_instances() {
}
glEnable(GL_RASTERIZER_DISCARD);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
// Process skeletons and blend shapes using transform feedback
while (dirty_mesh_instance_arrays.first()) {
MeshInstance *mi = dirty_mesh_instance_arrays.first()->self();
diff --git a/drivers/gles3/storage/particles_storage.cpp b/drivers/gles3/storage/particles_storage.cpp
index e263acf88b..c5a97bdbd5 100644
--- a/drivers/gles3/storage/particles_storage.cpp
+++ b/drivers/gles3/storage/particles_storage.cpp
@@ -818,7 +818,7 @@ void ParticlesStorage::particles_set_view_axis(RID p_particles, const Vector3 &p
}
glEnable(GL_RASTERIZER_DISCARD);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
_particles_update_instance_buffer(particles, axis, p_up_axis);
glDisable(GL_RASTERIZER_DISCARD);
}
@@ -1002,7 +1002,7 @@ void ParticlesStorage::_particles_update_instance_buffer(Particles *particles, c
void ParticlesStorage::update_particles() {
glEnable(GL_RASTERIZER_DISCARD);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
GLuint global_buffer = GLES3::MaterialStorage::get_singleton()->global_shader_parameters_get_uniform_buffer();
@@ -1262,7 +1262,7 @@ GLuint ParticlesStorage::particles_collision_get_heightfield_framebuffer(RID p_p
particles_collision->heightfield_fb_size = size;
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
return particles_collision->heightfield_fb;
diff --git a/drivers/gles3/storage/render_scene_buffers_gles3.cpp b/drivers/gles3/storage/render_scene_buffers_gles3.cpp
index bd96442328..de0a64f5fe 100644
--- a/drivers/gles3/storage/render_scene_buffers_gles3.cpp
+++ b/drivers/gles3/storage/render_scene_buffers_gles3.cpp
@@ -121,7 +121,7 @@ GLuint RenderSceneBuffersGLES3::_rt_get_cached_fbo(GLuint p_color, GLuint p_dept
msaa3d.cached_fbos.push_back(new_fbo);
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
#endif
return new_fbo.fbo;
@@ -265,7 +265,7 @@ void RenderSceneBuffersGLES3::_check_render_buffers() {
}
glBindTexture(texture_target, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
if (msaa3d.mode != RS::VIEWPORT_MSAA_DISABLED) {
@@ -316,7 +316,7 @@ void RenderSceneBuffersGLES3::_check_render_buffers() {
}
glBindRenderbuffer(GL_RENDERBUFFER, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
#if !defined(IOS_ENABLED) && !defined(WEB_ENABLED)
} else if (use_multiview && !config->rt_msaa_multiview_supported) {
// Render to texture extensions not supported? fall back to MSAA textures through GL_EXT_multiview_texture_multisample.
@@ -362,7 +362,7 @@ void RenderSceneBuffersGLES3::_check_render_buffers() {
}
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
#endif
#if defined(ANDROID_ENABLED) || defined(WEB_ENABLED) // Only supported on OpenGLES!
} else if (!use_internal_buffer) {
@@ -390,7 +390,7 @@ void RenderSceneBuffersGLES3::_check_render_buffers() {
WARN_PRINT("Could not create 3D MSAA framebuffer, status: " + texture_storage->get_framebuffer_error(status));
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
#endif
} else {
// HUH? how did we get here?
@@ -531,7 +531,7 @@ void RenderSceneBuffersGLES3::check_backbuffer(bool p_need_color, bool p_need_de
}
glBindTexture(texture_target, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
void RenderSceneBuffersGLES3::_clear_back_buffers() {
@@ -607,7 +607,7 @@ void RenderSceneBuffersGLES3::check_glow_buffers() {
}
glBindTexture(GL_TEXTURE_2D, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
void RenderSceneBuffersGLES3::_clear_glow_buffers() {
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index e9df3c6fc8..ffbad4c83b 100644
--- a/drivers/gles3/storage/texture_storage.cpp
+++ b/drivers/gles3/storage/texture_storage.cpp
@@ -1090,7 +1090,7 @@ Ref<Image> TextureStorage::texture_2d_get(RID p_texture) const {
glReadPixels(0, 0, texture->alloc_width, texture->alloc_height, GL_RGBA, GL_UNSIGNED_BYTE, &w[0]);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteTextures(1, &temp_color_texture);
glDeleteFramebuffers(1, &temp_framebuffer);
@@ -1162,7 +1162,7 @@ Ref<Image> TextureStorage::texture_2d_layer_get(RID p_texture, int p_layer) cons
glReadPixels(0, 0, texture->alloc_width, texture->alloc_height, GL_RGBA, GL_UNSIGNED_BYTE, &w[0]);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteTextures(1, &temp_color_texture);
glDeleteFramebuffers(1, &temp_framebuffer);
@@ -1265,7 +1265,7 @@ Vector<Ref<Image>> TextureStorage::texture_3d_get(RID p_texture) const {
Vector<Ref<Image>> ret = _texture_3d_read_framebuffer(texture);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glDeleteTextures(1, &temp_color_texture);
glDeleteFramebuffers(1, &temp_framebuffer);
@@ -1920,7 +1920,7 @@ void TextureStorage::update_texture_atlas() {
copy_effects->copy_to_rect(t->uv_rect);
}
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
}
/* DECAL API */
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 1652c0b1f1..6f1439a91f 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -3828,7 +3828,7 @@ void AnimationTrackEditor::_insert_track(bool p_reset_wanted, bool p_create_bezi
}
}
-void AnimationTrackEditor::insert_transform_key(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type, const Variant p_value) {
+void AnimationTrackEditor::insert_transform_key(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type, const Variant &p_value) {
ERR_FAIL_NULL(root);
ERR_FAIL_COND_MSG(
(p_type != Animation::TYPE_POSITION_3D && p_type != Animation::TYPE_ROTATION_3D && p_type != Animation::TYPE_SCALE_3D),
@@ -4986,7 +4986,7 @@ void AnimationTrackEditor::_fetch_value_track_options(const NodePath &p_path, An
}
}
-void AnimationTrackEditor::_new_track_property_selected(String p_name) {
+void AnimationTrackEditor::_new_track_property_selected(const String &p_name) {
String full_path = String(adding_track_path) + ":" + p_name;
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 0d6f93fefc..d0da7b0062 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -440,7 +440,7 @@ class AnimationTrackEditor : public VBoxContainer {
void _add_track(int p_type);
void _new_track_node_selected(NodePath p_path);
- void _new_track_property_selected(String p_name);
+ void _new_track_property_selected(const String &p_name);
void _update_step_spinbox();
@@ -699,7 +699,7 @@ public:
void set_anim_pos(float p_pos);
void insert_node_value_key(Node *p_node, const String &p_property, const Variant &p_value, bool p_only_if_exists = false);
void insert_value_key(const String &p_property, const Variant &p_value, bool p_advance);
- void insert_transform_key(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type, const Variant p_value);
+ void insert_transform_key(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type, const Variant &p_value);
bool has_track(Node3D *p_node, const String &p_sub, const Animation::TrackType p_type);
void make_insert_queue();
void commit_insert_queue();
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index d3872349e9..3efefe83c3 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1059,7 +1059,6 @@ void CodeTextEditor::update_editor_settings() {
text_editor->set_line_length_guidelines(TypedArray<int>());
}
- _update_font_ligatures();
set_zoom_factor(zoom_factor);
}
@@ -1683,10 +1682,6 @@ void CodeTextEditor::goto_error() {
}
void CodeTextEditor::_update_text_editor_theme() {
- if (!EditorThemeManager::is_generated_theme_outdated()) {
- return;
- }
-
emit_signal(SNAME("load_theme_settings"));
error_button->set_icon(get_editor_theme_icon(SNAME("StatusError")));
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 9fef200611..19474d383d 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -236,7 +236,7 @@ void ConnectDialog::_remove_bind() {
/*
* Automatically generates a name for the callback method.
*/
-StringName ConnectDialog::generate_method_callback_name(Node *p_source, String p_signal_name, Node *p_target) {
+StringName ConnectDialog::generate_method_callback_name(Node *p_source, const String &p_signal_name, Node *p_target) {
String node_name = p_source->get_name();
for (int i = 0; i < node_name.length(); i++) { // TODO: Regex filter may be cleaner.
char32_t c = node_name[i];
@@ -645,7 +645,7 @@ void ConnectDialog::init(const ConnectionData &p_cd, const PackedStringArray &p_
source_connection_data = p_cd;
}
-void ConnectDialog::popup_dialog(const String p_for_signal) {
+void ConnectDialog::popup_dialog(const String &p_for_signal) {
from_signal->set_text(p_for_signal);
warning_label->add_theme_color_override("font_color", warning_label->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index fb163fbb5f..8aa44dc91d 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -163,7 +163,7 @@ protected:
static void _bind_methods();
public:
- static StringName generate_method_callback_name(Node *p_source, String p_signal_name, Node *p_target);
+ static StringName generate_method_callback_name(Node *p_source, const String &p_signal_name, Node *p_target);
Node *get_source() const;
ConnectionData get_source_connection_data() const;
StringName get_signal_name() const;
@@ -184,7 +184,7 @@ public:
void init(const ConnectionData &p_cd, const PackedStringArray &p_signal_args, bool p_edit = false);
- void popup_dialog(const String p_for_signal);
+ void popup_dialog(const String &p_for_signal);
ConnectDialog();
~ConnectDialog();
};
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 604449b04b..603b3505d4 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -343,7 +343,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
}
}
-String CreateDialog::_top_result(const Vector<String> p_candidates, const String &p_search_text) const {
+String CreateDialog::_top_result(const Vector<String> &p_candidates, const String &p_search_text) const {
float highest_score = 0;
int highest_index = 0;
for (int i = 0; i < p_candidates.size(); i++) {
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index 694efd1ee1..12385747c2 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -71,7 +71,7 @@ class CreateDialog : public ConfirmationDialog {
bool _should_hide_type(const String &p_type) const;
void _add_type(const String &p_type, const TypeCategory p_type_category);
void _configure_search_option_item(TreeItem *r_item, const String &p_type, const TypeCategory p_type_category);
- String _top_result(const Vector<String> p_candidates, const String &p_search_text) const;
+ String _top_result(const Vector<String> &p_candidates, const String &p_search_text) const;
float _score_type(const String &p_type, const String &p_search) const;
bool _is_type_preferred(const String &p_type) const;
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index 5fe35bde84..b7719f6c97 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -557,7 +557,7 @@ void EditorDebuggerNode::_paused() {
});
}
-void EditorDebuggerNode::_breaked(bool p_breaked, bool p_can_debug, String p_message, bool p_has_stackdump, int p_debugger) {
+void EditorDebuggerNode::_breaked(bool p_breaked, bool p_can_debug, const String &p_message, bool p_has_stackdump, int p_debugger) {
if (get_current_debugger() != get_debugger(p_debugger)) {
if (!p_breaked) {
return;
@@ -582,7 +582,7 @@ void EditorDebuggerNode::set_breakpoint(const String &p_path, int p_line, bool p
emit_signal(SNAME("breakpoint_toggled"), p_path, p_line, p_enabled);
}
-void EditorDebuggerNode::set_breakpoints(const String &p_path, Array p_lines) {
+void EditorDebuggerNode::set_breakpoints(const String &p_path, const Array &p_lines) {
for (int i = 0; i < p_lines.size(); i++) {
set_breakpoint(p_path, p_lines[i], true);
}
diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h
index d30f29c7c6..01aa522f40 100644
--- a/editor/debugger/editor_debugger_node.h
+++ b/editor/debugger/editor_debugger_node.h
@@ -149,7 +149,7 @@ protected:
void _text_editor_stack_clear(const ScriptEditorDebugger *p_debugger);
void _stack_frame_selected(int p_debugger);
void _error_selected(const String &p_file, int p_line, int p_debugger);
- void _breaked(bool p_breaked, bool p_can_debug, String p_message, bool p_has_stackdump, int p_debugger);
+ void _breaked(bool p_breaked, bool p_can_debug, const String &p_message, bool p_has_stackdump, int p_debugger);
void _paused();
void _break_state_changed();
void _menu_option(int p_id);
@@ -186,7 +186,7 @@ public:
bool is_skip_breakpoints() const;
void set_breakpoint(const String &p_path, int p_line, bool p_enabled);
- void set_breakpoints(const String &p_path, Array p_lines);
+ void set_breakpoints(const String &p_path, const Array &p_lines);
void reload_all_scripts();
void reload_scripts(const Vector<String> &p_script_paths);
diff --git a/editor/debugger/editor_file_server.cpp b/editor/debugger/editor_file_server.cpp
index c12cec1e74..e84eb14636 100644
--- a/editor/debugger/editor_file_server.cpp
+++ b/editor/debugger/editor_file_server.cpp
@@ -98,7 +98,7 @@ void EditorFileServer::_scan_files_changed(EditorFileSystemDirectory *efd, const
}
}
-static void _add_custom_file(const String f, HashMap<String, uint64_t> &files_to_send, HashMap<String, uint64_t> &cached_files) {
+static void _add_custom_file(const String &f, HashMap<String, uint64_t> &files_to_send, HashMap<String, uint64_t> &cached_files) {
if (!FileAccess::exists(f)) {
return;
}
diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp
index 37e13b59cc..ffff362a94 100644
--- a/editor/debugger/editor_performance_profiler.cpp
+++ b/editor/debugger/editor_performance_profiler.cpp
@@ -38,7 +38,7 @@
EditorPerformanceProfiler::Monitor::Monitor() {}
-EditorPerformanceProfiler::Monitor::Monitor(String p_name, String p_base, int p_frame_index, Performance::MonitorType p_type, TreeItem *p_item) {
+EditorPerformanceProfiler::Monitor::Monitor(const String &p_name, const String &p_base, int p_frame_index, Performance::MonitorType p_type, TreeItem *p_item) {
type = p_type;
item = p_item;
frame_index = p_frame_index;
diff --git a/editor/debugger/editor_performance_profiler.h b/editor/debugger/editor_performance_profiler.h
index 6211cc39a4..4afe82b4bd 100644
--- a/editor/debugger/editor_performance_profiler.h
+++ b/editor/debugger/editor_performance_profiler.h
@@ -54,7 +54,7 @@ private:
int frame_index = 0;
Monitor();
- Monitor(String p_name, String p_base, int p_frame_index, Performance::MonitorType p_type, TreeItem *p_item);
+ Monitor(const String &p_name, const String &p_base, int p_frame_index, Performance::MonitorType p_type, TreeItem *p_item);
void update_value(float p_value);
void reset();
};
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 93dcc341c1..979834ebab 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -72,7 +72,7 @@
using CameraOverride = EditorDebuggerNode::CameraOverride;
-void ScriptEditorDebugger::_put_msg(String p_message, Array p_data, uint64_t p_thread_id) {
+void ScriptEditorDebugger::_put_msg(const String &p_message, const Array &p_data, uint64_t p_thread_id) {
ERR_FAIL_COND(p_thread_id == Thread::UNASSIGNED_ID);
if (is_session_active()) {
Array msg;
diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h
index 589e82ef25..bd0b0c7d85 100644
--- a/editor/debugger/script_editor_debugger.h
+++ b/editor/debugger/script_editor_debugger.h
@@ -222,7 +222,7 @@ private:
void _item_menu_id_pressed(int p_option);
void _tab_changed(int p_tab);
- void _put_msg(String p_message, Array p_data, uint64_t p_thread_id = Thread::MAIN_ID);
+ void _put_msg(const String &p_message, const Array &p_data, uint64_t p_thread_id = Thread::MAIN_ID);
void _export_csv();
void _clear_execution();
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 4d5393299c..0e46990b41 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -382,17 +382,17 @@ void EditorAutoloadSettings::_autoload_file_callback(const String &p_path) {
add_autoload->set_disabled(false);
}
-void EditorAutoloadSettings::_autoload_text_submitted(const String p_name) {
+void EditorAutoloadSettings::_autoload_text_submitted(const String &p_name) {
if (!autoload_add_path->get_text().is_empty() && _autoload_name_is_valid(p_name, nullptr)) {
_autoload_add();
}
}
-void EditorAutoloadSettings::_autoload_path_text_changed(const String p_path) {
+void EditorAutoloadSettings::_autoload_path_text_changed(const String &p_path) {
add_autoload->set_disabled(!_autoload_name_is_valid(autoload_add_name->get_text(), nullptr));
}
-void EditorAutoloadSettings::_autoload_text_changed(const String p_name) {
+void EditorAutoloadSettings::_autoload_text_changed(const String &p_name) {
String error_string;
bool is_name_valid = _autoload_name_is_valid(p_name, &error_string);
add_autoload->set_disabled(!is_name_valid);
diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h
index cd025e0fc7..11d7cdbe4d 100644
--- a/editor/editor_autoload_settings.h
+++ b/editor/editor_autoload_settings.h
@@ -83,9 +83,9 @@ class EditorAutoloadSettings : public VBoxContainer {
void _autoload_edited();
void _autoload_button_pressed(Object *p_item, int p_column, int p_button, MouseButton p_mouse_button);
void _autoload_activated();
- void _autoload_path_text_changed(const String p_path);
- void _autoload_text_submitted(const String p_name);
- void _autoload_text_changed(const String p_name);
+ void _autoload_path_text_changed(const String &p_path);
+ void _autoload_text_submitted(const String &p_name);
+ void _autoload_text_changed(const String &p_name);
void _autoload_open(const String &fpath);
void _autoload_file_callback(const String &p_path);
Node *_create_autoload(const String &p_path);
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index b4cf6d8de1..47642c1592 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -266,7 +266,7 @@ Vector<EditorPlugin *> EditorData::get_handling_sub_editors(Object *p_object) {
return sub_plugins;
}
-EditorPlugin *EditorData::get_editor_by_name(String p_name) {
+EditorPlugin *EditorData::get_editor_by_name(const String &p_name) {
for (int i = editor_plugins.size() - 1; i > -1; i--) {
if (editor_plugins[i]->get_name() == p_name) {
return editor_plugins[i];
diff --git a/editor/editor_data.h b/editor/editor_data.h
index d1af400e87..d71a2b3ed3 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -152,7 +152,7 @@ private:
public:
EditorPlugin *get_handling_main_editor(Object *p_object);
Vector<EditorPlugin *> get_handling_sub_editors(Object *p_object);
- EditorPlugin *get_editor_by_name(String p_name);
+ EditorPlugin *get_editor_by_name(const String &p_name);
void copy_object_params(Object *p_object);
void paste_object_params(Object *p_object);
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 5021b814ea..fa6a02f9d4 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -524,7 +524,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
return false; //nothing changed
}
-bool EditorFileSystem::_scan_import_support(Vector<String> reimports) {
+bool EditorFileSystem::_scan_import_support(const Vector<String> &reimports) {
if (import_support_queries.size() == 0) {
return false;
}
@@ -1161,7 +1161,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
}
}
-void EditorFileSystem::_delete_internal_files(String p_file) {
+void EditorFileSystem::_delete_internal_files(const String &p_file) {
if (FileAccess::exists(p_file + ".import")) {
List<String> paths;
ResourceFormatImporter::get_singleton()->get_internal_resource_path_list(p_file, &paths);
diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h
index d099a6fedc..818d725281 100644
--- a/editor/editor_file_system.h
+++ b/editor/editor_file_system.h
@@ -221,7 +221,7 @@ class EditorFileSystem : public Node {
void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
- void _delete_internal_files(String p_file);
+ void _delete_internal_files(const String &p_file);
HashSet<String> textfile_extensions;
HashSet<String> valid_extensions;
@@ -298,7 +298,7 @@ class EditorFileSystem : public Node {
static ResourceUID::ID _resource_saver_get_resource_id_for_path(const String &p_path, bool p_generate);
bool _scan_extensions();
- bool _scan_import_support(Vector<String> reimports);
+ bool _scan_import_support(const Vector<String> &reimports);
Vector<Ref<EditorFileSystemImportFormatSupportQuery>> import_support_queries;
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 3ee61f5203..02c6925f14 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2066,7 +2066,7 @@ void EditorInspectorArray::_new_size_spin_box_value_changed(float p_value) {
resize_dialog->get_ok_button()->set_disabled(int(p_value) == count);
}
-void EditorInspectorArray::_new_size_spin_box_text_submitted(String p_text) {
+void EditorInspectorArray::_new_size_spin_box_text_submitted(const String &p_text) {
_resize_dialog_confirmed();
}
@@ -2306,7 +2306,7 @@ void EditorInspectorArray::_bind_methods() {
ADD_SIGNAL(MethodInfo("page_change_request"));
}
-void EditorInspectorArray::setup_with_move_element_function(Object *p_object, String p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable, bool p_numbered, int p_page_length, const String &p_add_item_text) {
+void EditorInspectorArray::setup_with_move_element_function(Object *p_object, const String &p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable, bool p_numbered, int p_page_length, const String &p_add_item_text) {
count_property = "";
mode = MODE_USE_MOVE_ARRAY_ELEMENT_FUNCTION;
array_element_prefix = p_array_element_prefix;
@@ -2320,7 +2320,7 @@ void EditorInspectorArray::setup_with_move_element_function(Object *p_object, St
_setup();
}
-void EditorInspectorArray::setup_with_count_property(Object *p_object, String p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable, bool p_numbered, int p_page_length, const String &p_add_item_text, const String &p_swap_method) {
+void EditorInspectorArray::setup_with_count_property(Object *p_object, const String &p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable, bool p_numbered, int p_page_length, const String &p_add_item_text, const String &p_swap_method) {
count_property = p_count_property;
mode = MODE_USE_COUNT_PROPERTY;
array_element_prefix = p_array_element_prefix;
@@ -2412,7 +2412,7 @@ void EditorPaginator::_prev_page_button_pressed() {
emit_signal("page_changed", MAX(0, page - 1));
}
-void EditorPaginator::_page_line_edit_text_submitted(String p_text) {
+void EditorPaginator::_page_line_edit_text_submitted(const String &p_text) {
if (p_text.is_valid_int()) {
int new_page = p_text.to_int() - 1;
new_page = MIN(MAX(0, new_page), max_page);
@@ -2616,8 +2616,17 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, EditorIn
}
}
- if (p_section) {
- ep->connect("property_can_revert_changed", callable_mp(p_section, &EditorInspectorSection::property_can_revert_changed));
+ Node *section_search = p_section;
+ while (section_search) {
+ EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(section_search);
+ if (section) {
+ ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
+ }
+ section_search = section_search->get_parent();
+ if (Object::cast_to<EditorInspector>(section_search)) {
+ // Skip sub-resource inspectors.
+ break;
+ }
}
ep->set_read_only(read_only);
@@ -3311,9 +3320,17 @@ void EditorInspector::update_tree() {
}
}
- EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(current_vbox->get_parent());
- if (section) {
- ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
+ Node *section_search = current_vbox->get_parent();
+ while (section_search) {
+ EditorInspectorSection *section = Object::cast_to<EditorInspectorSection>(section_search);
+ if (section) {
+ ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed));
+ }
+ section_search = section_search->get_parent();
+ if (Object::cast_to<EditorInspector>(section_search)) {
+ // Skip sub-resource inspectors.
+ break;
+ }
}
ep->set_draw_warning(draw_warning);
@@ -3812,7 +3829,7 @@ void EditorInspector::_property_changed(const String &p_path, const Variant &p_v
}
}
-void EditorInspector::_multiple_properties_changed(Vector<String> p_paths, Array p_values, bool p_changing) {
+void EditorInspector::_multiple_properties_changed(const Vector<String> &p_paths, const Array &p_values, bool p_changing) {
ERR_FAIL_COND(p_paths.is_empty() || p_values.is_empty());
ERR_FAIL_COND(p_paths.size() != p_values.size());
String names;
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index 0e908b7a14..8c55950a2b 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -406,7 +406,7 @@ class EditorInspectorArray : public EditorInspectorSection {
int _drop_position() const;
void _new_size_spin_box_value_changed(float p_value);
- void _new_size_spin_box_text_submitted(String p_text);
+ void _new_size_spin_box_text_submitted(const String &p_text);
void _resize_dialog_confirmed();
void _update_elements_visibility();
@@ -423,8 +423,8 @@ protected:
static void _bind_methods();
public:
- void setup_with_move_element_function(Object *p_object, String p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "");
- void setup_with_count_property(Object *p_object, String p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "", const String &p_swap_method = "");
+ void setup_with_move_element_function(Object *p_object, const String &p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "");
+ void setup_with_count_property(Object *p_object, const String &p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "", const String &p_swap_method = "");
VBoxContainer *get_vbox(int p_index);
EditorInspectorArray(bool p_read_only);
@@ -444,7 +444,7 @@ class EditorPaginator : public HBoxContainer {
void _first_page_button_pressed();
void _prev_page_button_pressed();
- void _page_line_edit_text_submitted(String p_text);
+ void _page_line_edit_text_submitted(const String &p_text);
void _next_page_button_pressed();
void _last_page_button_pressed();
@@ -520,7 +520,7 @@ class EditorInspector : public ScrollContainer {
void _edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field);
void _property_changed(const String &p_path, const Variant &p_value, const String &p_name = "", bool p_changing = false, bool p_update_all = false);
- void _multiple_properties_changed(Vector<String> p_paths, Array p_values, bool p_changing = false);
+ void _multiple_properties_changed(const Vector<String> &p_paths, const Array &p_values, bool p_changing = false);
void _property_keyed(const String &p_path, bool p_advance);
void _property_keyed_with_value(const String &p_path, const Variant &p_value, bool p_advance);
void _property_deleted(const String &p_path);
diff --git a/editor/editor_log.h b/editor/editor_log.h
index 03a0a071c6..601e63b9fe 100644
--- a/editor/editor_log.h
+++ b/editor/editor_log.h
@@ -64,7 +64,7 @@ private:
LogMessage() {}
- LogMessage(const String p_text, MessageType p_type, bool p_clear) :
+ LogMessage(const String &p_text, MessageType p_type, bool p_clear) :
text(p_text),
type(p_type),
clear(p_clear) {
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 46a648e1b9..73a0768a72 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -254,7 +254,7 @@ void EditorPropertyTextEnum::_set_read_only(bool p_read_only) {
edit_button->set_disabled(p_read_only);
}
-void EditorPropertyTextEnum::_emit_changed_value(String p_string) {
+void EditorPropertyTextEnum::_emit_changed_value(const String &p_string) {
if (string_name) {
emit_changed(get_edited_property(), StringName(p_string));
} else {
@@ -272,7 +272,7 @@ void EditorPropertyTextEnum::_edit_custom_value() {
custom_value_edit->grab_focus();
}
-void EditorPropertyTextEnum::_custom_value_submitted(String p_value) {
+void EditorPropertyTextEnum::_custom_value_submitted(const String &p_value) {
edit_custom_layout->hide();
default_layout->show();
@@ -2897,7 +2897,7 @@ void EditorPropertyNodePath::update_property() {
assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
}
-void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types, bool p_use_path_from_scene_root, bool p_editing_node) {
+void EditorPropertyNodePath::setup(const NodePath &p_base_hint, const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root, bool p_editing_node) {
base_hint = p_base_hint;
valid_types = p_valid_types;
editing_node = p_editing_node;
@@ -3341,6 +3341,7 @@ void EditorPropertyResource::update_property() {
sub_inspector->set_use_folding(is_using_folding());
sub_inspector_vbox = memnew(VBoxContainer);
+ sub_inspector_vbox->set_mouse_filter(MOUSE_FILTER_STOP);
add_child(sub_inspector_vbox);
set_bottom_editor(sub_inspector_vbox);
diff --git a/editor/editor_properties.h b/editor/editor_properties.h
index b7ae4bd1ca..fa759d5d19 100644
--- a/editor/editor_properties.h
+++ b/editor/editor_properties.h
@@ -116,11 +116,11 @@ class EditorPropertyTextEnum : public EditorProperty {
bool string_name = false;
bool loose_mode = false;
- void _emit_changed_value(String p_string);
+ void _emit_changed_value(const String &p_string);
void _option_selected(int p_which);
void _edit_custom_value();
- void _custom_value_submitted(String p_value);
+ void _custom_value_submitted(const String &p_value);
void _custom_value_accepted();
void _custom_value_canceled();
@@ -677,7 +677,7 @@ protected:
public:
virtual void update_property() override;
- void setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
+ void setup(const NodePath &p_base_hint, const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
EditorPropertyNodePath();
};
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 0bc412f60f..8a15f4912a 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -863,6 +863,7 @@ void EditorPropertyDictionary::update_property() {
if (!container) {
container = memnew(MarginContainer);
container->set_theme_type_variation("MarginContainer4px");
+ container->set_mouse_filter(MOUSE_FILTER_STOP);
add_child(container);
set_bottom_editor(container);
@@ -1286,7 +1287,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() {
///////////////////// LOCALIZABLE STRING ///////////////////////////
-void EditorPropertyLocalizableString::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void EditorPropertyLocalizableString::_property_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
if (p_property.begins_with("indices")) {
int index = p_property.get_slice("/", 1).to_int();
diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h
index f157da00c2..0e81a0fae3 100644
--- a/editor/editor_properties_array_dict.h
+++ b/editor/editor_properties_array_dict.h
@@ -214,7 +214,7 @@ class EditorPropertyLocalizableString : public EditorProperty {
void _page_changed(int p_page);
void _edit_pressed();
void _remove_item(Object *p_button, int p_index);
- void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false);
+ void _property_changed(const String &p_property, const Variant &p_value, const String &p_name = "", bool p_changing = false);
void _add_locale_popup();
void _add_locale(const String &p_locale);
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index 95436427ad..963ddb6329 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -654,7 +654,7 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const {
return false;
}
-bool EditorResourcePicker::_is_type_valid(const String p_type_name, const HashSet<StringName> &p_allowed_types) const {
+bool EditorResourcePicker::_is_type_valid(const String &p_type_name, const HashSet<StringName> &p_allowed_types) const {
for (const StringName &E : p_allowed_types) {
String at = E;
if (p_type_name == at || ClassDB::is_parent_class(p_type_name, at) || EditorNode::get_editor_data().script_class_is_parent(p_type_name, at)) {
diff --git a/editor/editor_resource_picker.h b/editor/editor_resource_picker.h
index fb54455e89..8146c02dff 100644
--- a/editor/editor_resource_picker.h
+++ b/editor/editor_resource_picker.h
@@ -99,7 +99,7 @@ class EditorResourcePicker : public HBoxContainer {
String _get_resource_type(const Ref<Resource> &p_resource) const;
void _get_allowed_types(bool p_with_convert, HashSet<StringName> *p_vector) const;
bool _is_drop_valid(const Dictionary &p_drag_data) const;
- bool _is_type_valid(const String p_type_name, const HashSet<StringName> &p_allowed_types) const;
+ bool _is_type_valid(const String &p_type_name, const HashSet<StringName> &p_allowed_types) const;
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index bae7887c02..94bf15ae66 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -95,8 +95,35 @@ void EditorResourcePreviewGenerator::_bind_methods() {
EditorResourcePreviewGenerator::EditorResourcePreviewGenerator() {
}
+void EditorResourcePreviewGenerator::DrawRequester::request_and_wait(RID p_viewport) const {
+ if (EditorResourcePreview::get_singleton()->is_threaded()) {
+ Callable request_vp_update_once = callable_mp(RS::get_singleton(), &RS::viewport_set_update_mode).bind(p_viewport, RS::VIEWPORT_UPDATE_ONCE);
+ RS::get_singleton()->connect(SNAME("frame_pre_draw"), request_vp_update_once, Object::CONNECT_ONE_SHOT);
+ RS::get_singleton()->request_frame_drawn_callback(callable_mp(const_cast<EditorResourcePreviewGenerator::DrawRequester *>(this), &EditorResourcePreviewGenerator::DrawRequester::_post_semaphore));
+
+ semaphore.wait();
+ } else {
+ RS::get_singleton()->draw(false);
+ }
+}
+
+void EditorResourcePreviewGenerator::DrawRequester::abort() const {
+ if (EditorResourcePreview::get_singleton()->is_threaded()) {
+ semaphore.post();
+ }
+}
+
+Variant EditorResourcePreviewGenerator::DrawRequester::_post_semaphore() const {
+ semaphore.post();
+ return Variant(); // Needed because of how the callback is used.
+}
+
EditorResourcePreview *EditorResourcePreview::singleton = nullptr;
+bool EditorResourcePreview::is_threaded() const {
+ return RSG::texture_storage->can_create_resources_async();
+}
+
void EditorResourcePreview::_thread_func(void *ud) {
EditorResourcePreview *erp = (EditorResourcePreview *)ud;
erp->_thread();
@@ -324,7 +351,7 @@ void EditorResourcePreview::_iterate() {
_preview_ready(item.path, 0, texture, small_texture, item.id, item.function, item.userdata, preview_metadata);
}
-void EditorResourcePreview::_write_preview_cache(Ref<FileAccess> p_file, int p_thumbnail_size, bool p_has_small_texture, uint64_t p_modified_time, String p_hash, const Dictionary &p_metadata) {
+void EditorResourcePreview::_write_preview_cache(Ref<FileAccess> p_file, int p_thumbnail_size, bool p_has_small_texture, uint64_t p_modified_time, const String &p_hash, const Dictionary &p_metadata) {
p_file->store_line(itos(p_thumbnail_size));
p_file->store_line(itos(p_has_small_texture));
p_file->store_line(itos(p_modified_time));
@@ -470,7 +497,7 @@ void EditorResourcePreview::start() {
return;
}
- if (RSG::texture_storage->can_create_resources_async()) {
+ if (is_threaded()) {
ERR_FAIL_COND_MSG(thread.is_started(), "Thread already started.");
thread.start(_thread_func, this);
} else {
@@ -481,7 +508,7 @@ void EditorResourcePreview::start() {
}
void EditorResourcePreview::stop() {
- if (RSG::texture_storage->can_create_resources_async()) {
+ if (is_threaded()) {
if (thread.is_started()) {
exiting.set();
preview_sem.post();
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index bc99372bc2..8461651732 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -51,6 +51,16 @@ protected:
GDVIRTUAL0RC(bool, _generate_small_preview_automatically)
GDVIRTUAL0RC(bool, _can_generate_small_preview)
+ class DrawRequester : public Object {
+ Semaphore semaphore;
+
+ Variant _post_semaphore() const;
+
+ public:
+ void request_and_wait(RID p_viewport) const;
+ void abort() const;
+ };
+
public:
virtual bool handles(const String &p_type) const;
virtual Ref<Texture2D> generate(const Ref<Resource> &p_from, const Size2 &p_size, Dictionary &p_metadata) const;
@@ -107,7 +117,7 @@ class EditorResourcePreview : public Node {
static void _idle_callback(); // For other rendering drivers (i.e., OpenGL).
void _iterate();
- void _write_preview_cache(Ref<FileAccess> p_file, int p_thumbnail_size, bool p_has_small_texture, uint64_t p_modified_time, String p_hash, const Dictionary &p_metadata);
+ void _write_preview_cache(Ref<FileAccess> p_file, int p_thumbnail_size, bool p_has_small_texture, uint64_t p_modified_time, const String &p_hash, const Dictionary &p_metadata);
void _read_preview_cache(Ref<FileAccess> p_file, int *r_thumbnail_size, bool *r_has_small_texture, uint64_t *r_modified_time, String *r_hash, Dictionary *r_metadata);
Vector<Ref<EditorResourcePreviewGenerator>> preview_generators;
@@ -132,6 +142,7 @@ public:
void start();
void stop();
+ bool is_threaded() const;
EditorResourcePreview();
~EditorResourcePreview();
diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp
index a380ebd4ad..4eb3f07c47 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -79,6 +79,11 @@ void EditorRunNative::_notification(int p_what) {
}
}
+void EditorRunNative::_confirm_run_native() {
+ run_confirmed = true;
+ resume_run_native();
+}
+
Error EditorRunNative::start_run_native(int p_id) {
if (p_id < 0) {
return OK;
@@ -86,9 +91,9 @@ Error EditorRunNative::start_run_native(int p_id) {
int platform = p_id / 10000;
int idx = p_id % 10000;
+ resume_id = p_id;
if (!EditorNode::get_singleton()->ensure_main_scene(true)) {
- resume_id = p_id;
return OK;
}
@@ -110,6 +115,22 @@ Error EditorRunNative::start_run_native(int p_id) {
return ERR_UNAVAILABLE;
}
+ String architecture = eep->get_device_architecture(idx);
+ if (!run_confirmed && !architecture.is_empty()) {
+ String preset_arch = "architectures/" + architecture;
+ bool is_arch_enabled = preset->get(preset_arch);
+
+ if (!is_arch_enabled) {
+ String warning_message = vformat(TTR("Warning: The CPU architecture '%s' is not active in your export preset.\n\n"), Variant(architecture));
+ warning_message += TTR("Run 'Remote Debug' anyway?");
+
+ run_native_confirm->set_text(warning_message);
+ run_native_confirm->popup_centered();
+ return OK;
+ }
+ }
+ run_confirmed = false;
+
emit_signal(SNAME("native_run"), preset);
int flags = 0;
@@ -174,5 +195,9 @@ EditorRunNative::EditorRunNative() {
add_child(result_dialog);
result_dialog->hide();
+ run_native_confirm = memnew(ConfirmationDialog);
+ add_child(run_native_confirm);
+ run_native_confirm->connect("confirmed", callable_mp(this, &EditorRunNative::_confirm_run_native));
+
set_process(true);
}
diff --git a/editor/editor_run_native.h b/editor/editor_run_native.h
index f52a455bb2..b7638f235e 100644
--- a/editor/editor_run_native.h
+++ b/editor/editor_run_native.h
@@ -41,12 +41,16 @@ class EditorRunNative : public HBoxContainer {
RichTextLabel *result_dialog_log = nullptr;
AcceptDialog *result_dialog = nullptr;
+ ConfirmationDialog *run_native_confirm = nullptr;
+ bool run_confirmed = false;
MenuButton *remote_debug = nullptr;
bool first = true;
int resume_id = -1;
+ void _confirm_run_native();
+
protected:
static void _bind_methods();
void _notification(int p_what);
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 63a9ab5684..199fa3f6c9 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -934,7 +934,7 @@ void EditorSettings::_load_default_visual_shader_editor_theme() {
_initial_set("editors/visual_editors/category_colors/particle_color", Color(0.12, 0.358, 0.8));
}
-bool EditorSettings::_save_text_editor_theme(String p_file) {
+bool EditorSettings::_save_text_editor_theme(const String &p_file) {
String theme_section = "color_theme";
Ref<ConfigFile> cf = memnew(ConfigFile); // hex is better?
@@ -957,7 +957,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
return err == OK;
}
-bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) {
+bool EditorSettings::_is_default_text_editor_theme(const String &p_theme_name) {
return p_theme_name == "default" || p_theme_name == "godot 2" || p_theme_name == "custom";
}
@@ -1251,7 +1251,7 @@ void EditorSettings::add_property_hint(const PropertyInfo &p_hint) {
// Metadata
-void EditorSettings::set_project_metadata(const String &p_section, const String &p_key, Variant p_data) {
+void EditorSettings::set_project_metadata(const String &p_section, const String &p_key, const Variant &p_data) {
const String path = _get_project_metadata_path();
if (project_metadata.is_null()) {
@@ -1268,7 +1268,7 @@ void EditorSettings::set_project_metadata(const String &p_section, const String
ERR_FAIL_COND_MSG(err != OK, "Cannot save project metadata to file '" + path + "'.");
}
-Variant EditorSettings::get_project_metadata(const String &p_section, const String &p_key, Variant p_default) const {
+Variant EditorSettings::get_project_metadata(const String &p_section, const String &p_key, const Variant &p_default) const {
if (project_metadata.is_null()) {
project_metadata.instantiate();
@@ -1409,7 +1409,7 @@ void EditorSettings::load_text_editor_theme() {
// if it doesn't load just use what is currently loaded
}
-bool EditorSettings::import_text_editor_theme(String p_file) {
+bool EditorSettings::import_text_editor_theme(const String &p_file) {
if (!p_file.ends_with(".tet")) {
return false;
} else {
@@ -1588,7 +1588,7 @@ Ref<Shortcut> ED_GET_SHORTCUT(const String &p_path) {
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
- ERR_FAIL_COND_V_MSG(!sc.is_valid(), sc, "Used ED_GET_SHORTCUT with invalid shortcut: " + p_path + ".");
+ ERR_FAIL_COND_V_MSG(!sc.is_valid(), sc, "Used ED_GET_SHORTCUT with invalid shortcut: " + p_path);
return sc;
}
@@ -1597,7 +1597,7 @@ void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_k
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
- ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path + ".");
+ ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path);
PackedInt32Array arr;
arr.push_back((int32_t)p_keycode);
@@ -1609,7 +1609,7 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
- ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE_ARRAY with invalid shortcut: " + p_path + ".");
+ ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE_ARRAY with invalid shortcut: " + p_path);
// Only add the override if the OS supports the provided feature.
if (!OS::get_singleton()->has_feature(p_feature)) {
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 5783bac770..4995558e2b 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -111,8 +111,8 @@ private:
void _load_defaults(Ref<ConfigFile> p_extra_config = Ref<ConfigFile>());
void _load_godot2_text_editor_theme();
void _load_default_visual_shader_editor_theme();
- bool _save_text_editor_theme(String p_file);
- bool _is_default_text_editor_theme(String p_theme_name);
+ bool _save_text_editor_theme(const String &p_file);
+ bool _is_default_text_editor_theme(const String &p_theme_name);
const String _get_project_metadata_path() const;
protected:
@@ -155,8 +155,8 @@ public:
void set_resource_clipboard(const Ref<Resource> &p_resource) { clipboard = p_resource; }
Ref<Resource> get_resource_clipboard() const { return clipboard; }
- void set_project_metadata(const String &p_section, const String &p_key, Variant p_data);
- Variant get_project_metadata(const String &p_section, const String &p_key, Variant p_default) const;
+ void set_project_metadata(const String &p_section, const String &p_key, const Variant &p_data);
+ Variant get_project_metadata(const String &p_section, const String &p_key, const Variant &p_default) const;
void set_favorites(const Vector<String> &p_favorites);
Vector<String> get_favorites() const;
@@ -166,7 +166,7 @@ public:
void list_text_editor_themes();
void load_text_editor_theme();
- bool import_text_editor_theme(String p_file);
+ bool import_text_editor_theme(const String &p_file);
bool save_text_editor_theme();
bool save_text_editor_theme_as(String p_file);
bool is_default_text_editor_theme();
diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp
index 1f76c94655..7d39dc8715 100644
--- a/editor/editor_vcs_interface.cpp
+++ b/editor/editor_vcs_interface.cpp
@@ -34,18 +34,18 @@
EditorVCSInterface *EditorVCSInterface::singleton = nullptr;
-void EditorVCSInterface::popup_error(String p_msg) {
+void EditorVCSInterface::popup_error(const String &p_msg) {
// TRANSLATORS: %s refers to the name of a version control system (e.g. "Git").
EditorNode::get_singleton()->show_warning(p_msg.strip_edges(), vformat(TTR("%s Error"), get_vcs_name()));
}
-bool EditorVCSInterface::initialize(String p_project_path) {
+bool EditorVCSInterface::initialize(const String &p_project_path) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_initialize, p_project_path, result);
return result;
}
-void EditorVCSInterface::set_credentials(String p_username, String p_password, String p_ssh_public_key, String p_ssh_private_key, String p_ssh_passphrase) {
+void EditorVCSInterface::set_credentials(const String &p_username, const String &p_password, const String &p_ssh_public_key, const String &p_ssh_private_key, const String &p_ssh_passphrase) {
GDVIRTUAL_REQUIRED_CALL(_set_credentials, p_username, p_password, p_ssh_public_key, p_ssh_private_key, p_ssh_passphrase);
}
@@ -75,23 +75,23 @@ List<EditorVCSInterface::StatusFile> EditorVCSInterface::get_modified_files_data
return status_files;
}
-void EditorVCSInterface::stage_file(String p_file_path) {
+void EditorVCSInterface::stage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_stage_file, p_file_path);
}
-void EditorVCSInterface::unstage_file(String p_file_path) {
+void EditorVCSInterface::unstage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_unstage_file, p_file_path);
}
-void EditorVCSInterface::discard_file(String p_file_path) {
+void EditorVCSInterface::discard_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_discard_file, p_file_path);
}
-void EditorVCSInterface::commit(String p_msg) {
+void EditorVCSInterface::commit(const String &p_msg) {
GDVIRTUAL_REQUIRED_CALL(_commit, p_msg);
}
-List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(String p_identifier, TreeArea p_area) {
+List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(const String &p_identifier, TreeArea p_area) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_diff, p_identifier, int(p_area), result)) {
return {};
@@ -130,19 +130,19 @@ List<String> EditorVCSInterface::get_branch_list() {
return branch_list;
}
-void EditorVCSInterface::create_branch(String p_branch_name) {
+void EditorVCSInterface::create_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_create_branch, p_branch_name);
}
-void EditorVCSInterface::create_remote(String p_remote_name, String p_remote_url) {
+void EditorVCSInterface::create_remote(const String &p_remote_name, const String &p_remote_url) {
GDVIRTUAL_REQUIRED_CALL(_create_remote, p_remote_name, p_remote_url);
}
-void EditorVCSInterface::remove_branch(String p_branch_name) {
+void EditorVCSInterface::remove_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_branch, p_branch_name);
}
-void EditorVCSInterface::remove_remote(String p_remote_name) {
+void EditorVCSInterface::remove_remote(const String &p_remote_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_remote, p_remote_name);
}
@@ -152,25 +152,25 @@ String EditorVCSInterface::get_current_branch_name() {
return result;
}
-bool EditorVCSInterface::checkout_branch(String p_branch_name) {
+bool EditorVCSInterface::checkout_branch(const String &p_branch_name) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_checkout_branch, p_branch_name, result);
return result;
}
-void EditorVCSInterface::pull(String p_remote) {
+void EditorVCSInterface::pull(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_pull, p_remote);
}
-void EditorVCSInterface::push(String p_remote, bool p_force) {
+void EditorVCSInterface::push(const String &p_remote, bool p_force) {
GDVIRTUAL_REQUIRED_CALL(_push, p_remote, p_force);
}
-void EditorVCSInterface::fetch(String p_remote) {
+void EditorVCSInterface::fetch(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_fetch, p_remote);
}
-List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(String p_file_path, String p_text) {
+List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(const String &p_file_path, const String &p_text) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_line_diff, p_file_path, p_text, result)) {
return {};
@@ -195,7 +195,7 @@ String EditorVCSInterface::get_vcs_name() {
return result;
}
-Dictionary EditorVCSInterface::create_diff_line(int p_new_line_no, int p_old_line_no, String p_content, String p_status) {
+Dictionary EditorVCSInterface::create_diff_line(int p_new_line_no, int p_old_line_no, const String &p_content, const String &p_status) {
Dictionary diff_line;
diff_line["new_line_no"] = p_new_line_no;
diff_line["old_line_no"] = p_old_line_no;
@@ -220,7 +220,7 @@ Dictionary EditorVCSInterface::add_line_diffs_into_diff_hunk(Dictionary p_diff_h
return p_diff_hunk;
}
-Dictionary EditorVCSInterface::create_diff_file(String p_new_file, String p_old_file) {
+Dictionary EditorVCSInterface::create_diff_file(const String &p_new_file, const String &p_old_file) {
Dictionary file_diff;
file_diff["new_file"] = p_new_file;
file_diff["old_file"] = p_old_file;
@@ -228,7 +228,7 @@ Dictionary EditorVCSInterface::create_diff_file(String p_new_file, String p_old_
return file_diff;
}
-Dictionary EditorVCSInterface::create_commit(String p_msg, String p_author, String p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes) {
+Dictionary EditorVCSInterface::create_commit(const String &p_msg, const String &p_author, const String &p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes) {
Dictionary commit_info;
commit_info["message"] = p_msg;
commit_info["author"] = p_author;
@@ -243,7 +243,7 @@ Dictionary EditorVCSInterface::add_diff_hunks_into_diff_file(Dictionary p_diff_f
return p_diff_file;
}
-Dictionary EditorVCSInterface::create_status_file(String p_file_path, ChangeType p_change, TreeArea p_area) {
+Dictionary EditorVCSInterface::create_status_file(const String &p_file_path, ChangeType p_change, TreeArea p_area) {
Dictionary sf;
sf["file_path"] = p_file_path;
sf["change_type"] = p_change;
@@ -251,7 +251,7 @@ Dictionary EditorVCSInterface::create_status_file(String p_file_path, ChangeType
return sf;
}
-EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(Dictionary p_diff_line) {
+EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(const Dictionary &p_diff_line) {
DiffLine d;
d.new_line_no = p_diff_line["new_line_no"];
d.old_line_no = p_diff_line["old_line_no"];
@@ -260,7 +260,7 @@ EditorVCSInterface::DiffLine EditorVCSInterface::_convert_diff_line(Dictionary p
return d;
}
-EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(Dictionary p_diff_hunk) {
+EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(const Dictionary &p_diff_hunk) {
DiffHunk dh;
dh.new_lines = p_diff_hunk["new_lines"];
dh.old_lines = p_diff_hunk["old_lines"];
@@ -274,7 +274,7 @@ EditorVCSInterface::DiffHunk EditorVCSInterface::_convert_diff_hunk(Dictionary p
return dh;
}
-EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(Dictionary p_diff_file) {
+EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(const Dictionary &p_diff_file) {
DiffFile df;
df.new_file = p_diff_file["new_file"];
df.old_file = p_diff_file["old_file"];
@@ -286,7 +286,7 @@ EditorVCSInterface::DiffFile EditorVCSInterface::_convert_diff_file(Dictionary p
return df;
}
-EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(Dictionary p_commit) {
+EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(const Dictionary &p_commit) {
EditorVCSInterface::Commit c;
c.msg = p_commit["message"];
c.author = p_commit["author"];
@@ -296,7 +296,7 @@ EditorVCSInterface::Commit EditorVCSInterface::_convert_commit(Dictionary p_comm
return c;
}
-EditorVCSInterface::StatusFile EditorVCSInterface::_convert_status_file(Dictionary p_status_file) {
+EditorVCSInterface::StatusFile EditorVCSInterface::_convert_status_file(const Dictionary &p_status_file) {
StatusFile sf;
sf.file_path = p_status_file["file_path"];
sf.change_type = (ChangeType)(int)p_status_file["change_type"];
diff --git a/editor/editor_vcs_interface.h b/editor/editor_vcs_interface.h
index 84f2cf9281..8fcd45756a 100644
--- a/editor/editor_vcs_interface.h
+++ b/editor/editor_vcs_interface.h
@@ -99,11 +99,11 @@ protected:
static void _bind_methods();
- DiffLine _convert_diff_line(Dictionary p_diff_line);
- DiffHunk _convert_diff_hunk(Dictionary p_diff_hunk);
- DiffFile _convert_diff_file(Dictionary p_diff_file);
- Commit _convert_commit(Dictionary p_commit);
- StatusFile _convert_status_file(Dictionary p_status_file);
+ DiffLine _convert_diff_line(const Dictionary &p_diff_line);
+ DiffHunk _convert_diff_hunk(const Dictionary &p_diff_hunk);
+ DiffFile _convert_diff_file(const Dictionary &p_diff_file);
+ Commit _convert_commit(const Dictionary &p_commit);
+ StatusFile _convert_status_file(const Dictionary &p_status_file);
// Proxy endpoints for extensions to implement
GDVIRTUAL1R(bool, _initialize, String);
@@ -141,40 +141,40 @@ public:
static void create_vcs_metadata_files(VCSMetadata p_vcs_metadata_type, String &p_dir);
// Proxies to the editor for use
- bool initialize(String p_project_path);
- void set_credentials(String p_username, String p_password, String p_ssh_public_key_path, String p_ssh_private_key_path, String p_ssh_passphrase);
+ bool initialize(const String &p_project_path);
+ void set_credentials(const String &p_username, const String &p_password, const String &p_ssh_public_key_path, const String &p_ssh_private_key_path, const String &p_ssh_passphrase);
List<StatusFile> get_modified_files_data();
- void stage_file(String p_file_path);
- void unstage_file(String p_file_path);
- void discard_file(String p_file_path);
- void commit(String p_msg);
- List<DiffFile> get_diff(String p_identifier, TreeArea p_area);
+ void stage_file(const String &p_file_path);
+ void unstage_file(const String &p_file_path);
+ void discard_file(const String &p_file_path);
+ void commit(const String &p_msg);
+ List<DiffFile> get_diff(const String &p_identifier, TreeArea p_area);
bool shut_down();
String get_vcs_name();
List<Commit> get_previous_commits(int p_max_commits);
List<String> get_branch_list();
List<String> get_remotes();
- void create_branch(String p_branch_name);
- void remove_branch(String p_branch_name);
- void create_remote(String p_remote_name, String p_remote_url);
- void remove_remote(String p_remote_name);
+ void create_branch(const String &p_branch_name);
+ void remove_branch(const String &p_branch_name);
+ void create_remote(const String &p_remote_name, const String &p_remote_url);
+ void remove_remote(const String &p_remote_name);
String get_current_branch_name();
- bool checkout_branch(String p_branch_name);
- void pull(String p_remote);
- void push(String p_remote, bool p_force);
- void fetch(String p_remote);
- List<DiffHunk> get_line_diff(String p_file_path, String p_text);
+ bool checkout_branch(const String &p_branch_name);
+ void pull(const String &p_remote);
+ void push(const String &p_remote, bool p_force);
+ void fetch(const String &p_remote);
+ List<DiffHunk> get_line_diff(const String &p_file_path, const String &p_text);
// Helper functions to create and convert Dictionary into data structures
- Dictionary create_diff_line(int p_new_line_no, int p_old_line_no, String p_content, String p_status);
+ Dictionary create_diff_line(int p_new_line_no, int p_old_line_no, const String &p_content, const String &p_status);
Dictionary create_diff_hunk(int p_old_start, int p_new_start, int p_old_lines, int p_new_lines);
- Dictionary create_diff_file(String p_new_file, String p_old_file);
- Dictionary create_commit(String p_msg, String p_author, String p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes);
- Dictionary create_status_file(String p_file_path, ChangeType p_change, TreeArea p_area);
+ Dictionary create_diff_file(const String &p_new_file, const String &p_old_file);
+ Dictionary create_commit(const String &p_msg, const String &p_author, const String &p_id, int64_t p_unix_timestamp, int64_t p_offset_minutes);
+ Dictionary create_status_file(const String &p_file_path, ChangeType p_change, TreeArea p_area);
Dictionary add_line_diffs_into_diff_hunk(Dictionary p_diff_hunk, TypedArray<Dictionary> p_line_diffs);
Dictionary add_diff_hunks_into_diff_file(Dictionary p_diff_file, TypedArray<Dictionary> p_diff_hunks);
- void popup_error(String p_msg);
+ void popup_error(const String &p_msg);
};
VARIANT_ENUM_CAST(EditorVCSInterface::ChangeType);
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp
index 9d65821ccd..b9dc52511e 100644
--- a/editor/export/editor_export_platform.cpp
+++ b/editor/export/editor_export_platform.cpp
@@ -329,7 +329,7 @@ Ref<ImageTexture> EditorExportPlatform::get_option_icon(int p_index) const {
}
}
-String EditorExportPlatform::find_export_template(String template_file_name, String *err) const {
+String EditorExportPlatform::find_export_template(const String &template_file_name, String *err) const {
String current_version = VERSION_FULL_CONFIG;
String template_path = EditorPaths::get_singleton()->get_export_templates_dir().path_join(current_version).path_join(template_file_name);
@@ -344,7 +344,7 @@ String EditorExportPlatform::find_export_template(String template_file_name, Str
return String();
}
-bool EditorExportPlatform::exists_export_template(String template_file_name, String *err) const {
+bool EditorExportPlatform::exists_export_template(const String &template_file_name, String *err) const {
return find_export_template(template_file_name, err) != "";
}
diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h
index 0b922cc6c8..26e1f86c8b 100644
--- a/editor/export/editor_export_platform.h
+++ b/editor/export/editor_export_platform.h
@@ -132,8 +132,8 @@ protected:
HashSet<String> get_features(const Ref<EditorExportPreset> &p_preset, bool p_debug) const;
- bool exists_export_template(String template_file_name, String *err) const;
- String find_export_template(String template_file_name, String *err = nullptr) const;
+ bool exists_export_template(const String &template_file_name, String *err) const;
+ String find_export_template(const String &template_file_name, String *err = nullptr) const;
void gen_export_flags(Vector<String> &r_flags, int p_flags);
void gen_debug_flags(Vector<String> &r_flags, int p_flags);
@@ -227,6 +227,7 @@ public:
virtual Ref<ImageTexture> get_option_icon(int p_index) const;
virtual String get_option_label(int p_device) const { return ""; }
virtual String get_option_tooltip(int p_device) const { return ""; }
+ virtual String get_device_architecture(int p_device) const { return ""; }
enum DebugFlags {
DEBUG_FLAG_DUMB_CLIENT = 1,
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 0356d0d3ad..a7e40ce5b9 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -80,7 +80,7 @@ Control *FileSystemList::make_custom_tooltip(const String &p_text) const {
return FileSystemDock::get_singleton()->create_tooltip_for_path(get_item_metadata(idx));
}
-void FileSystemList::_line_editor_submit(String p_text) {
+void FileSystemList::_line_editor_submit(const String &p_text) {
popup_editor->hide();
emit_signal(SNAME("item_edited"));
@@ -173,7 +173,7 @@ FileSystemList::FileSystemList() {
FileSystemDock *FileSystemDock::singleton = nullptr;
-Ref<Texture2D> FileSystemDock::_get_tree_item_icon(bool p_is_valid, String p_file_type) {
+Ref<Texture2D> FileSystemDock::_get_tree_item_icon(bool p_is_valid, const String &p_file_type) {
Ref<Texture2D> file_icon;
if (!p_is_valid) {
file_icon = get_editor_theme_icon(SNAME("ImportFail"));
@@ -1678,7 +1678,7 @@ void FileSystemDock::_resource_removed(const Ref<Resource> &p_resource) {
emit_signal(SNAME("resource_removed"), p_resource);
}
-void FileSystemDock::_file_removed(String p_file) {
+void FileSystemDock::_file_removed(const String &p_file) {
emit_signal(SNAME("file_removed"), p_file);
// Find the closest parent directory available, in case multiple items were deleted along the same path.
@@ -1691,7 +1691,7 @@ void FileSystemDock::_file_removed(String p_file) {
current_path_line_edit->set_text(current_path);
}
-void FileSystemDock::_folder_removed(String p_folder) {
+void FileSystemDock::_folder_removed(const String &p_folder) {
emit_signal(SNAME("folder_removed"), p_folder);
// Find the closest parent directory available, in case multiple items were deleted along the same path.
@@ -2986,7 +2986,7 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu)
_update_file_list(true);
}
-void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<String> p_paths, bool p_display_path_dependent_options) {
+void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vector<String> &p_paths, bool p_display_path_dependent_options) {
// Add options for files and folders.
ERR_FAIL_COND_MSG(p_paths.is_empty(), "Path cannot be empty.");
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index c9d2bc535e..06bf3eda52 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -64,7 +64,7 @@ class FileSystemList : public ItemList {
LineEdit *line_editor = nullptr;
virtual Control *make_custom_tooltip(const String &p_text) const override;
- void _line_editor_submit(String p_text);
+ void _line_editor_submit(const String &p_text);
void _text_editor_popup_modal_close();
protected:
@@ -245,7 +245,7 @@ private:
void _tree_mouse_exited();
void _reselect_items_selected_on_drag_begin(bool reset = false);
- Ref<Texture2D> _get_tree_item_icon(bool p_is_valid, String p_file_type);
+ Ref<Texture2D> _get_tree_item_icon(bool p_is_valid, const String &p_file_type);
bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths, bool p_select_in_favorites, bool p_unfold_path = false);
void _update_tree(const Vector<String> &p_uncollapsed_paths = Vector<String>(), bool p_uncollapse_root = false, bool p_select_in_favorites = false, bool p_unfold_path = false);
void _navigate_to_path(const String &p_path, bool p_select_in_favorites = false);
@@ -281,8 +281,8 @@ private:
void _update_folder_colors_setting();
void _resource_removed(const Ref<Resource> &p_resource);
- void _file_removed(String p_file);
- void _folder_removed(String p_folder);
+ void _file_removed(const String &p_file);
+ void _folder_removed(const String &p_folder);
void _resource_created();
void _make_scene_confirm();
@@ -313,7 +313,7 @@ private:
void _file_sort_popup(int p_id);
void _folder_color_index_pressed(int p_index, PopupMenu *p_menu);
- void _file_and_folders_fill_popup(PopupMenu *p_popup, Vector<String> p_paths, bool p_display_path_dependent_options = true);
+ void _file_and_folders_fill_popup(PopupMenu *p_popup, const Vector<String> &p_paths, bool p_display_path_dependent_options = true);
void _tree_rmb_select(const Vector2 &p_pos, MouseButton p_button);
void _file_list_item_clicked(int p_item, const Vector2 &p_pos, MouseButton p_mouse_button_index);
void _file_list_empty_clicked(const Vector2 &p_pos, MouseButton p_mouse_button_index);
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index c6087f5b13..6d690cf31b 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -55,7 +55,7 @@ inline void pop_back(T &container) {
container.resize(container.size() - 1);
}
-static bool find_next(const String &line, String pattern, int from, bool match_case, bool whole_words, int &out_begin, int &out_end) {
+static bool find_next(const String &line, const String &pattern, int from, bool match_case, bool whole_words, int &out_begin, int &out_end) {
int end = from;
while (true) {
@@ -84,7 +84,7 @@ static bool find_next(const String &line, String pattern, int from, bool match_c
//--------------------------------------------------------------------------------
-void FindInFiles::set_search_text(String p_pattern) {
+void FindInFiles::set_search_text(const String &p_pattern) {
_pattern = p_pattern;
}
@@ -96,7 +96,7 @@ void FindInFiles::set_match_case(bool p_match_case) {
_match_case = p_match_case;
}
-void FindInFiles::set_folder(String folder) {
+void FindInFiles::set_folder(const String &folder) {
_root_dir = folder;
}
@@ -213,7 +213,7 @@ float FindInFiles::get_progress() const {
return 0;
}
-void FindInFiles::_scan_dir(String path, PackedStringArray &out_folders, PackedStringArray &out_files_to_scan) {
+void FindInFiles::_scan_dir(const String &path, PackedStringArray &out_folders, PackedStringArray &out_files_to_scan) {
Ref<DirAccess> dir = DirAccess::open(path);
if (dir.is_null()) {
print_verbose("Cannot open directory! " + path);
@@ -258,7 +258,7 @@ void FindInFiles::_scan_dir(String path, PackedStringArray &out_folders, PackedS
}
}
-void FindInFiles::_scan_file(String fpath) {
+void FindInFiles::_scan_file(const String &fpath) {
Ref<FileAccess> f = FileAccess::open(fpath, FileAccess::READ);
if (f.is_null()) {
print_verbose(String("Cannot open file ") + fpath);
@@ -397,12 +397,12 @@ FindInFilesDialog::FindInFilesDialog() {
_mode = SEARCH_MODE;
}
-void FindInFilesDialog::set_search_text(String text) {
+void FindInFilesDialog::set_search_text(const String &text) {
_search_text_line_edit->set_text(text);
_on_search_text_modified(text);
}
-void FindInFilesDialog::set_replace_text(String text) {
+void FindInFilesDialog::set_replace_text(const String &text) {
_replace_text_line_edit->set_text(text);
}
@@ -505,7 +505,7 @@ void FindInFilesDialog::custom_action(const String &p_action) {
}
}
-void FindInFilesDialog::_on_search_text_modified(String text) {
+void FindInFilesDialog::_on_search_text_modified(const String &text) {
ERR_FAIL_NULL(_find_button);
ERR_FAIL_NULL(_replace_button);
@@ -513,7 +513,7 @@ void FindInFilesDialog::_on_search_text_modified(String text) {
_replace_button->set_disabled(get_search_text().is_empty());
}
-void FindInFilesDialog::_on_search_text_submitted(String text) {
+void FindInFilesDialog::_on_search_text_submitted(const String &text) {
// This allows to trigger a global search without leaving the keyboard.
if (!_find_button->is_disabled()) {
if (_mode == SEARCH_MODE) {
@@ -528,7 +528,7 @@ void FindInFilesDialog::_on_search_text_submitted(String text) {
}
}
-void FindInFilesDialog::_on_replace_text_submitted(String text) {
+void FindInFilesDialog::_on_replace_text_submitted(const String &text) {
// This allows to trigger a global search without leaving the keyboard.
if (!_replace_button->is_disabled()) {
if (_mode == REPLACE_MODE) {
@@ -653,7 +653,7 @@ void FindInFilesPanel::set_with_replace(bool with_replace) {
}
}
-void FindInFilesPanel::set_replace_text(String text) {
+void FindInFilesPanel::set_replace_text(const String &text) {
_replace_line_edit->set_text(text);
}
@@ -710,7 +710,7 @@ void FindInFilesPanel::_notification(int p_what) {
}
}
-void FindInFilesPanel::_on_result_found(String fpath, int line_number, int begin, int end, String text) {
+void FindInFilesPanel::_on_result_found(const String &fpath, int line_number, int begin, int end, String text) {
TreeItem *file_item;
HashMap<String, TreeItem *>::Iterator E = _file_items.find(fpath);
@@ -844,7 +844,7 @@ void FindInFilesPanel::_on_result_selected() {
emit_signal(SNAME(SIGNAL_RESULT_SELECTED), fpath, r.line_number, r.begin, r.end);
}
-void FindInFilesPanel::_on_replace_text_changed(String text) {
+void FindInFilesPanel::_on_replace_text_changed(const String &text) {
update_replace_buttons();
}
@@ -914,7 +914,7 @@ private:
Vector<char> _line_buffer;
};
-void FindInFilesPanel::apply_replaces_in_file(String fpath, const Vector<Result> &locations, String new_text) {
+void FindInFilesPanel::apply_replaces_in_file(const String &fpath, const Vector<Result> &locations, const String &new_text) {
// If the file is already open, I assume the editor will reload it.
// If there are unsaved changes, the user will be asked on focus,
// however that means either losing changes or losing replaces.
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index fcf5dd6281..7885931514 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -42,10 +42,10 @@ public:
static const char *SIGNAL_RESULT_FOUND;
static const char *SIGNAL_FINISHED;
- void set_search_text(String p_pattern);
+ void set_search_text(const String &p_pattern);
void set_whole_words(bool p_whole_word);
void set_match_case(bool p_match_case);
- void set_folder(String folder);
+ void set_folder(const String &folder);
void set_filter(const HashSet<String> &exts);
String get_search_text() const { return _pattern; }
@@ -67,8 +67,8 @@ protected:
private:
void _process();
void _iterate();
- void _scan_dir(String path, PackedStringArray &out_folders, PackedStringArray &out_files_to_scan);
- void _scan_file(String fpath);
+ void _scan_dir(const String &path, PackedStringArray &out_folders, PackedStringArray &out_files_to_scan);
+ void _scan_file(const String &fpath);
// Config
String _pattern;
@@ -105,8 +105,8 @@ public:
FindInFilesDialog();
- void set_search_text(String text);
- void set_replace_text(String text);
+ void set_search_text(const String &text);
+ void set_replace_text(const String &text);
void set_find_in_files_mode(FindInFilesMode p_mode);
@@ -127,9 +127,9 @@ protected:
private:
void _on_folder_button_pressed();
void _on_folder_selected(String path);
- void _on_search_text_modified(String text);
- void _on_search_text_submitted(String text);
- void _on_replace_text_submitted(String text);
+ void _on_search_text_modified(const String &text);
+ void _on_search_text_submitted(const String &text);
+ void _on_replace_text_submitted(const String &text);
FindInFilesMode _mode;
LineEdit *_search_text_line_edit = nullptr;
@@ -165,7 +165,7 @@ public:
FindInFiles *get_finder() const { return _finder; }
void set_with_replace(bool with_replace);
- void set_replace_text(String text);
+ void set_replace_text(const String &text);
void start_search();
void stop_search();
@@ -176,13 +176,13 @@ protected:
void _notification(int p_what);
private:
- void _on_result_found(String fpath, int line_number, int begin, int end, String text);
+ void _on_result_found(const String &fpath, int line_number, int begin, int end, String text);
void _on_finished();
void _on_refresh_button_clicked();
void _on_cancel_button_clicked();
void _on_result_selected();
void _on_item_edited();
- void _on_replace_text_changed(String text);
+ void _on_replace_text_changed(const String &text);
void _on_replace_all_clicked();
struct Result {
@@ -192,7 +192,7 @@ private:
int begin_trimmed = 0;
};
- void apply_replaces_in_file(String fpath, const Vector<Result> &locations, String new_text);
+ void apply_replaces_in_file(const String &fpath, const Vector<Result> &locations, const String &new_text);
void update_replace_buttons();
String get_replace_text();
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp
index 2dada25728..c7e991c353 100644
--- a/editor/gui/editor_file_dialog.cpp
+++ b/editor/gui/editor_file_dialog.cpp
@@ -287,7 +287,7 @@ void EditorFileDialog::update_dir() {
}
}
-void EditorFileDialog::_dir_submitted(String p_dir) {
+void EditorFileDialog::_dir_submitted(const String &p_dir) {
dir_access->change_dir(p_dir);
invalidate();
update_dir();
diff --git a/editor/gui/editor_file_dialog.h b/editor/gui/editor_file_dialog.h
index e0f53ace96..a9073e6f4a 100644
--- a/editor/gui/editor_file_dialog.h
+++ b/editor/gui/editor_file_dialog.h
@@ -199,7 +199,7 @@ private:
void _item_menu_id_pressed(int p_option);
void _select_drive(int p_idx);
- void _dir_submitted(String p_dir);
+ void _dir_submitted(const String &p_dir);
void _action_pressed();
void _save_confirm_pressed();
void _cancel_pressed();
diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp
index 69a129e73c..970bf4cb3e 100644
--- a/editor/gui/editor_toaster.cpp
+++ b/editor/gui/editor_toaster.cpp
@@ -342,7 +342,7 @@ void EditorToaster::_repop_old() {
}
}
-Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_time, String p_tooltip) {
+Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_time, const String &p_tooltip) {
// Create the panel according to the severity.
PanelContainer *panel = memnew(PanelContainer);
panel->set_tooltip_text(p_tooltip);
@@ -398,7 +398,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
return panel;
}
-void EditorToaster::popup_str(String p_message, Severity p_severity, String p_tooltip) {
+void EditorToaster::popup_str(const String &p_message, Severity p_severity, const String &p_tooltip) {
if (is_processing_error) {
return;
}
@@ -410,7 +410,7 @@ void EditorToaster::popup_str(String p_message, Severity p_severity, String p_to
is_processing_error = false;
}
-void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_tooltip) {
+void EditorToaster::_popup_str(const String &p_message, Severity p_severity, const String &p_tooltip) {
is_processing_error = true;
// Check if we already have a popup with the given message.
Control *control = nullptr;
diff --git a/editor/gui/editor_toaster.h b/editor/gui/editor_toaster.h
index 5034cb66fc..4bf32d94ba 100644
--- a/editor/gui/editor_toaster.h
+++ b/editor/gui/editor_toaster.h
@@ -100,7 +100,7 @@ private:
void _set_notifications_enabled(bool p_enabled);
void _repop_old();
- void _popup_str(String p_message, Severity p_severity, String p_tooltip);
+ void _popup_str(const String &p_message, Severity p_severity, const String &p_tooltip);
void _close_button_theme_changed(Control *p_close_button);
protected:
@@ -111,8 +111,8 @@ protected:
public:
static EditorToaster *get_singleton();
- Control *popup(Control *p_control, Severity p_severity = SEVERITY_INFO, double p_time = 0.0, String p_tooltip = String());
- void popup_str(String p_message, Severity p_severity = SEVERITY_INFO, String p_tooltip = String());
+ Control *popup(Control *p_control, Severity p_severity = SEVERITY_INFO, double p_time = 0.0, const String &p_tooltip = String());
+ void popup_str(const String &p_message, Severity p_severity = SEVERITY_INFO, const String &p_tooltip = String());
void close(Control *p_control);
EditorToaster();
diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp
index 14af49aabf..766566bf2b 100644
--- a/editor/gui/scene_tree_editor.cpp
+++ b/editor/gui/scene_tree_editor.cpp
@@ -750,7 +750,7 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select
return p_parent->is_visible();
}
-bool SceneTreeEditor::_item_matches_all_terms(TreeItem *p_item, PackedStringArray p_terms) {
+bool SceneTreeEditor::_item_matches_all_terms(TreeItem *p_item, const PackedStringArray &p_terms) {
if (p_terms.is_empty()) {
return true;
}
@@ -767,7 +767,7 @@ bool SceneTreeEditor::_item_matches_all_terms(TreeItem *p_item, PackedStringArra
// Filter by Type.
String type = get_node(p_item->get_metadata(0))->get_class();
bool term_in_inherited_class = false;
- // Every Node is is a Node, duh!
+ // Every Node is a Node, duh!
while (type != "Node") {
if (type.to_lower().contains(argument)) {
term_in_inherited_class = true;
diff --git a/editor/gui/scene_tree_editor.h b/editor/gui/scene_tree_editor.h
index 179050daeb..fe2396d438 100644
--- a/editor/gui/scene_tree_editor.h
+++ b/editor/gui/scene_tree_editor.h
@@ -79,7 +79,7 @@ class SceneTreeEditor : public Control {
void _add_nodes(Node *p_node, TreeItem *p_parent);
void _test_update_tree();
bool _update_filter(TreeItem *p_parent = nullptr, bool p_scroll_to_selected = false);
- bool _item_matches_all_terms(TreeItem *p_item, PackedStringArray p_terms);
+ bool _item_matches_all_terms(TreeItem *p_item, const PackedStringArray &p_terms);
void _tree_changed();
void _tree_process_mode_changed();
void _node_removed(Node *p_node);
diff --git a/editor/import/3d/collada.cpp b/editor/import/3d/collada.cpp
index d484476b35..29c373be96 100644
--- a/editor/import/3d/collada.cpp
+++ b/editor/import/3d/collada.cpp
@@ -834,7 +834,7 @@ void Collada::_parse_light(XMLParser &p_parser) {
COLLADA_PRINT("Light ID:" + id);
}
-void Collada::_parse_curve_geometry(XMLParser &p_parser, String p_id, String p_name) {
+void Collada::_parse_curve_geometry(XMLParser &p_parser, const String &p_id, const String &p_name) {
if (!(state.import_flags & IMPORT_FLAG_SCENE)) {
if (!p_parser.is_empty()) {
p_parser.skip_section();
@@ -916,7 +916,7 @@ void Collada::_parse_curve_geometry(XMLParser &p_parser, String p_id, String p_n
}
}
-void Collada::_parse_mesh_geometry(XMLParser &p_parser, String p_id, String p_name) {
+void Collada::_parse_mesh_geometry(XMLParser &p_parser, const String &p_id, const String &p_name) {
if (!(state.import_flags & IMPORT_FLAG_SCENE)) {
if (!p_parser.is_empty()) {
p_parser.skip_section();
@@ -1070,7 +1070,7 @@ void Collada::_parse_mesh_geometry(XMLParser &p_parser, String p_id, String p_na
}
}
-void Collada::_parse_skin_controller(XMLParser &p_parser, String p_id) {
+void Collada::_parse_skin_controller(XMLParser &p_parser, const String &p_id) {
state.skin_controller_data_map[p_id] = SkinControllerData();
SkinControllerData &skindata = state.skin_controller_data_map[p_id];
@@ -1224,7 +1224,7 @@ void Collada::_parse_skin_controller(XMLParser &p_parser, String p_id) {
}
}
-void Collada::_parse_morph_controller(XMLParser &p_parser, String p_id) {
+void Collada::_parse_morph_controller(XMLParser &p_parser, const String &p_id) {
state.morph_controller_data_map[p_id] = MorphControllerData();
MorphControllerData &morphdata = state.morph_controller_data_map[p_id];
@@ -2311,7 +2311,7 @@ void Collada::_optimize() {
}
}
-int Collada::get_uv_channel(String p_name) {
+int Collada::get_uv_channel(const String &p_name) {
if (!channel_map.has(p_name)) {
ERR_FAIL_COND_V(channel_map.size() == 2, 0);
diff --git a/editor/import/3d/collada.h b/editor/import/3d/collada.h
index 7877b1e86d..416b917a46 100644
--- a/editor/import/3d/collada.h
+++ b/editor/import/3d/collada.h
@@ -521,7 +521,7 @@ public:
Transform3D get_root_transform() const;
- int get_uv_channel(String p_name);
+ int get_uv_channel(const String &p_name);
private: // private stuff
HashMap<String, int> channel_map;
@@ -535,11 +535,11 @@ private: // private stuff
void _parse_light(XMLParser &p_parser);
void _parse_animation_clip(XMLParser &p_parser);
- void _parse_mesh_geometry(XMLParser &p_parser, String p_id, String p_name);
- void _parse_curve_geometry(XMLParser &p_parser, String p_id, String p_name);
+ void _parse_mesh_geometry(XMLParser &p_parser, const String &p_id, const String &p_name);
+ void _parse_curve_geometry(XMLParser &p_parser, const String &p_id, const String &p_name);
- void _parse_skin_controller(XMLParser &p_parser, String p_id);
- void _parse_morph_controller(XMLParser &p_parser, String p_id);
+ void _parse_skin_controller(XMLParser &p_parser, const String &p_id);
+ void _parse_morph_controller(XMLParser &p_parser, const String &p_id);
void _parse_controller(XMLParser &p_parser);
Node *_parse_visual_instance_geometry(XMLParser &p_parser);
diff --git a/editor/import/3d/editor_import_collada.cpp b/editor/import/3d/editor_import_collada.cpp
index 49fec679bf..58aa6a462d 100644
--- a/editor/import/3d/editor_import_collada.cpp
+++ b/editor/import/3d/editor_import_collada.cpp
@@ -41,8 +41,8 @@
#include "scene/3d/path_3d.h"
#include "scene/3d/skeleton_3d.h"
#include "scene/animation/animation_player.h"
+#include "scene/resources/3d/importer_mesh.h"
#include "scene/resources/animation.h"
-#include "scene/resources/importer_mesh.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/surface_tool.h"
@@ -88,7 +88,7 @@ struct ColladaImport {
Error _create_scene(Collada::Node *p_node, Node3D *p_parent);
Error _create_resources(Collada::Node *p_node, bool p_use_compression);
Error _create_material(const String &p_target);
- Error _create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p_mesh, const HashMap<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform3D &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ImporterMesh>> p_morph_meshes = Vector<Ref<ImporterMesh>>(), bool p_use_compression = false, bool p_use_mesh_material = false);
+ Error _create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p_mesh, const HashMap<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform3D &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, const Vector<Ref<ImporterMesh>> &p_morph_meshes = Vector<Ref<ImporterMesh>>(), bool p_use_compression = false, bool p_use_mesh_material = false);
Error load(const String &p_path, int p_flags, bool p_force_make_tangents = false, bool p_use_compression = false);
void _fix_param_animation_tracks();
void create_animation(int p_clip, bool p_import_value_tracks);
@@ -467,7 +467,7 @@ Error ColladaImport::_create_material(const String &p_target) {
return OK;
}
-Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p_mesh, const HashMap<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform3D &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ImporterMesh>> p_morph_meshes, bool p_use_compression, bool p_use_mesh_material) {
+Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p_mesh, const HashMap<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform3D &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, const Vector<Ref<ImporterMesh>> &p_morph_meshes, bool p_use_compression, bool p_use_mesh_material) {
bool local_xform_mirror = p_local_xform.basis.determinant() < 0;
if (p_morph_data) {
@@ -938,11 +938,11 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p
if (binormal_src && tangent_src) {
surftool->set_tangent(vertex_array[k].tangent);
} else if (generate_dummy_tangents) {
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(vertex_array[k].normal);
+ Vector3 tan = Vector3(vertex_array[k].normal.z, -vertex_array[k].normal.x, vertex_array[k].normal.y).cross(vertex_array[k].normal.normalized()).normalized();
surftool->set_tangent(Plane(tan.x, tan.y, tan.z, 1.0));
}
} else {
- // No normals, use a dummy normal since normals will be generated.
+ // No normals, use a dummy tangent since normals will be generated.
if (generate_dummy_tangents) {
surftool->set_tangent(Plane(1.0, 0.0, 0.0, 1.0));
}
@@ -1008,6 +1008,19 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ImporterMesh> &p
Array d = surftool->commit_to_arrays();
d.resize(RS::ARRAY_MAX);
+ if (mesh_flags & RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES && (generate_dummy_tangents || generate_tangents)) {
+ // Compression is enabled, so let's validate that the normals and tangents are correct.
+ Vector<Vector3> normals = d[Mesh::ARRAY_NORMAL];
+ Vector<float> tangents = d[Mesh::ARRAY_TANGENT];
+ for (int vert = 0; vert < normals.size(); vert++) {
+ Vector3 tan = Vector3(tangents[vert * 4 + 0], tangents[vert * 4 + 1], tangents[vert * 4 + 2]);
+ if (abs(tan.dot(normals[vert])) > 0.0001) {
+ // Tangent is not perpendicular to the normal, so we can't use compression.
+ mesh_flags &= ~RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES;
+ }
+ }
+ }
+
Array mr;
////////////////////////////
diff --git a/editor/import/3d/resource_importer_obj.cpp b/editor/import/3d/resource_importer_obj.cpp
index 4b340ea997..62643eaa25 100644
--- a/editor/import/3d/resource_importer_obj.cpp
+++ b/editor/import/3d/resource_importer_obj.cpp
@@ -35,7 +35,7 @@
#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/node_3d.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
@@ -329,11 +329,11 @@ static Error _parse_obj(const String &p_path, List<Ref<ImporterMesh>> &r_meshes,
surf_tool->set_normal(normals[norm]);
if (generate_tangents && uvs.is_empty()) {
// We can't generate tangents without UVs, so create dummy tangents.
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(normals[norm]);
+ Vector3 tan = Vector3(normals[norm].z, -normals[norm].x, normals[norm].y).cross(normals[norm].normalized()).normalized();
surf_tool->set_tangent(Plane(tan.x, tan.y, tan.z, 1.0));
}
} else {
- // No normals, use a dummy normal since normals will be generated.
+ // No normals, use a dummy tangent since normals and tangents will be generated.
if (generate_tangents && uvs.is_empty()) {
// We can't generate tangents without UVs, so create dummy tangents.
surf_tool->set_tangent(Plane(1.0, 0.0, 0.0, 1.0));
@@ -415,6 +415,20 @@ static Error _parse_obj(const String &p_path, List<Ref<ImporterMesh>> &r_meshes,
mesh->set_surface_name(mesh->get_surface_count() - 1, current_group);
}
Array array = surf_tool->commit_to_arrays();
+
+ if (mesh_flags & RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES && generate_tangents) {
+ // Compression is enabled, so let's validate that the normals and tangents are correct.
+ Vector<Vector3> norms = array[Mesh::ARRAY_NORMAL];
+ Vector<float> tangents = array[Mesh::ARRAY_TANGENT];
+ for (int vert = 0; vert < norms.size(); vert++) {
+ Vector3 tan = Vector3(tangents[vert * 4 + 0], tangents[vert * 4 + 1], tangents[vert * 4 + 2]);
+ if (abs(tan.dot(norms[vert])) > 0.0001) {
+ // Tangent is not perpendicular to the normal, so we can't use compression.
+ mesh_flags &= ~RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES;
+ }
+ }
+ }
+
mesh->add_surface(Mesh::PRIMITIVE_TRIANGLES, array, TypedArray<Array>(), Dictionary(), material, name, mesh_flags);
print_verbose("OBJ: Added surface :" + mesh->get_surface_name(mesh->get_surface_count() - 1));
diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp
index b7b82f5f76..38977d11e0 100644
--- a/editor/import/3d/resource_importer_scene.cpp
+++ b/editor/import/3d/resource_importer_scene.cpp
@@ -46,15 +46,15 @@
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/vehicle_body_3d.h"
#include "scene/animation/animation_player.h"
+#include "scene/resources/3d/box_shape_3d.h"
+#include "scene/resources/3d/importer_mesh.h"
+#include "scene/resources/3d/separation_ray_shape_3d.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
+#include "scene/resources/3d/world_boundary_shape_3d.h"
#include "scene/resources/animation.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/importer_mesh.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/resource_format_text.h"
-#include "scene/resources/separation_ray_shape_3d.h"
-#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/surface_tool.h"
-#include "scene/resources/world_boundary_shape_3d.h"
uint32_t EditorSceneFormatImporter::get_import_flags() const {
uint32_t ret;
@@ -156,11 +156,11 @@ Variant EditorScenePostImportPlugin::get_option_value(const StringName &p_name)
}
return Variant();
}
-void EditorScenePostImportPlugin::add_import_option(const String &p_name, Variant p_default_value) {
+void EditorScenePostImportPlugin::add_import_option(const String &p_name, const Variant &p_default_value) {
ERR_FAIL_NULL_MSG(current_option_list, "add_import_option() can only be called from get_import_options().");
add_import_option_advanced(p_default_value.get_type(), p_name, p_default_value);
}
-void EditorScenePostImportPlugin::add_import_option_advanced(Variant::Type p_type, const String &p_name, Variant p_default_value, PropertyHint p_hint, const String &p_hint_string, int p_usage_flags) {
+void EditorScenePostImportPlugin::add_import_option_advanced(Variant::Type p_type, const String &p_name, const Variant &p_default_value, PropertyHint p_hint, const String &p_hint_string, int p_usage_flags) {
ERR_FAIL_NULL_MSG(current_option_list, "add_import_option_advanced() can only be called from get_import_options().");
current_option_list->push_back(ResourceImporter::ImportOption(PropertyInfo(p_type, p_name, p_hint, p_hint_string, p_usage_flags), p_default_value));
}
@@ -1445,7 +1445,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap<
return p_node;
}
-Ref<Animation> ResourceImporterScene::_save_animation_to_file(Ref<Animation> anim, bool p_save_to_file, String p_save_to_path, bool p_keep_custom_tracks) {
+Ref<Animation> ResourceImporterScene::_save_animation_to_file(Ref<Animation> anim, bool p_save_to_file, const String &p_save_to_path, bool p_keep_custom_tracks) {
if (!p_save_to_file || !p_save_to_path.is_resource_file()) {
return anim;
}
diff --git a/editor/import/3d/resource_importer_scene.h b/editor/import/3d/resource_importer_scene.h
index f82a5aa9e9..2e682350bc 100644
--- a/editor/import/3d/resource_importer_scene.h
+++ b/editor/import/3d/resource_importer_scene.h
@@ -35,14 +35,14 @@
#include "core/io/resource_importer.h"
#include "core/variant/dictionary.h"
#include "scene/3d/importer_mesh_instance_3d.h"
+#include "scene/resources/3d/box_shape_3d.h"
+#include "scene/resources/3d/capsule_shape_3d.h"
+#include "scene/resources/3d/cylinder_shape_3d.h"
+#include "scene/resources/3d/importer_mesh.h"
+#include "scene/resources/3d/skin.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
#include "scene/resources/animation.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/capsule_shape_3d.h"
-#include "scene/resources/cylinder_shape_3d.h"
-#include "scene/resources/importer_mesh.h"
#include "scene/resources/mesh.h"
-#include "scene/resources/shape_3d.h"
-#include "scene/resources/sphere_shape_3d.h"
class Material;
class AnimationPlayer;
@@ -54,8 +54,8 @@ class EditorSceneFormatImporter : public RefCounted {
protected:
static void _bind_methods();
- Node *import_scene_wrapper(const String &p_path, uint32_t p_flags, Dictionary p_options);
- Ref<Animation> import_animation_wrapper(const String &p_path, uint32_t p_flags, Dictionary p_options);
+ Node *import_scene_wrapper(const String &p_path, uint32_t p_flags, const Dictionary &p_options);
+ Ref<Animation> import_animation_wrapper(const String &p_path, uint32_t p_flags, const Dictionary &p_options);
GDVIRTUAL0RC(uint32_t, _get_import_flags)
GDVIRTUAL0RC(Vector<String>, _get_extensions)
@@ -136,8 +136,8 @@ protected:
public:
Variant get_option_value(const StringName &p_name) const;
- void add_import_option(const String &p_name, Variant p_default_value);
- void add_import_option_advanced(Variant::Type p_type, const String &p_name, Variant p_default_value, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = String(), int p_usage_flags = PROPERTY_USAGE_DEFAULT);
+ void add_import_option(const String &p_name, const Variant &p_default_value);
+ void add_import_option_advanced(Variant::Type p_type, const String &p_name, const Variant &p_default_value, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = String(), int p_usage_flags = PROPERTY_USAGE_DEFAULT);
virtual void get_internal_import_options(InternalImportCategory p_category, List<ResourceImporter::ImportOption> *r_options);
virtual Variant get_internal_option_visibility(InternalImportCategory p_category, bool p_for_animation, const String &p_option, const HashMap<StringName, Variant> &p_options) const;
@@ -287,7 +287,7 @@ public:
Node *_post_fix_node(Node *p_node, Node *p_root, HashMap<Ref<ImporterMesh>, Vector<Ref<Shape3D>>> &collision_map, Pair<PackedVector3Array, PackedInt32Array> &r_occluder_arrays, HashSet<Ref<ImporterMesh>> &r_scanned_meshes, const Dictionary &p_node_data, const Dictionary &p_material_data, const Dictionary &p_animation_data, float p_animation_fps, float p_applied_root_scale);
Node *_post_fix_animations(Node *p_node, Node *p_root, const Dictionary &p_node_data, const Dictionary &p_animation_data, float p_animation_fps);
- Ref<Animation> _save_animation_to_file(Ref<Animation> anim, bool p_save_to_file, String p_save_to_path, bool p_keep_custom_tracks);
+ Ref<Animation> _save_animation_to_file(Ref<Animation> anim, bool p_save_to_file, const String &p_save_to_path, bool p_keep_custom_tracks);
void _create_slices(AnimationPlayer *ap, Ref<Animation> anim, const Array &p_clips, bool p_bake_all);
void _optimize_animations(AnimationPlayer *anim, float p_max_vel_error, float p_max_ang_error, int p_prc_error);
void _compress_animations(AnimationPlayer *anim, int p_page_size_kb);
diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp
index b270424513..f0de608cf5 100644
--- a/editor/import/3d/scene_import_settings.cpp
+++ b/editor/import/3d/scene_import_settings.cpp
@@ -40,7 +40,7 @@
#include "editor/themes/editor_scale.h"
#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/animation/animation_player.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
#include "scene/resources/surface_tool.h"
class SceneImportSettingsData : public Object {
@@ -709,7 +709,7 @@ Node *SceneImportSettingsDialog::get_selected_node() {
return node_map[selected_id].node;
}
-void SceneImportSettingsDialog::_select(Tree *p_from, String p_type, String p_id) {
+void SceneImportSettingsDialog::_select(Tree *p_from, const String &p_type, const String &p_id) {
selecting = true;
scene_import_settings_data->hide_options = false;
diff --git a/editor/import/3d/scene_import_settings.h b/editor/import/3d/scene_import_settings.h
index db3a2229f4..e1183dc5b0 100644
--- a/editor/import/3d/scene_import_settings.h
+++ b/editor/import/3d/scene_import_settings.h
@@ -46,7 +46,7 @@
#include "scene/gui/subviewport_container.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/tree.h"
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/primitive_meshes.h"
class EditorFileDialog;
class EditorInspector;
@@ -163,7 +163,7 @@ class SceneImportSettingsDialog : public ConfirmationDialog {
void _update_view_gizmos();
void _update_camera();
- void _select(Tree *p_from, String p_type, String p_id);
+ void _select(Tree *p_from, const String &p_type, const String &p_id);
void _inspector_property_edited(const String &p_name);
void _reset_bone_transforms();
void _play_animation();
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 8a7eb80281..78ceb2ef6d 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -244,7 +244,7 @@ void InspectorDock::_load_resource(const String &p_type) {
load_resource_dialog->popup_file_dialog();
}
-void InspectorDock::_resource_file_selected(String p_file) {
+void InspectorDock::_resource_file_selected(const String &p_file) {
Ref<Resource> res;
if (ResourceLoader::exists(p_file, "")) {
res = ResourceLoader::load(p_file);
diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h
index 1ad4b52b7d..60ce8100aa 100644
--- a/editor/inspector_dock.h
+++ b/editor/inspector_dock.h
@@ -114,7 +114,7 @@ class InspectorDock : public VBoxContainer {
void _new_resource();
void _load_resource(const String &p_type = "");
void _open_resource_selector() { _load_resource(); }; // just used to call from arg-less signal
- void _resource_file_selected(String p_file);
+ void _resource_file_selected(const String &p_file);
void _save_resource(bool save_as);
void _unref_resource();
void _copy_resource();
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 2c86314ae2..e7a1d2735e 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -233,7 +233,7 @@ void AbstractPolygon2DEditor::_wip_close() {
selected_point = Vertex();
}
-void AbstractPolygon2DEditor::disable_polygon_editing(bool p_disable, String p_reason) {
+void AbstractPolygon2DEditor::disable_polygon_editing(bool p_disable, const String &p_reason) {
_polygon_editing_enabled = !p_disable;
button_create->set_disabled(p_disable);
@@ -766,7 +766,7 @@ void AbstractPolygon2DEditorPlugin::make_visible(bool p_visible) {
}
}
-AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(AbstractPolygon2DEditor *p_polygon_editor, String p_class) :
+AbstractPolygon2DEditorPlugin::AbstractPolygon2DEditorPlugin(AbstractPolygon2DEditor *p_polygon_editor, const String &p_class) :
polygon_editor(p_polygon_editor),
klass(p_class) {
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(polygon_editor);
diff --git a/editor/plugins/abstract_polygon_2d_editor.h b/editor/plugins/abstract_polygon_2d_editor.h
index 31c20ac146..25b2e2603e 100644
--- a/editor/plugins/abstract_polygon_2d_editor.h
+++ b/editor/plugins/abstract_polygon_2d_editor.h
@@ -137,7 +137,7 @@ protected:
virtual void _create_resource();
public:
- void disable_polygon_editing(bool p_disable, String p_reason);
+ void disable_polygon_editing(bool p_disable, const String &p_reason);
bool forward_gui_input(const Ref<InputEvent> &p_event);
void forward_canvas_draw_over_viewport(Control *p_overlay);
@@ -162,7 +162,7 @@ public:
virtual bool handles(Object *p_object) const override;
virtual void make_visible(bool p_visible) override;
- AbstractPolygon2DEditorPlugin(AbstractPolygon2DEditor *p_polygon_editor, String p_class);
+ AbstractPolygon2DEditorPlugin(AbstractPolygon2DEditor *p_polygon_editor, const String &p_class);
~AbstractPolygon2DEditorPlugin();
};
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 22813124d0..0412141775 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -494,7 +494,7 @@ void AnimationNodeBlendTreeEditor::_disconnection_request(const String &p_from,
updating = false;
}
-void AnimationNodeBlendTreeEditor::_anim_selected(int p_index, Array p_options, const String &p_node) {
+void AnimationNodeBlendTreeEditor::_anim_selected(int p_index, const Array &p_options, const String &p_node) {
String option = p_options[p_index];
Ref<AnimationNodeAnimation> anim = blend_tree->get_node(p_node);
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.h b/editor/plugins/animation_blend_tree_editor_plugin.h
index 690b127938..ee6f087e07 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.h
+++ b/editor/plugins/animation_blend_tree_editor_plugin.h
@@ -111,7 +111,7 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
void _scroll_changed(const Vector2 &p_scroll);
void _node_selected(Object *p_node);
void _open_in_editor(const String &p_which);
- void _anim_selected(int p_index, Array p_options, const String &p_node);
+ void _anim_selected(int p_index, const Array &p_options, const String &p_node);
void _delete_node_request(const String &p_which);
void _delete_nodes_request(const TypedArray<StringName> &p_nodes);
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp
index 58b1dbde8a..2af3811863 100644
--- a/editor/plugins/animation_library_editor.cpp
+++ b/editor/plugins/animation_library_editor.cpp
@@ -300,7 +300,7 @@ void AnimationLibraryEditor::_file_popup_selected(int p_id) {
}
}
-void AnimationLibraryEditor::_load_file(String p_path) {
+void AnimationLibraryEditor::_load_file(const String &p_path) {
switch (file_dialog_action) {
case FILE_DIALOG_ACTION_SAVE_LIBRARY: {
Ref<AnimationLibrary> al = mixer->get_animation_library(file_dialog_library);
diff --git a/editor/plugins/animation_library_editor.h b/editor/plugins/animation_library_editor.h
index c003e9a10b..a268e68932 100644
--- a/editor/plugins/animation_library_editor.h
+++ b/editor/plugins/animation_library_editor.h
@@ -100,7 +100,7 @@ class AnimationLibraryEditor : public AcceptDialog {
void _add_library_validate(const String &p_name);
void _add_library_confirm();
void _load_library();
- void _load_file(String p_path);
+ void _load_file(const String &p_path);
void _load_files(const PackedStringArray &p_paths);
void _item_renamed();
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 6b8943ee84..dbfb143b22 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1184,7 +1184,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
state_machine_play_pos->queue_redraw();
}
-void AnimationNodeStateMachineEditor::_state_machine_pos_draw_individual(String p_name, float p_ratio) {
+void AnimationNodeStateMachineEditor::_state_machine_pos_draw_individual(const String &p_name, float p_ratio) {
AnimationTree *tree = AnimationTreeEditor::get_singleton()->get_animation_tree();
if (!tree) {
return;
diff --git a/editor/plugins/animation_state_machine_editor.h b/editor/plugins/animation_state_machine_editor.h
index 949fa84bce..860d0ed35d 100644
--- a/editor/plugins/animation_state_machine_editor.h
+++ b/editor/plugins/animation_state_machine_editor.h
@@ -134,7 +134,7 @@ class AnimationNodeStateMachineEditor : public AnimationTreeNodeEditorPlugin {
void _state_machine_draw();
- void _state_machine_pos_draw_individual(String p_name, float p_ratio);
+ void _state_machine_pos_draw_individual(const String &p_name, float p_ratio);
void _state_machine_pos_draw_all();
void _update_graph();
diff --git a/editor/plugins/audio_stream_randomizer_editor_plugin.cpp b/editor/plugins/audio_stream_randomizer_editor_plugin.cpp
index e2ad69ac15..9c76b86d6a 100644
--- a/editor/plugins/audio_stream_randomizer_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_randomizer_editor_plugin.cpp
@@ -43,7 +43,7 @@ bool AudioStreamRandomizerEditorPlugin::handles(Object *p_object) const {
void AudioStreamRandomizerEditorPlugin::make_visible(bool p_visible) {
}
-void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos) {
+void AudioStreamRandomizerEditorPlugin::_move_stream_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos) {
EditorUndoRedoManager *undo_redo_man = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo_man);
diff --git a/editor/plugins/audio_stream_randomizer_editor_plugin.h b/editor/plugins/audio_stream_randomizer_editor_plugin.h
index 72cdaeee30..535ab4114b 100644
--- a/editor/plugins/audio_stream_randomizer_editor_plugin.h
+++ b/editor/plugins/audio_stream_randomizer_editor_plugin.h
@@ -38,7 +38,7 @@ class AudioStreamRandomizerEditorPlugin : public EditorPlugin {
GDCLASS(AudioStreamRandomizerEditorPlugin, EditorPlugin);
private:
- void _move_stream_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos);
+ void _move_stream_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos);
public:
virtual String get_name() const override { return "AudioStreamRandomizer"; }
diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp
index 3256b90aba..d8c020eb29 100644
--- a/editor/plugins/bone_map_editor_plugin.cpp
+++ b/editor/plugins/bone_map_editor_plugin.cpp
@@ -136,7 +136,7 @@ void BoneMapperItem::_open_picker() {
emit_signal(SNAME("pick"), profile_bone_name);
}
-void BoneMapperItem::_value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void BoneMapperItem::_value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
bone_map->set(p_property, p_value);
}
@@ -534,12 +534,12 @@ void BoneMapper::_clear_mapping_current_group() {
}
#ifdef MODULE_REGEX_ENABLED
-bool BoneMapper::is_match_with_bone_name(String p_bone_name, String p_word) {
+bool BoneMapper::is_match_with_bone_name(const String &p_bone_name, const String &p_word) {
RegEx re = RegEx(p_word);
return !re.search(p_bone_name.to_lower()).is_null();
}
-int BoneMapper::search_bone_by_name(Skeleton3D *p_skeleton, Vector<String> p_picklist, BoneSegregation p_segregation, int p_parent, int p_child, int p_children_count) {
+int BoneMapper::search_bone_by_name(Skeleton3D *p_skeleton, const Vector<String> &p_picklist, BoneSegregation p_segregation, int p_parent, int p_child, int p_children_count) {
// There may be multiple candidates hit by existing the subsidiary bone.
// The one with the shortest name is probably the original.
LocalVector<String> hit_list;
@@ -617,7 +617,7 @@ int BoneMapper::search_bone_by_name(Skeleton3D *p_skeleton, Vector<String> p_pic
return skeleton->find_bone(shortest);
}
-BoneMapper::BoneSegregation BoneMapper::guess_bone_segregation(String p_bone_name) {
+BoneMapper::BoneSegregation BoneMapper::guess_bone_segregation(const String &p_bone_name) {
String fixed_bn = p_bone_name.to_snake_case();
LocalVector<String> left_words;
@@ -1279,12 +1279,12 @@ void BoneMapper::auto_mapping_process(Ref<BoneMap> &p_bone_map) {
}
#endif // MODULE_REGEX_ENABLED
-void BoneMapper::_value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void BoneMapper::_value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
set(p_property, p_value);
recreate_editor();
}
-void BoneMapper::_profile_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void BoneMapper::_profile_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
bone_map->set(p_property, p_value);
// Run auto mapping when setting SkeletonProfileHumanoid by GUI Editor.
diff --git a/editor/plugins/bone_map_editor_plugin.h b/editor/plugins/bone_map_editor_plugin.h
index 9479ed3730..2e7d1ff124 100644
--- a/editor/plugins/bone_map_editor_plugin.h
+++ b/editor/plugins/bone_map_editor_plugin.h
@@ -99,7 +99,7 @@ class BoneMapperItem : public VBoxContainer {
protected:
void _notification(int p_what);
static void _bind_methods();
- virtual void _value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing);
+ virtual void _value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing);
virtual void create_editor();
public:
@@ -179,9 +179,9 @@ class BoneMapper : public VBoxContainer {
BONE_SEGREGATION_LEFT,
BONE_SEGREGATION_RIGHT
};
- bool is_match_with_bone_name(String p_bone_name, String p_word);
- int search_bone_by_name(Skeleton3D *p_skeleton, Vector<String> p_picklist, BoneSegregation p_segregation = BONE_SEGREGATION_NONE, int p_parent = -1, int p_child = -1, int p_children_count = -1);
- BoneSegregation guess_bone_segregation(String p_bone_name);
+ bool is_match_with_bone_name(const String &p_bone_name, const String &p_word);
+ int search_bone_by_name(Skeleton3D *p_skeleton, const Vector<String> &p_picklist, BoneSegregation p_segregation = BONE_SEGREGATION_NONE, int p_parent = -1, int p_child = -1, int p_children_count = -1);
+ BoneSegregation guess_bone_segregation(const String &p_bone_name);
void auto_mapping_process(Ref<BoneMap> &p_bone_map);
void _run_auto_mapping();
#endif // MODULE_REGEX_ENABLED
@@ -189,8 +189,8 @@ class BoneMapper : public VBoxContainer {
protected:
void _notification(int p_what);
static void _bind_methods();
- virtual void _value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing);
- virtual void _profile_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing);
+ virtual void _value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing);
+ virtual void _profile_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing);
public:
void set_current_group_idx(int p_group_idx);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 3bcc316f84..7181c93ee0 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -861,7 +861,7 @@ void CanvasItemEditor::_restore_canvas_item_state(const List<CanvasItem *> &p_ca
}
}
-void CanvasItemEditor::_commit_canvas_item_state(const List<CanvasItem *> &p_canvas_items, String action_name, bool commit_bones) {
+void CanvasItemEditor::_commit_canvas_item_state(const List<CanvasItem *> &p_canvas_items, const String &action_name, bool commit_bones) {
List<CanvasItem *> modified_canvas_items;
for (CanvasItem *ci : p_canvas_items) {
Dictionary old_state = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci)->undo_state;
@@ -2708,7 +2708,7 @@ Control::CursorShape CanvasItemEditor::get_cursor_shape(const Point2 &p_pos) con
return c;
}
-void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string, Side p_side) {
+void CanvasItemEditor::_draw_text_at_position(Point2 p_position, const String &p_string, Side p_side) {
Color color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
color.a = 0.8;
Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index bf36b6ec1d..f85f1aef66 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -394,7 +394,7 @@ private:
void _save_canvas_item_state(const List<CanvasItem *> &p_canvas_items, bool save_bones = false);
void _restore_canvas_item_state(const List<CanvasItem *> &p_canvas_items, bool restore_bones = false);
- void _commit_canvas_item_state(const List<CanvasItem *> &p_canvas_items, String action_name, bool commit_bones = false);
+ void _commit_canvas_item_state(const List<CanvasItem *> &p_canvas_items, const String &action_name, bool commit_bones = false);
Vector2 _anchor_to_position(const Control *p_control, Vector2 anchor);
Vector2 _position_to_anchor(const Control *p_control, Vector2 position);
@@ -440,7 +440,7 @@ private:
virtual void shortcut_input(const Ref<InputEvent> &p_ev) override;
- void _draw_text_at_position(Point2 p_position, String p_string, Side p_side);
+ void _draw_text_at_position(Point2 p_position, const String &p_string, Side p_side);
void _draw_margin_at_position(int p_value, Point2 p_position, Side p_side);
void _draw_percentage_at_position(real_t p_value, Point2 p_position, Side p_side);
void _draw_straight_line(Point2 p_from, Point2 p_to, Color p_color);
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index 3191858657..12dde46193 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -35,14 +35,14 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_undo_redo_manager.h"
-#include "scene/resources/capsule_shape_2d.h"
-#include "scene/resources/circle_shape_2d.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
-#include "scene/resources/rectangle_shape_2d.h"
-#include "scene/resources/segment_shape_2d.h"
-#include "scene/resources/separation_ray_shape_2d.h"
-#include "scene/resources/world_boundary_shape_2d.h"
+#include "scene/resources/2d/capsule_shape_2d.h"
+#include "scene/resources/2d/circle_shape_2d.h"
+#include "scene/resources/2d/concave_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/rectangle_shape_2d.h"
+#include "scene/resources/2d/segment_shape_2d.h"
+#include "scene/resources/2d/separation_ray_shape_2d.h"
+#include "scene/resources/2d/world_boundary_shape_2d.h"
#include "scene/scene_string_names.h"
CollisionShape2DEditor::CollisionShape2DEditor() {
diff --git a/editor/plugins/editor_debugger_plugin.cpp b/editor/plugins/editor_debugger_plugin.cpp
index 9f495d5cd2..af9ff5056a 100644
--- a/editor/plugins/editor_debugger_plugin.cpp
+++ b/editor/plugins/editor_debugger_plugin.cpp
@@ -32,7 +32,7 @@
#include "editor/debugger/script_editor_debugger.h"
-void EditorDebuggerSession::_breaked(bool p_really_did, bool p_can_debug, String p_message, bool p_has_stackdump) {
+void EditorDebuggerSession::_breaked(bool p_really_did, bool p_can_debug, const String &p_message, bool p_has_stackdump) {
if (p_really_did) {
emit_signal(SNAME("breaked"), p_can_debug);
} else {
diff --git a/editor/plugins/editor_debugger_plugin.h b/editor/plugins/editor_debugger_plugin.h
index 10c0e29f6e..41f34f67cf 100644
--- a/editor/plugins/editor_debugger_plugin.h
+++ b/editor/plugins/editor_debugger_plugin.h
@@ -43,7 +43,7 @@ private:
ScriptEditorDebugger *debugger = nullptr;
- void _breaked(bool p_really_did, bool p_can_debug, String p_message, bool p_has_stackdump);
+ void _breaked(bool p_really_did, bool p_can_debug, const String &p_message, bool p_has_stackdump);
void _started();
void _stopped();
void _debugger_gone_away();
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index fbec9ca68f..e8804fdf12 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -285,18 +285,8 @@ EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() {
//////////////////////////////////////////////////////////////////
-void EditorMaterialPreviewPlugin::_generate_frame_started() {
- RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
-
- RS::get_singleton()->request_frame_drawn_callback(callable_mp(const_cast<EditorMaterialPreviewPlugin *>(this), &EditorMaterialPreviewPlugin::_preview_done));
-}
-
-void EditorMaterialPreviewPlugin::_preview_done() {
- preview_done.post();
-}
-
void EditorMaterialPreviewPlugin::abort() {
- preview_done.post();
+ draw_requester.abort();
}
bool EditorMaterialPreviewPlugin::handles(const String &p_type) const {
@@ -314,9 +304,7 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const Ref<Resource> &p_from
if (material->get_shader_mode() == Shader::MODE_SPATIAL) {
RS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
- RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorMaterialPreviewPlugin *>(this), &EditorMaterialPreviewPlugin::_generate_frame_started), Object::CONNECT_ONE_SHOT);
-
- preview_done.wait();
+ draw_requester.request_and_wait(viewport);
Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
@@ -701,18 +689,8 @@ EditorAudioStreamPreviewPlugin::EditorAudioStreamPreviewPlugin() {
///////////////////////////////////////////////////////////////////////////
-void EditorMeshPreviewPlugin::_generate_frame_started() {
- RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
-
- RS::get_singleton()->request_frame_drawn_callback(callable_mp(const_cast<EditorMeshPreviewPlugin *>(this), &EditorMeshPreviewPlugin::_preview_done));
-}
-
-void EditorMeshPreviewPlugin::_preview_done() {
- preview_done.post();
-}
-
void EditorMeshPreviewPlugin::abort() {
- preview_done.post();
+ draw_requester.abort();
}
bool EditorMeshPreviewPlugin::handles(const String &p_type) const {
@@ -743,9 +721,7 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const Ref<Resource> &p_from, co
xform.origin.z -= rot_aabb.size.z * 2;
RS::get_singleton()->instance_set_transform(mesh_instance, xform);
- RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorMeshPreviewPlugin *>(this), &EditorMeshPreviewPlugin::_generate_frame_started), Object::CONNECT_ONE_SHOT);
-
- preview_done.wait();
+ draw_requester.request_and_wait(viewport);
Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
@@ -822,18 +798,8 @@ EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
///////////////////////////////////////////////////////////////////////////
-void EditorFontPreviewPlugin::_generate_frame_started() {
- RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
-
- RS::get_singleton()->request_frame_drawn_callback(callable_mp(const_cast<EditorFontPreviewPlugin *>(this), &EditorFontPreviewPlugin::_preview_done));
-}
-
-void EditorFontPreviewPlugin::_preview_done() {
- preview_done.post();
-}
-
void EditorFontPreviewPlugin::abort() {
- preview_done.post();
+ draw_requester.abort();
}
bool EditorFontPreviewPlugin::handles(const String &p_type) const {
@@ -865,9 +831,7 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path,
const float fg = c.get_luminance() < 0.5 ? 1.0 : 0.0;
sampled_font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(fg, fg, fg));
- RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorFontPreviewPlugin *>(this), &EditorFontPreviewPlugin::_generate_frame_started), Object::CONNECT_ONE_SHOT);
-
- preview_done.wait();
+ draw_requester.request_and_wait(viewport);
RS::get_singleton()->canvas_item_clear(canvas_item);
diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h
index fa7015f423..2b3da76a9d 100644
--- a/editor/plugins/editor_preview_plugins.h
+++ b/editor/plugins/editor_preview_plugins.h
@@ -96,10 +96,7 @@ class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator {
RID light_instance2;
RID camera;
RID camera_attributes;
- Semaphore preview_done;
-
- void _generate_frame_started();
- void _preview_done();
+ DrawRequester draw_requester;
public:
virtual bool handles(const String &p_type) const override;
@@ -147,10 +144,7 @@ class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator {
RID light_instance2;
RID camera;
RID camera_attributes;
- Semaphore preview_done;
-
- void _generate_frame_started();
- void _preview_done();
+ DrawRequester draw_requester;
public:
virtual bool handles(const String &p_type) const override;
@@ -168,10 +162,7 @@ class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator {
RID viewport_texture;
RID canvas;
RID canvas_item;
- Semaphore preview_done;
-
- void _generate_frame_started();
- void _preview_done();
+ DrawRequester draw_requester;
public:
virtual bool handles(const String &p_type) const override;
diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp
index f9b5e280c9..4011d36456 100644
--- a/editor/plugins/font_config_plugin.cpp
+++ b/editor/plugins/font_config_plugin.cpp
@@ -163,7 +163,7 @@ void EditorPropertyFontMetaOverride::_notification(int p_what) {
}
}
-void EditorPropertyFontMetaOverride::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void EditorPropertyFontMetaOverride::_property_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
if (p_property.begins_with("keys")) {
Dictionary dict = object->get_dict();
String key = p_property.get_slice("/", 1);
@@ -391,7 +391,7 @@ void EditorPropertyOTVariation::_notification(int p_what) {
}
}
-void EditorPropertyOTVariation::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void EditorPropertyOTVariation::_property_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
if (p_property.begins_with("keys")) {
Dictionary dict = object->get_dict();
Dictionary defaults_dict = object->get_defaults();
@@ -559,7 +559,7 @@ void EditorPropertyOTFeatures::_notification(int p_what) {
}
}
-void EditorPropertyOTFeatures::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void EditorPropertyOTFeatures::_property_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
if (p_property.begins_with("keys")) {
Dictionary dict = object->get_dict();
int key = p_property.get_slice("/", 1).to_int();
diff --git a/editor/plugins/font_config_plugin.h b/editor/plugins/font_config_plugin.h
index 6cea5967b2..dc17a7717e 100644
--- a/editor/plugins/font_config_plugin.h
+++ b/editor/plugins/font_config_plugin.h
@@ -108,7 +108,7 @@ protected:
void _edit_pressed();
void _page_changed(int p_page);
- void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false);
+ void _property_changed(const String &p_property, const Variant &p_value, const String &p_name = "", bool p_changing = false);
void _remove(Object *p_button, const String &p_key);
void _add_menu();
void _add_script(int p_option);
@@ -144,7 +144,7 @@ protected:
void _edit_pressed();
void _page_changed(int p_page);
- void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false);
+ void _property_changed(const String &p_property, const Variant &p_value, const String &p_name = "", bool p_changing = false);
void _object_id_selected(const StringName &p_property, ObjectID p_id);
public:
@@ -193,7 +193,7 @@ protected:
void _edit_pressed();
void _page_changed(int p_page);
- void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false);
+ void _property_changed(const String &p_property, const Variant &p_value, const String &p_name = "", bool p_changing = false);
void _remove(Object *p_button, int p_key);
void _add_menu();
void _add_feature(int p_option);
diff --git a/editor/plugins/gdextension_export_plugin.h b/editor/plugins/gdextension_export_plugin.h
index c56591cc3a..28080ed559 100644
--- a/editor/plugins/gdextension_export_plugin.h
+++ b/editor/plugins/gdextension_export_plugin.h
@@ -93,7 +93,7 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
for (const String &arch_tag : archs) {
PackedStringArray tags;
String library_path = GDExtension::find_extension_library(
- p_path, config, [features_wo_arch, arch_tag](String p_feature) { return features_wo_arch.has(p_feature) || (p_feature == arch_tag); }, &tags);
+ p_path, config, [features_wo_arch, arch_tag](const String &p_feature) { return features_wo_arch.has(p_feature) || (p_feature == arch_tag); }, &tags);
if (libs_added.has(library_path)) {
continue; // Universal library, already added for another arch, do not duplicate.
}
diff --git a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp
index 2695253b78..3cf9164460 100644
--- a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp
@@ -37,15 +37,15 @@
#include "editor/plugins/gizmos/gizmo_3d_helper.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/collision_shape_3d.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/capsule_shape_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/cylinder_shape_3d.h"
-#include "scene/resources/height_map_shape_3d.h"
-#include "scene/resources/separation_ray_shape_3d.h"
-#include "scene/resources/sphere_shape_3d.h"
-#include "scene/resources/world_boundary_shape_3d.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"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/cylinder_shape_3d.h"
+#include "scene/resources/3d/height_map_shape_3d.h"
+#include "scene/resources/3d/separation_ray_shape_3d.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
+#include "scene/resources/3d/world_boundary_shape_3d.h"
CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() {
helper.instantiate();
diff --git a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp
index cf022fc30f..69acac5a89 100644
--- a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp
@@ -33,7 +33,7 @@
#include "editor/editor_settings.h"
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/spring_arm_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
SpringArm3D *spring_arm = Object::cast_to<SpringArm3D>(p_gizmo->get_node_3d());
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index b7c4479505..d3a0d56ec9 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -43,9 +43,9 @@
#include "scene/gui/color_rect.h"
#include "scene/gui/subviewport_container.h"
#include "scene/main/viewport.h"
-#include "scene/resources/fog_material.h"
+#include "scene/resources/3d/fog_material.h"
+#include "scene/resources/3d/sky_material.h"
#include "scene/resources/particle_process_material.h"
-#include "scene/resources/sky_material.h"
void MaterialEditor::gui_input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(p_event.is_null());
@@ -303,7 +303,7 @@ void EditorInspectorPluginMaterial::parse_begin(Object *p_object) {
add_custom_control(editor);
}
-void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value) {
+void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo);
diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h
index 5530592a81..c60de1ade9 100644
--- a/editor/plugins/material_editor_plugin.h
+++ b/editor/plugins/material_editor_plugin.h
@@ -34,8 +34,8 @@
#include "editor/editor_inspector.h"
#include "editor/editor_plugin.h"
#include "editor/plugins/editor_resource_conversion_plugin.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "scene/resources/material.h"
-#include "scene/resources/primitive_meshes.h"
class Camera3D;
class ColorRect;
@@ -110,7 +110,7 @@ public:
virtual bool can_handle(Object *p_object) override;
virtual void parse_begin(Object *p_object) override;
- void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value);
+ void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value);
EditorInspectorPluginMaterial();
};
diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
index 9669f992a8..061b839ee3 100644
--- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
@@ -42,9 +42,9 @@
#include "scene/gui/dialogs.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/spin_box.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "scene/scene_string_names.h"
void MeshInstance3DEditor::_node_removed(Node *p_node) {
diff --git a/editor/plugins/mesh_library_editor_plugin.h b/editor/plugins/mesh_library_editor_plugin.h
index 7bdc70a00b..3895d10c37 100644
--- a/editor/plugins/mesh_library_editor_plugin.h
+++ b/editor/plugins/mesh_library_editor_plugin.h
@@ -32,7 +32,7 @@
#define MESH_LIBRARY_EDITOR_PLUGIN_H
#include "editor/editor_plugin.h"
-#include "scene/resources/mesh_library.h"
+#include "scene/resources/3d/mesh_library.h"
class EditorFileDialog;
class ConfirmationDialog;
diff --git a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
index 5118f1d458..869f5b3b10 100644
--- a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
+++ b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
@@ -348,7 +348,7 @@ PackedVector2Array NavigationObstacle3DEditor::_get_polygon() {
return PackedVector2Array(obstacle_node->call("get_polygon"));
}
-void NavigationObstacle3DEditor::_set_polygon(PackedVector2Array p_poly) {
+void NavigationObstacle3DEditor::_set_polygon(const PackedVector2Array &p_poly) {
ERR_FAIL_NULL_MSG(obstacle_node, "Edited object is not valid.");
obstacle_node->call("set_polygon", p_poly);
}
diff --git a/editor/plugins/navigation_obstacle_3d_editor_plugin.h b/editor/plugins/navigation_obstacle_3d_editor_plugin.h
index 1b125873d1..175fc75612 100644
--- a/editor/plugins/navigation_obstacle_3d_editor_plugin.h
+++ b/editor/plugins/navigation_obstacle_3d_editor_plugin.h
@@ -82,7 +82,7 @@ class NavigationObstacle3DEditor : public HBoxContainer {
void _menu_option(int p_option);
PackedVector2Array _get_polygon();
- void _set_polygon(PackedVector2Array p_poly);
+ void _set_polygon(const PackedVector2Array &p_poly);
protected:
void _notification(int p_what);
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index 77ed48a662..085e8cddbe 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -36,7 +36,7 @@
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/plugins/node_3d_editor_plugin.h"
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/primitive_meshes.h"
#define HANDLE_HALF_SIZE 9.5
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 64590653a4..26e33f5796 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -90,8 +90,8 @@
#include "scene/gui/flow_container.h"
#include "scene/gui/split_container.h"
#include "scene/gui/subviewport_container.h"
+#include "scene/resources/3d/sky_material.h"
#include "scene/resources/packed_scene.h"
-#include "scene/resources/sky_material.h"
#include "scene/resources/surface_tool.h"
constexpr real_t DISTANCE_DEFAULT = 4;
@@ -2663,7 +2663,7 @@ void Node3DEditorViewport::_update_freelook(real_t delta) {
cursor.eye_pos += motion;
}
-void Node3DEditorViewport::set_message(String p_message, float p_time) {
+void Node3DEditorViewport::set_message(const String &p_message, float p_time) {
message = p_message;
message_time = p_time;
}
@@ -2972,6 +2972,10 @@ void Node3DEditorViewport::_notification(int p_what) {
}
if (preview_node->is_inside_tree()) {
preview_node_pos = spatial_editor->snap_point(_get_instance_position(preview_node_viewport_pos));
+ double snap = EDITOR_GET("interface/inspector/default_float_step");
+ int snap_step_decimals = Math::range_step_decimals(snap);
+ set_message(TTR("Instantiating:") + " (" + String::num(preview_node_pos.x, snap_step_decimals) + ", " +
+ String::num(preview_node_pos.y, snap_step_decimals) + ", " + String::num(preview_node_pos.z, snap_step_decimals) + ")");
Transform3D preview_gl_transform = Transform3D(Basis(), preview_node_pos);
preview_node->set_global_transform(preview_gl_transform);
if (!preview_node->is_visible()) {
@@ -4213,6 +4217,7 @@ void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) con
}
void Node3DEditorViewport::_remove_preview_node() {
+ set_message("");
if (preview_node->get_parent()) {
for (int i = preview_node->get_child_count() - 1; i >= 0; i--) {
Node *node = preview_node->get_child(i);
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index 003d462552..13b51289a9 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -400,7 +400,7 @@ private:
String message;
double message_time;
- void set_message(String p_message, float p_time = 5);
+ void set_message(const String &p_message, float p_time = 5);
void _view_settings_confirmed(real_t p_interp_delta);
void _update_camera(real_t p_interp_delta);
diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp
index 2ea251c455..da84afc4d7 100644
--- a/editor/plugins/polygon_3d_editor_plugin.cpp
+++ b/editor/plugins/polygon_3d_editor_plugin.cpp
@@ -364,7 +364,7 @@ PackedVector2Array Polygon3DEditor::_get_polygon() {
return PackedVector2Array(obj->call("get_polygon"));
}
-void Polygon3DEditor::_set_polygon(PackedVector2Array p_poly) {
+void Polygon3DEditor::_set_polygon(const PackedVector2Array &p_poly) {
Object *obj = node_resource.is_valid() ? (Object *)node_resource.ptr() : node;
ERR_FAIL_NULL_MSG(obj, "Edited object is not valid.");
obj->call("set_polygon", p_poly);
diff --git a/editor/plugins/polygon_3d_editor_plugin.h b/editor/plugins/polygon_3d_editor_plugin.h
index 6cb9275dd6..6407e33f48 100644
--- a/editor/plugins/polygon_3d_editor_plugin.h
+++ b/editor/plugins/polygon_3d_editor_plugin.h
@@ -82,7 +82,7 @@ class Polygon3DEditor : public HBoxContainer {
float _get_depth();
PackedVector2Array _get_polygon();
- void _set_polygon(PackedVector2Array p_poly);
+ void _set_polygon(const PackedVector2Array &p_poly);
protected:
void _notification(int p_what);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 4a127e5d87..5ff8cd17ea 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -60,6 +60,7 @@
#include "editor/plugins/shader_editor_plugin.h"
#include "editor/plugins/text_shader_editor.h"
#include "editor/themes/editor_scale.h"
+#include "editor/themes/editor_theme_manager.h"
#include "editor/window_wrapper.h"
#include "scene/main/node.h"
#include "scene/main/window.h"
@@ -696,7 +697,7 @@ void ScriptEditor::_go_to_tab(int p_idx) {
_update_help_overview_visibility();
}
-void ScriptEditor::_add_recent_script(String p_path) {
+void ScriptEditor::_add_recent_script(const String &p_path) {
if (p_path.is_empty()) {
return;
}
@@ -790,7 +791,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
_show_error_dialog(path);
}
-void ScriptEditor::_show_error_dialog(String p_path) {
+void ScriptEditor::_show_error_dialog(const String &p_path) {
error_dialog->set_text(vformat(TTR("Can't open '%s'. The file could have been moved or deleted."), p_path));
error_dialog->popup_centered();
}
@@ -867,8 +868,6 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
if (script_close_queue.is_empty()) {
_update_history_arrows();
_update_script_names();
- _update_members_overview_visibility();
- _update_help_overview_visibility();
_save_layout();
_update_find_replace_bar();
}
@@ -1111,7 +1110,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref<Resource> p_for_script) {
return need_reload;
}
-void ScriptEditor::_file_dialog_action(String p_file) {
+void ScriptEditor::_file_dialog_action(const String &p_file) {
switch (file_dialog_option) {
case FILE_NEW_TEXTFILE: {
Error err;
@@ -1671,7 +1670,6 @@ void ScriptEditor::_notification(int p_what) {
recent_scripts->reset_size();
if (is_inside_tree()) {
- _update_script_colors();
_update_script_names();
}
} break;
@@ -2787,7 +2785,8 @@ void ScriptEditor::_save_layout() {
}
void ScriptEditor::_editor_settings_changed() {
- if (!EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor") &&
+ if (!EditorThemeManager::is_generated_theme_outdated() &&
+ !EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor") &&
!EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor") &&
!EditorSettings::get_singleton()->check_changed_settings_in_group("docks/filesystem")) {
return;
@@ -2821,7 +2820,6 @@ void ScriptEditor::_apply_editor_settings() {
EditorSettings::get_singleton()->load_text_editor_theme();
}
- _update_script_colors();
_update_script_names();
ScriptServer::set_reload_scripts_on_save(EDITOR_GET("text_editor/behavior/files/auto_reload_and_parse_scripts_on_save"));
@@ -3632,7 +3630,7 @@ void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
auto_reload_running_scripts = p_enabled;
}
-void ScriptEditor::_help_search(String p_text) {
+void ScriptEditor::_help_search(const String &p_text) {
help_search_dialog->popup_dialog(p_text);
}
@@ -3683,20 +3681,20 @@ void ScriptEditor::_script_changed() {
NodeDock::get_singleton()->update_lists();
}
-void ScriptEditor::_on_find_in_files_requested(String text) {
+void ScriptEditor::_on_find_in_files_requested(const String &text) {
find_in_files_dialog->set_find_in_files_mode(FindInFilesDialog::SEARCH_MODE);
find_in_files_dialog->set_search_text(text);
find_in_files_dialog->popup_centered();
}
-void ScriptEditor::_on_replace_in_files_requested(String text) {
+void ScriptEditor::_on_replace_in_files_requested(const String &text) {
find_in_files_dialog->set_find_in_files_mode(FindInFilesDialog::REPLACE_MODE);
find_in_files_dialog->set_search_text(text);
find_in_files_dialog->set_replace_text("");
find_in_files_dialog->popup_centered();
}
-void ScriptEditor::_on_find_in_files_result_selected(String fpath, int line_number, int begin, int end) {
+void ScriptEditor::_on_find_in_files_result_selected(const String &fpath, int line_number, int begin, int end) {
if (ResourceLoader::exists(fpath)) {
Ref<Resource> res = ResourceLoader::load(fpath);
@@ -3818,7 +3816,7 @@ void ScriptEditor::_start_find_in_files(bool with_replace) {
EditorNode::get_bottom_panel()->make_item_visible(find_in_files);
}
-void ScriptEditor::_on_find_in_files_modified_files(PackedStringArray paths) {
+void ScriptEditor::_on_find_in_files_modified_files(const PackedStringArray &paths) {
_test_script_times_on_disk();
_update_modified_scripts_for_external_editor();
}
@@ -4221,7 +4219,7 @@ void ScriptEditorPlugin::_focus_another_editor() {
}
}
-void ScriptEditorPlugin::_save_last_editor(String p_editor) {
+void ScriptEditorPlugin::_save_last_editor(const String &p_editor) {
if (p_editor != get_name()) {
last_editor = p_editor;
}
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index 752c1a6a05..6d13c6af09 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -179,7 +179,7 @@ public:
virtual PackedInt32Array get_breakpoints() = 0;
virtual void set_breakpoint(int p_line, bool p_enabled) = 0;
virtual void clear_breakpoints() = 0;
- virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0;
+ virtual void add_callback(const String &p_function, const PackedStringArray &p_args) = 0;
virtual void update_settings() = 0;
virtual void set_debugger_active(bool p_active) = 0;
virtual bool can_lose_focus_on_node_selection() { return true; }
@@ -362,11 +362,11 @@ class ScriptEditor : public PanelContainer {
bool _test_script_times_on_disk(Ref<Resource> p_for_script = Ref<Resource>());
- void _add_recent_script(String p_path);
+ void _add_recent_script(const String &p_path);
void _update_recent_scripts();
void _open_recent_script(int p_idx);
- void _show_error_dialog(String p_path);
+ void _show_error_dialog(const String &p_path);
void _close_tab(int p_idx, bool p_save = true, bool p_history_back = true);
void _update_find_replace_bar();
@@ -462,7 +462,7 @@ class ScriptEditor : public PanelContainer {
void _script_list_clicked(int p_item, Vector2 p_local_mouse_pos, MouseButton p_mouse_button_index);
void _make_script_list_context_menu();
- void _help_search(String p_text);
+ void _help_search(const String &p_text);
void _history_forward();
void _history_back();
@@ -481,7 +481,7 @@ class ScriptEditor : public PanelContainer {
void _script_changed();
int file_dialog_option;
- void _file_dialog_action(String p_file);
+ void _file_dialog_action(const String &p_file);
Ref<Script> _get_current_script();
TypedArray<Script> _get_open_scripts() const;
@@ -490,11 +490,11 @@ class ScriptEditor : public PanelContainer {
Ref<TextFile> _load_text_file(const String &p_path, Error *r_error) const;
Error _save_text_file(Ref<TextFile> p_text_file, const String &p_path);
- void _on_find_in_files_requested(String text);
- void _on_replace_in_files_requested(String text);
- void _on_find_in_files_result_selected(String fpath, int line_number, int begin, int end);
+ void _on_find_in_files_requested(const String &text);
+ void _on_replace_in_files_requested(const String &text);
+ void _on_find_in_files_result_selected(const String &fpath, int line_number, int begin, int end);
void _start_find_in_files(bool with_replace);
- void _on_find_in_files_modified_files(PackedStringArray paths);
+ void _on_find_in_files_modified_files(const PackedStringArray &paths);
void _set_zoom_factor(float p_zoom_factor);
@@ -579,7 +579,7 @@ class ScriptEditorPlugin : public EditorPlugin {
void _focus_another_editor();
- void _save_last_editor(String p_editor);
+ void _save_last_editor(const String &p_editor);
void _window_visibility_changed(bool p_visible);
protected:
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index ee347538a4..4c08449b8d 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -46,7 +46,7 @@
void ConnectionInfoDialog::ok_pressed() {
}
-void ConnectionInfoDialog::popup_connections(String p_method, Vector<Node *> p_nodes) {
+void ConnectionInfoDialog::popup_connections(const String &p_method, const Vector<Node *> &p_nodes) {
method->set_text(p_method);
tree->clear();
@@ -269,7 +269,7 @@ void ScriptTextEditor::_show_warnings_panel(bool p_show) {
warnings_panel->set_visible(p_show);
}
-void ScriptTextEditor::_warning_clicked(Variant p_line) {
+void ScriptTextEditor::_warning_clicked(const Variant &p_line) {
if (p_line.get_type() == Variant::INT) {
goto_line_centered(p_line.operator int64_t());
} else if (p_line.get_type() == Variant::DICTIONARY) {
@@ -300,7 +300,7 @@ void ScriptTextEditor::_warning_clicked(Variant p_line) {
}
}
-void ScriptTextEditor::_error_clicked(Variant p_line) {
+void ScriptTextEditor::_error_clicked(const Variant &p_line) {
if (p_line.get_type() == Variant::INT) {
code_editor->get_text_editor()->remove_secondary_carets();
code_editor->get_text_editor()->set_caret_line(p_line.operator int64_t());
@@ -344,7 +344,7 @@ void ScriptTextEditor::reload_text() {
_validate_script();
}
-void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
+void ScriptTextEditor::add_callback(const String &p_function, const PackedStringArray &p_args) {
ScriptLanguage *language = script->get_language();
if (!language->can_make_function()) {
return;
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index 820e86df61..2ea73d4c73 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -49,7 +49,7 @@ class ConnectionInfoDialog : public AcceptDialog {
virtual void ok_pressed() override;
public:
- void popup_connections(String p_method, Vector<Node *> p_nodes);
+ void popup_connections(const String &p_method, const Vector<Node *> &p_nodes);
ConnectionInfoDialog();
};
@@ -177,8 +177,8 @@ protected:
void _set_theme_for_script();
void _show_errors_panel(bool p_show);
void _show_warnings_panel(bool p_show);
- void _error_clicked(Variant p_line);
- void _warning_clicked(Variant p_line);
+ void _error_clicked(const Variant &p_line);
+ void _warning_clicked(const Variant &p_line);
void _notification(int p_what);
@@ -240,7 +240,7 @@ public:
virtual void set_breakpoint(int p_line, bool p_enabled) override;
virtual void clear_breakpoints() override;
- virtual void add_callback(const String &p_function, PackedStringArray p_args) override;
+ virtual void add_callback(const String &p_function, const PackedStringArray &p_args) override;
virtual void update_settings() override;
virtual bool show_members_overview() override;
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 53fdde9e14..701e848be1 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -46,9 +46,8 @@
#include "scene/3d/physics_body_3d.h"
#include "scene/gui/separator.h"
#include "scene/gui/texture_rect.h"
-#include "scene/resources/capsule_shape_3d.h"
+#include "scene/resources/3d/capsule_shape_3d.h"
#include "scene/resources/skeleton_profile.h"
-#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/surface_tool.h"
#include "scene/scene_string_names.h"
@@ -114,7 +113,7 @@ void BoneTransformEditor::_notification(int p_what) {
}
}
-void BoneTransformEditor::_value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) {
+void BoneTransformEditor::_value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing) {
if (updating) {
return;
}
diff --git a/editor/plugins/skeleton_3d_editor_plugin.h b/editor/plugins/skeleton_3d_editor_plugin.h
index 839061a2fe..f62d017c40 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.h
+++ b/editor/plugins/skeleton_3d_editor_plugin.h
@@ -75,7 +75,7 @@ class BoneTransformEditor : public VBoxContainer {
void create_editors();
- void _value_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing);
+ void _value_changed(const String &p_property, const Variant &p_value, const String &p_name, bool p_changing);
void _property_keyed(const String &p_path, bool p_advance);
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 2eb914e976..6070e08739 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -140,7 +140,7 @@ void TextEditor::enable_editor(Control *p_shortcut_context) {
}
}
-void TextEditor::add_callback(const String &p_function, PackedStringArray p_args) {
+void TextEditor::add_callback(const String &p_function, const PackedStringArray &p_args) {
}
void TextEditor::set_debugger_active(bool p_active) {
diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h
index 38dca9eb28..38fddc45df 100644
--- a/editor/plugins/text_editor.h
+++ b/editor/plugins/text_editor.h
@@ -142,7 +142,7 @@ public:
virtual bool can_lose_focus_on_node_selection() override { return true; }
virtual void set_debugger_active(bool p_active) override;
virtual void set_tooltip_request_func(const Callable &p_toolip_callback) override;
- virtual void add_callback(const String &p_function, PackedStringArray p_args) override;
+ virtual void add_callback(const String &p_function, const PackedStringArray &p_args) override;
void update_toggle_scripts_button() override;
virtual Control *get_edit_menu() override;
diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp
index ad8674207b..5a1fe833d6 100644
--- a/editor/plugins/text_shader_editor.cpp
+++ b/editor/plugins/text_shader_editor.cpp
@@ -37,6 +37,7 @@
#include "editor/filesystem_dock.h"
#include "editor/project_settings_editor.h"
#include "editor/themes/editor_scale.h"
+#include "editor/themes/editor_theme_manager.h"
#include "scene/gui/split_container.h"
#include "servers/rendering/shader_preprocessor.h"
#include "servers/rendering/shader_types.h"
@@ -740,7 +741,8 @@ void TextShaderEditor::_notification(int p_what) {
}
void TextShaderEditor::_editor_settings_changed() {
- if (!EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor") &&
+ if (!EditorThemeManager::is_generated_theme_outdated() &&
+ !EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor") &&
!EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor")) {
return;
}
@@ -758,7 +760,7 @@ void TextShaderEditor::_show_warnings_panel(bool p_show) {
warnings_panel->set_visible(p_show);
}
-void TextShaderEditor::_warning_clicked(Variant p_line) {
+void TextShaderEditor::_warning_clicked(const Variant &p_line) {
if (p_line.get_type() == Variant::INT) {
code_editor->get_text_editor()->set_caret_line(p_line.operator int64_t());
}
diff --git a/editor/plugins/text_shader_editor.h b/editor/plugins/text_shader_editor.h
index 73d7de98e4..be16148744 100644
--- a/editor/plugins/text_shader_editor.h
+++ b/editor/plugins/text_shader_editor.h
@@ -165,7 +165,7 @@ class TextShaderEditor : public MarginContainer {
void _reload_shader_include_from_disk();
void _reload();
void _show_warnings_panel(bool p_show);
- void _warning_clicked(Variant p_line);
+ void _warning_clicked(const Variant &p_line);
void _update_warnings(bool p_validate);
void _script_validated(bool p_valid) {
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp
index e49ba5844a..e25005f996 100644
--- a/editor/plugins/tiles/atlas_merging_dialog.cpp
+++ b/editor/plugins/tiles/atlas_merging_dialog.cpp
@@ -42,7 +42,7 @@ void AtlasMergingDialog::_property_changed(const StringName &p_property, const V
_set(p_property, p_value);
}
-void AtlasMergingDialog::_generate_merged(Vector<Ref<TileSetAtlasSource>> p_atlas_sources, int p_max_columns) {
+void AtlasMergingDialog::_generate_merged(const Vector<Ref<TileSetAtlasSource>> &p_atlas_sources, int p_max_columns) {
merged.instantiate();
merged_mapping.clear();
@@ -177,7 +177,7 @@ void AtlasMergingDialog::_update_texture() {
}
}
-void AtlasMergingDialog::_merge_confirmed(String p_path) {
+void AtlasMergingDialog::_merge_confirmed(const String &p_path) {
ERR_FAIL_COND(!merged.is_valid());
Ref<ImageTexture> output_image_texture = merged->get_texture();
diff --git a/editor/plugins/tiles/atlas_merging_dialog.h b/editor/plugins/tiles/atlas_merging_dialog.h
index 324cc82490..83389c2e29 100644
--- a/editor/plugins/tiles/atlas_merging_dialog.h
+++ b/editor/plugins/tiles/atlas_merging_dialog.h
@@ -35,7 +35,7 @@
#include "scene/gui/dialogs.h"
#include "scene/gui/item_list.h"
#include "scene/gui/texture_rect.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class EditorFileDialog;
class EditorPropertyVector2i;
@@ -64,9 +64,9 @@ private:
void _property_changed(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing);
- void _generate_merged(Vector<Ref<TileSetAtlasSource>> p_atlas_sources, int p_max_columns);
+ void _generate_merged(const Vector<Ref<TileSetAtlasSource>> &p_atlas_sources, int p_max_columns);
void _update_texture();
- void _merge_confirmed(String p_path);
+ void _merge_confirmed(const String &p_path);
protected:
virtual void ok_pressed() override;
diff --git a/editor/plugins/tiles/tile_atlas_view.h b/editor/plugins/tiles/tile_atlas_view.h
index e5b088af61..e5b4863b05 100644
--- a/editor/plugins/tiles/tile_atlas_view.h
+++ b/editor/plugins/tiles/tile_atlas_view.h
@@ -37,7 +37,7 @@
#include "scene/gui/center_container.h"
#include "scene/gui/label.h"
#include "scene/gui/margin_container.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class ViewPanner;
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index bd44c2965b..80490c9388 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -750,7 +750,7 @@ int GenericTilePolygonEditor::get_polygon_count() {
return polygons.size();
}
-int GenericTilePolygonEditor::add_polygon(Vector<Point2> p_polygon, int p_index) {
+int GenericTilePolygonEditor::add_polygon(const Vector<Point2> &p_polygon, int p_index) {
ERR_FAIL_COND_V(p_polygon.size() < 3, -1);
ERR_FAIL_COND_V(!multiple_polygon_mode && polygons.size() >= 1, -1);
@@ -782,7 +782,7 @@ void GenericTilePolygonEditor::clear_polygons() {
base_control->queue_redraw();
}
-void GenericTilePolygonEditor::set_polygon(int p_polygon_index, Vector<Point2> p_polygon) {
+void GenericTilePolygonEditor::set_polygon(int p_polygon_index, const Vector<Point2> &p_polygon) {
ERR_FAIL_INDEX(p_polygon_index, (int)polygons.size());
ERR_FAIL_COND(p_polygon.size() < 3);
polygons[p_polygon_index] = p_polygon;
@@ -954,7 +954,7 @@ GenericTilePolygonEditor::GenericTilePolygonEditor() {
_set_snap_option(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "tile_snap_option", SNAP_NONE));
}
-void TileDataDefaultEditor::_property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field) {
+void TileDataDefaultEditor::_property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field) {
ERR_FAIL_NULL(dummy_object);
dummy_object->set(p_property, p_value);
emit_signal(SNAME("needs_redraw"));
@@ -975,7 +975,7 @@ void TileDataDefaultEditor::_set_painted_value(TileSetAtlasSource *p_tile_set_at
}
}
-void TileDataDefaultEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) {
+void TileDataDefaultEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) {
TileData *tile_data = p_tile_set_atlas_source->get_tile_data(p_coords, p_alternative_tile);
ERR_FAIL_NULL(tile_data);
tile_data->set(property, p_value);
@@ -987,7 +987,7 @@ Variant TileDataDefaultEditor::_get_value(TileSetAtlasSource *p_tile_set_atlas_s
return tile_data->get(property);
}
-void TileDataDefaultEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) {
+void TileDataDefaultEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
for (const KeyValue<TileMapCell, Variant> &E : p_previous_values) {
Vector2i coords = E.key.get_atlas_coords();
@@ -1250,7 +1250,7 @@ void TileDataDefaultEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform2
}
}
-void TileDataDefaultEditor::setup_property_editor(Variant::Type p_type, String p_property, String p_label, Variant p_default_value) {
+void TileDataDefaultEditor::setup_property_editor(Variant::Type p_type, const String &p_property, const String &p_label, const Variant &p_default_value) {
ERR_FAIL_COND_MSG(!property.is_empty(), "Cannot setup TileDataDefaultEditor twice");
property = p_property;
property_type = p_type;
@@ -1446,7 +1446,7 @@ void TileDataOcclusionShapeEditor::_set_painted_value(TileSetAtlasSource *p_tile
polygon_editor->set_background(p_tile_set_atlas_source->get_texture(), p_tile_set_atlas_source->get_tile_texture_region(p_coords), tile_data->get_texture_origin(), tile_data->get_flip_h(), tile_data->get_flip_v(), tile_data->get_transpose(), tile_data->get_modulate());
}
-void TileDataOcclusionShapeEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) {
+void TileDataOcclusionShapeEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) {
TileData *tile_data = p_tile_set_atlas_source->get_tile_data(p_coords, p_alternative_tile);
ERR_FAIL_NULL(tile_data);
Ref<OccluderPolygon2D> occluder_polygon = p_value;
@@ -1461,7 +1461,7 @@ Variant TileDataOcclusionShapeEditor::_get_value(TileSetAtlasSource *p_tile_set_
return tile_data->get_occluder(occlusion_layer);
}
-void TileDataOcclusionShapeEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) {
+void TileDataOcclusionShapeEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
for (const KeyValue<TileMapCell, Variant> &E : p_previous_values) {
Vector2i coords = E.key.get_atlas_coords();
@@ -1487,7 +1487,7 @@ TileDataOcclusionShapeEditor::TileDataOcclusionShapeEditor() {
add_child(polygon_editor);
}
-void TileDataCollisionEditor::_property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field) {
+void TileDataCollisionEditor::_property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field) {
dummy_object->set(p_property, p_value);
}
@@ -1602,7 +1602,7 @@ void TileDataCollisionEditor::_set_painted_value(TileSetAtlasSource *p_tile_set_
polygon_editor->set_background(p_tile_set_atlas_source->get_texture(), p_tile_set_atlas_source->get_tile_texture_region(p_coords), tile_data->get_texture_origin(), tile_data->get_flip_h(), tile_data->get_flip_v(), tile_data->get_transpose(), tile_data->get_modulate());
}
-void TileDataCollisionEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) {
+void TileDataCollisionEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) {
TileData *tile_data = p_tile_set_atlas_source->get_tile_data(p_coords, p_alternative_tile);
ERR_FAIL_NULL(tile_data);
@@ -1640,7 +1640,7 @@ Variant TileDataCollisionEditor::_get_value(TileSetAtlasSource *p_tile_set_atlas
return dict;
}
-void TileDataCollisionEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) {
+void TileDataCollisionEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) {
Dictionary new_dict = p_new_value;
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
for (const KeyValue<TileMapCell, Variant> &E : p_previous_values) {
@@ -1808,7 +1808,7 @@ void TileDataTerrainsEditor::_update_terrain_selector() {
}
}
-void TileDataTerrainsEditor::_property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field) {
+void TileDataTerrainsEditor::_property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field) {
Variant old_value = dummy_object->get(p_property);
dummy_object->set(p_property, p_value);
if (p_property == "terrain_set") {
@@ -2862,7 +2862,7 @@ void TileDataNavigationEditor::_set_painted_value(TileSetAtlasSource *p_tile_set
polygon_editor->set_background(p_tile_set_atlas_source->get_texture(), p_tile_set_atlas_source->get_tile_texture_region(p_coords), tile_data->get_texture_origin(), tile_data->get_flip_h(), tile_data->get_flip_v(), tile_data->get_transpose(), tile_data->get_modulate());
}
-void TileDataNavigationEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) {
+void TileDataNavigationEditor::_set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) {
TileData *tile_data = p_tile_set_atlas_source->get_tile_data(p_coords, p_alternative_tile);
ERR_FAIL_NULL(tile_data);
Ref<NavigationPolygon> nav_polygon = p_value;
@@ -2877,7 +2877,7 @@ Variant TileDataNavigationEditor::_get_value(TileSetAtlasSource *p_tile_set_atla
return tile_data->get_navigation_polygon(navigation_layer);
}
-void TileDataNavigationEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) {
+void TileDataNavigationEditor::_setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
for (const KeyValue<TileMapCell, Variant> &E : p_previous_values) {
Vector2i coords = E.key.get_atlas_coords();
diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h
index 27fe4316a0..40c049f70c 100644
--- a/editor/plugins/tiles/tile_data_editors.h
+++ b/editor/plugins/tiles/tile_data_editors.h
@@ -185,10 +185,10 @@ public:
void set_background(Ref<Texture2D> p_texture, Rect2 p_region = Rect2(), Vector2 p_offset = Vector2(), bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false, Color p_modulate = Color(1.0, 1.0, 1.0, 0.0));
int get_polygon_count();
- int add_polygon(Vector<Point2> p_polygon, int p_index = -1);
+ int add_polygon(const Vector<Point2> &p_polygon, int p_index = -1);
void remove_polygon(int p_index);
void clear_polygons();
- void set_polygon(int p_polygon_index, Vector<Point2> p_polygon);
+ void set_polygon(int p_polygon_index, const Vector<Point2> &p_polygon);
Vector<Point2> get_polygon(int p_polygon_index);
void set_polygons_color(Color p_color);
@@ -224,7 +224,7 @@ private:
HashMap<TileMapCell, Variant, TileMapCell> drag_modified;
Variant drag_painted_value;
- void _property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field);
+ void _property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field);
protected:
DummyObject *dummy_object = memnew(DummyObject);
@@ -236,9 +236,9 @@ protected:
virtual Variant _get_painted_value();
virtual void _set_painted_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile);
- virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value);
+ virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value);
virtual Variant _get_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile);
- virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value);
+ virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value);
public:
virtual Control *get_toolbar() override { return toolbar; };
@@ -248,7 +248,7 @@ public:
virtual void forward_painting_alternatives_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref<InputEvent> &p_event) override;
virtual void draw_over_tile(CanvasItem *p_canvas_item, Transform2D p_transform, TileMapCell p_cell, bool p_selected = false) override;
- void setup_property_editor(Variant::Type p_type, String p_property, String p_label = "", Variant p_default_value = Variant());
+ void setup_property_editor(Variant::Type p_type, const String &p_property, const String &p_label = "", const Variant &p_default_value = Variant());
Variant::Type get_property_type();
TileDataDefaultEditor();
@@ -285,13 +285,13 @@ private:
// UI
GenericTilePolygonEditor *polygon_editor = nullptr;
- void _polygon_changed(PackedVector2Array p_polygon);
+ void _polygon_changed(const PackedVector2Array &p_polygon);
virtual Variant _get_painted_value() override;
virtual void _set_painted_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) override;
+ virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) override;
virtual Variant _get_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) override;
+ virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) override;
protected:
virtual void _tile_set_changed() override;
@@ -316,15 +316,15 @@ class TileDataCollisionEditor : public TileDataDefaultEditor {
DummyObject *dummy_object = memnew(DummyObject);
HashMap<StringName, EditorProperty *> property_editors;
- void _property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field);
+ void _property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field);
void _property_selected(const StringName &p_path, int p_focusable);
void _polygons_changed();
virtual Variant _get_painted_value() override;
virtual void _set_painted_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) override;
+ virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) override;
virtual Variant _get_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) override;
+ virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) override;
protected:
virtual void _tile_set_changed() override;
@@ -368,7 +368,7 @@ private:
EditorPropertyEnum *terrain_set_property_editor = nullptr;
EditorPropertyEnum *terrain_property_editor = nullptr;
- void _property_value_changed(const StringName &p_property, Variant p_value, const StringName &p_field);
+ void _property_value_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field);
void _update_terrain_selector();
@@ -399,13 +399,13 @@ private:
// UI
GenericTilePolygonEditor *polygon_editor = nullptr;
- void _polygon_changed(PackedVector2Array p_polygon);
+ void _polygon_changed(const PackedVector2Array &p_polygon);
virtual Variant _get_painted_value() override;
virtual void _set_painted_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, Variant p_value) override;
+ virtual void _set_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile, const Variant &p_value) override;
virtual Variant _get_value(TileSetAtlasSource *p_tile_set_atlas_source, Vector2 p_coords, int p_alternative_tile) override;
- virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, Variant p_new_value) override;
+ virtual void _setup_undo_redo_action(TileSetAtlasSource *p_tile_set_atlas_source, const HashMap<TileMapCell, Variant, TileMapCell> &p_previous_values, const Variant &p_new_value) override;
protected:
virtual void _tile_set_changed() override;
diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp
index d24e7faeaf..ccadc0643b 100644
--- a/editor/plugins/tiles/tile_map_layer_editor.cpp
+++ b/editor/plugins/tiles/tile_map_layer_editor.cpp
@@ -445,7 +445,7 @@ void TileMapLayerEditorTilesPlugin::_update_scenes_collection_view() {
scene_tiles_list->set_fixed_icon_size(Vector2(int_size, int_size));
}
-void TileMapLayerEditorTilesPlugin::_scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud) {
+void TileMapLayerEditorTilesPlugin::_scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_ud) {
int index = p_ud;
if (index >= 0 && index < scene_tiles_list->get_item_count()) {
@@ -3874,7 +3874,7 @@ void TileMapLayerEditor::_update_highlighting_toggle() {
}
}
-void TileMapLayerEditor::_move_tile_map_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos) {
+void TileMapLayerEditor::_move_tile_map_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos) {
EditorUndoRedoManager *undo_redo_man = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo_man);
diff --git a/editor/plugins/tiles/tile_map_layer_editor.h b/editor/plugins/tiles/tile_map_layer_editor.h
index 2a01a3c17a..a7fea2abcf 100644
--- a/editor/plugins/tiles/tile_map_layer_editor.h
+++ b/editor/plugins/tiles/tile_map_layer_editor.h
@@ -209,7 +209,7 @@ private:
ItemList *scene_tiles_list = nullptr;
void _update_scenes_collection_view();
- void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud);
+ void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_ud);
void _scenes_list_multi_selected(int p_index, bool p_selected);
void _scenes_list_lmb_empty_clicked(const Vector2 &p_pos, MouseButton p_mouse_button_index);
@@ -382,7 +382,7 @@ private:
void _update_highlighting_toggle();
// Inspector undo/redo callback.
- void _move_tile_map_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos);
+ void _move_tile_map_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos);
protected:
void _notification(int p_what);
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index 176e8b7fee..d5aba35a8f 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -551,7 +551,7 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_bind_methods() {
ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::STRING, "what")));
}
-void TileSetAtlasSourceEditor::_inspector_property_selected(String p_property) {
+void TileSetAtlasSourceEditor::_inspector_property_selected(const String &p_property) {
selected_property = p_property;
_update_atlas_view();
_update_current_tile_data_editor();
@@ -1701,7 +1701,7 @@ void TileSetAtlasSourceEditor::shortcut_input(const Ref<InputEvent> &p_event) {
}
}
-void TileSetAtlasSourceEditor::_set_selection_from_array(Array p_selection) {
+void TileSetAtlasSourceEditor::_set_selection_from_array(const Array &p_selection) {
ERR_FAIL_COND((p_selection.size() % 2) != 0);
selection.clear();
for (int i = 0; i < p_selection.size() / 2; i++) {
@@ -2100,12 +2100,12 @@ void TileSetAtlasSourceEditor::_tile_set_changed() {
tile_set_changed_needs_update = true;
}
-void TileSetAtlasSourceEditor::_tile_proxy_object_changed(String p_what) {
+void TileSetAtlasSourceEditor::_tile_proxy_object_changed(const String &p_what) {
tile_set_changed_needs_update = false; // Avoid updating too many things.
_update_atlas_view();
}
-void TileSetAtlasSourceEditor::_atlas_source_proxy_object_changed(String p_what) {
+void TileSetAtlasSourceEditor::_atlas_source_proxy_object_changed(const String &p_what) {
if (p_what == "texture" && !atlas_source_proxy_object->get("texture").is_null()) {
atlases_to_auto_create_tiles.clear();
atlases_to_auto_create_tiles.append(tile_set_atlas_source);
@@ -2115,7 +2115,7 @@ void TileSetAtlasSourceEditor::_atlas_source_proxy_object_changed(String p_what)
}
}
-void TileSetAtlasSourceEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value) {
+void TileSetAtlasSourceEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo_man = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo_man);
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.h b/editor/plugins/tiles/tile_set_atlas_source_editor.h
index b98705baf1..34077a55ad 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.h
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.h
@@ -35,7 +35,7 @@
#include "tile_data_editors.h"
#include "scene/gui/split_container.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class Popup;
class TileSet;
@@ -153,7 +153,7 @@ private:
EditorInspector *tile_inspector = nullptr;
Label *tile_inspector_no_tile_selected_label = nullptr;
String selected_property;
- void _inspector_property_selected(String p_property);
+ void _inspector_property_selected(const String &p_property);
TileSetAtlasSourceProxyObject *atlas_source_proxy_object = nullptr;
EditorInspector *atlas_source_inspector = nullptr;
@@ -229,7 +229,7 @@ private:
// Selection.
RBSet<TileSelection> selection;
- void _set_selection_from_array(Array p_selection);
+ void _set_selection_from_array(const Array &p_selection);
Array _get_selection_as_array();
// A control on the tile atlas to draw and handle input events.
@@ -283,10 +283,10 @@ private:
void _cleanup_outside_tiles();
void _tile_set_changed();
- void _tile_proxy_object_changed(String p_what);
- void _atlas_source_proxy_object_changed(String p_what);
+ void _tile_proxy_object_changed(const String &p_what);
+ void _atlas_source_proxy_object_changed(const String &p_what);
- void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value);
+ void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value);
protected:
void _notification(int p_what);
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp
index 06fcfbfb41..fe02e3096c 100644
--- a/editor/plugins/tiles/tile_set_editor.cpp
+++ b/editor/plugins/tiles/tile_set_editor.cpp
@@ -458,7 +458,7 @@ void TileSetEditor::_tab_changed(int p_tab_changed) {
patterns_item_list->set_visible(p_tab_changed == 1);
}
-void TileSetEditor::_move_tile_set_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos) {
+void TileSetEditor::_move_tile_set_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos) {
EditorUndoRedoManager *undo_redo_man = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo_man);
@@ -668,7 +668,7 @@ void TileSetEditor::_move_tile_set_array_element(Object *p_undo_redo, Object *p_
}
}
-void TileSetEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value) {
+void TileSetEditor::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value) {
EditorUndoRedoManager *undo_redo_man = Object::cast_to<EditorUndoRedoManager>(p_undo_redo);
ERR_FAIL_NULL(undo_redo_man);
diff --git a/editor/plugins/tiles/tile_set_editor.h b/editor/plugins/tiles/tile_set_editor.h
index 755b940db2..106be5acbd 100644
--- a/editor/plugins/tiles/tile_set_editor.h
+++ b/editor/plugins/tiles/tile_set_editor.h
@@ -33,7 +33,7 @@
#include "atlas_merging_dialog.h"
#include "scene/gui/tab_bar.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
#include "tile_proxies_manager_dialog.h"
#include "tile_set_atlas_source_editor.h"
#include "tile_set_scenes_collection_source_editor.h"
@@ -108,8 +108,8 @@ private:
void _tile_set_changed();
void _tab_changed(int p_tab_changed);
- void _move_tile_set_array_element(Object *p_undo_redo, Object *p_edited, String p_array_prefix, int p_from_index, int p_to_pos);
- void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value);
+ void _move_tile_set_array_element(Object *p_undo_redo, Object *p_edited, const String &p_array_prefix, int p_from_index, int p_to_pos);
+ void _undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, const String &p_property, const Variant &p_new_value);
protected:
void _notification(int p_what);
diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
index 1529ddadb6..e0151351b5 100644
--- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
@@ -214,7 +214,7 @@ void TileSetScenesCollectionSourceEditor::SceneTileProxyObject::_bind_methods()
ADD_SIGNAL(MethodInfo("changed", PropertyInfo(Variant::STRING, "what")));
}
-void TileSetScenesCollectionSourceEditor::_scenes_collection_source_proxy_object_changed(String p_what) {
+void TileSetScenesCollectionSourceEditor::_scenes_collection_source_proxy_object_changed(const String &p_what) {
if (p_what == "id") {
emit_signal(SNAME("source_id_changed"), scenes_collection_source_proxy_object->get_id());
}
@@ -224,7 +224,7 @@ void TileSetScenesCollectionSourceEditor::_tile_set_scenes_collection_source_cha
tile_set_scenes_collection_source_changed_needs_update = true;
}
-void TileSetScenesCollectionSourceEditor::_scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud) {
+void TileSetScenesCollectionSourceEditor::_scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_ud) {
int index = p_ud;
if (index >= 0 && index < scene_tiles_list->get_item_count()) {
diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h
index 82de063a07..b969421b29 100644
--- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h
+++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.h
@@ -33,7 +33,7 @@
#include "editor/editor_inspector.h"
#include "scene/gui/box_container.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class Button;
class ItemList;
@@ -118,8 +118,8 @@ private:
EditorFileDialog *scene_select_dialog = nullptr;
void _tile_set_scenes_collection_source_changed();
- void _scenes_collection_source_proxy_object_changed(String p_what);
- void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, Variant p_ud);
+ void _scenes_collection_source_proxy_object_changed(const String &p_what);
+ void _scene_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_ud);
void _scenes_list_item_activated(int p_index);
void _source_add_pressed();
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp
index 46bc072c18..e7bf812a6c 100644
--- a/editor/plugins/tiles/tiles_editor_plugin.cpp
+++ b/editor/plugins/tiles/tiles_editor_plugin.cpp
@@ -47,8 +47,8 @@
#include "scene/gui/button.h"
#include "scene/gui/control.h"
#include "scene/gui/separator.h"
+#include "scene/resources/2d/tile_set.h"
#include "scene/resources/image_texture.h"
-#include "scene/resources/tile_set.h"
TilesEditorUtils *TilesEditorUtils::singleton = nullptr;
TileMapEditorPlugin *tile_map_plugin_singleton = nullptr;
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index 06526fea28..86c7e31740 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -144,7 +144,7 @@ void VersionControlEditorPlugin::_set_credentials() {
EditorSettings::get_singleton()->set_setting("version_control/ssh_private_key_path", ssh_private_key);
}
-bool VersionControlEditorPlugin::_load_plugin(String p_name) {
+bool VersionControlEditorPlugin::_load_plugin(const String &p_name) {
Object *extension_instance = ClassDB::instantiate(p_name);
ERR_FAIL_NULL_V_MSG(extension_instance, false, "Received a nullptr VCS extension instance during construction.");
@@ -168,7 +168,7 @@ bool VersionControlEditorPlugin::_load_plugin(String p_name) {
return true;
}
-void VersionControlEditorPlugin::_update_set_up_warning(String p_new_text) {
+void VersionControlEditorPlugin::_update_set_up_warning(const String &p_new_text) {
bool empty_settings = set_up_username->get_text().strip_edges().is_empty() &&
set_up_password->get_text().is_empty() &&
set_up_ssh_public_key_path->get_text().strip_edges().is_empty() &&
@@ -305,15 +305,15 @@ void VersionControlEditorPlugin::_remote_selected(int p_index) {
_refresh_remote_list();
}
-void VersionControlEditorPlugin::_ssh_public_key_selected(String p_path) {
+void VersionControlEditorPlugin::_ssh_public_key_selected(const String &p_path) {
set_up_ssh_public_key_path->set_text(p_path);
}
-void VersionControlEditorPlugin::_ssh_private_key_selected(String p_path) {
+void VersionControlEditorPlugin::_ssh_private_key_selected(const String &p_path) {
set_up_ssh_private_key_path->set_text(p_path);
}
-void VersionControlEditorPlugin::_popup_file_dialog(Variant p_file_dialog_variant) {
+void VersionControlEditorPlugin::_popup_file_dialog(const Variant &p_file_dialog_variant) {
FileDialog *file_dialog = Object::cast_to<FileDialog>(p_file_dialog_variant);
ERR_FAIL_NULL(file_dialog);
@@ -345,11 +345,11 @@ void VersionControlEditorPlugin::_create_remote() {
_refresh_remote_list();
}
-void VersionControlEditorPlugin::_update_branch_create_button(String p_new_text) {
+void VersionControlEditorPlugin::_update_branch_create_button(const String &p_new_text) {
branch_create_ok->set_disabled(p_new_text.strip_edges().is_empty());
}
-void VersionControlEditorPlugin::_update_remote_create_button(String p_new_text) {
+void VersionControlEditorPlugin::_update_remote_create_button(const String &p_new_text) {
remote_create_ok->set_disabled(p_new_text.strip_edges().is_empty());
}
@@ -384,7 +384,7 @@ void VersionControlEditorPlugin::_refresh_stage_area() {
version_commit_dock->set_name(commit_tab_title);
}
-void VersionControlEditorPlugin::_discard_file(String p_file_path, EditorVCSInterface::ChangeType p_change) {
+void VersionControlEditorPlugin::_discard_file(const String &p_file_path, EditorVCSInterface::ChangeType p_change) {
CHECK_PLUGIN_INITIALIZED();
if (p_change == EditorVCSInterface::CHANGE_TYPE_NEW) {
@@ -414,7 +414,7 @@ void VersionControlEditorPlugin::_discard_all() {
_refresh_stage_area();
}
-void VersionControlEditorPlugin::_add_new_item(Tree *p_tree, String p_file_path, EditorVCSInterface::ChangeType p_change) {
+void VersionControlEditorPlugin::_add_new_item(Tree *p_tree, const String &p_file_path, EditorVCSInterface::ChangeType p_change) {
String change_text = p_file_path + " (" + change_type_to_strings[p_change] + ")";
TreeItem *new_item = p_tree->create_item();
diff --git a/editor/plugins/version_control_editor_plugin.h b/editor/plugins/version_control_editor_plugin.h
index ca55b86578..8ecb7c5029 100644
--- a/editor/plugins/version_control_editor_plugin.h
+++ b/editor/plugins/version_control_editor_plugin.h
@@ -142,15 +142,15 @@ private:
void _initialize_vcs();
void _set_vcs_ui_state(bool p_enabled);
void _set_credentials();
- void _ssh_public_key_selected(String p_path);
- void _ssh_private_key_selected(String p_path);
+ void _ssh_public_key_selected(const String &p_path);
+ void _ssh_private_key_selected(const String &p_path);
void _populate_available_vcs_names();
void _update_remotes_list();
- void _update_set_up_warning(String p_new_text);
+ void _update_set_up_warning(const String &p_new_text);
void _update_opened_tabs();
void _update_extra_options();
- bool _load_plugin(String p_name);
+ bool _load_plugin(const String &p_name);
void _pull();
void _push();
@@ -172,8 +172,8 @@ private:
void _item_activated(Object *p_tree);
void _create_branch();
void _create_remote();
- void _update_branch_create_button(String p_new_text);
- void _update_remote_create_button(String p_new_text);
+ void _update_branch_create_button(const String &p_new_text);
+ void _update_remote_create_button(const String &p_new_text);
void _branch_item_selected(int p_index);
void _remote_selected(int p_index);
void _remove_branch();
@@ -183,16 +183,16 @@ private:
void _move_item(Tree *p_tree, TreeItem *p_itme);
void _display_diff_split_view(List<EditorVCSInterface::DiffLine> &p_diff_content);
void _display_diff_unified_view(List<EditorVCSInterface::DiffLine> &p_diff_content);
- void _discard_file(String p_file_path, EditorVCSInterface::ChangeType p_change);
+ void _discard_file(const String &p_file_path, EditorVCSInterface::ChangeType p_change);
void _cell_button_pressed(Object *p_item, int p_column, int p_id, int p_mouse_button_index);
- void _add_new_item(Tree *p_tree, String p_file_path, EditorVCSInterface::ChangeType p_change);
+ void _add_new_item(Tree *p_tree, const String &p_file_path, EditorVCSInterface::ChangeType p_change);
void _update_commit_button();
void _commit_message_gui_input(const Ref<InputEvent> &p_event);
void _extra_option_selected(int p_index);
bool _is_staging_area_empty();
String _get_date_string_from(int64_t p_unix_timestamp, int64_t p_offset_minutes) const;
void _create_vcs_metadata_files();
- void _popup_file_dialog(Variant p_file_dialog_variant);
+ void _popup_file_dialog(const Variant &p_file_dialog_variant);
void _toggle_vcs_integration(bool p_toggled);
friend class EditorVCSInterface;
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 4261f6f32e..f5fadc2f1b 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -194,7 +194,7 @@ void VisualShaderGraphPlugin::update_node(VisualShader::Type p_type, int p_node_
add_node(p_type, p_node_id, true);
}
-void VisualShaderGraphPlugin::set_input_port_default_value(VisualShader::Type p_type, int p_node_id, int p_port_id, Variant p_value) {
+void VisualShaderGraphPlugin::set_input_port_default_value(VisualShader::Type p_type, int p_node_id, int p_port_id, const Variant &p_value) {
if (p_type != visual_shader->get_shader_type() || !links.has(p_node_id)) {
return;
}
@@ -1211,7 +1211,7 @@ void VisualShaderEditedProperty::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::NIL, "edited_property", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "set_edited_property", "get_edited_property");
}
-void VisualShaderEditedProperty::set_edited_property(Variant p_variant) {
+void VisualShaderEditedProperty::set_edited_property(const Variant &p_variant) {
edited_property = p_variant;
}
@@ -3116,7 +3116,7 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
}
}
-void VisualShaderEditor::_add_node(int p_idx, const Vector<Variant> &p_ops, String p_resource_path, int p_node_idx) {
+void VisualShaderEditor::_add_node(int p_idx, const Vector<Variant> &p_ops, const String &p_resource_path, int p_node_idx) {
ERR_FAIL_INDEX(p_idx, add_options.size());
VisualShader::Type type = get_current_shader_type();
@@ -3799,7 +3799,7 @@ void VisualShaderEditor::_replace_node(VisualShader::Type p_type_id, int p_node_
undo_redo->add_undo_method(visual_shader.ptr(), "replace_node", p_type_id, p_node_id, p_from);
}
-void VisualShaderEditor::_update_constant(VisualShader::Type p_type_id, int p_node_id, Variant p_var, int p_preview_port) {
+void VisualShaderEditor::_update_constant(VisualShader::Type p_type_id, int p_node_id, const Variant &p_var, int p_preview_port) {
Ref<VisualShaderNode> node = visual_shader->get_node(p_type_id, p_node_id);
ERR_FAIL_COND(!node.is_valid());
ERR_FAIL_COND(!node->has_method("set_constant"));
@@ -3809,7 +3809,7 @@ void VisualShaderEditor::_update_constant(VisualShader::Type p_type_id, int p_no
}
}
-void VisualShaderEditor::_update_parameter(VisualShader::Type p_type_id, int p_node_id, Variant p_var, int p_preview_port) {
+void VisualShaderEditor::_update_parameter(VisualShader::Type p_type_id, int p_node_id, const Variant &p_var, int p_preview_port) {
Ref<VisualShaderNodeParameter> parameter = visual_shader->get_node(p_type_id, p_node_id);
ERR_FAIL_COND(!parameter.is_valid());
@@ -4715,7 +4715,7 @@ void VisualShaderEditor::_custom_mode_toggled(bool p_enabled) {
_update_graph();
}
-void VisualShaderEditor::_input_select_item(Ref<VisualShaderNodeInput> p_input, String p_name) {
+void VisualShaderEditor::_input_select_item(Ref<VisualShaderNodeInput> p_input, const String &p_name) {
String prev_name = p_input->get_input_name();
if (p_name == prev_name) {
@@ -4787,7 +4787,7 @@ void VisualShaderEditor::_input_select_item(Ref<VisualShaderNodeInput> p_input,
undo_redo_man->commit_action();
}
-void VisualShaderEditor::_parameter_ref_select_item(Ref<VisualShaderNodeParameterRef> p_parameter_ref, String p_name) {
+void VisualShaderEditor::_parameter_ref_select_item(Ref<VisualShaderNodeParameterRef> p_parameter_ref, const String &p_name) {
String prev_name = p_parameter_ref->get_parameter_name();
if (p_name == prev_name) {
@@ -4831,7 +4831,7 @@ void VisualShaderEditor::_parameter_ref_select_item(Ref<VisualShaderNodeParamete
undo_redo_man->commit_action();
}
-void VisualShaderEditor::_varying_select_item(Ref<VisualShaderNodeVarying> p_varying, String p_name) {
+void VisualShaderEditor::_varying_select_item(Ref<VisualShaderNodeVarying> p_varying, const String &p_name) {
String prev_name = p_varying->get_varying_name();
if (p_name == prev_name) {
@@ -6780,7 +6780,7 @@ public:
}
}
- void setup(VisualShaderEditor *p_editor, Ref<Resource> p_parent_resource, Vector<EditorProperty *> p_properties, const Vector<StringName> &p_names, const HashMap<StringName, String> &p_overrided_names, Ref<VisualShaderNode> p_node) {
+ void setup(VisualShaderEditor *p_editor, Ref<Resource> p_parent_resource, const Vector<EditorProperty *> &p_properties, const Vector<StringName> &p_names, const HashMap<StringName, String> &p_overrided_names, Ref<VisualShaderNode> p_node) {
editor = p_editor;
parent_resource = p_parent_resource;
updating = false;
diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h
index 2575866b10..683a6bc883 100644
--- a/editor/plugins/visual_shader_editor_plugin.h
+++ b/editor/plugins/visual_shader_editor_plugin.h
@@ -127,7 +127,7 @@ public:
void show_port_preview(VisualShader::Type p_type, int p_node_id, int p_port_id, bool p_is_valid);
void set_node_position(VisualShader::Type p_type, int p_id, const Vector2 &p_position);
void refresh_node_ports(VisualShader::Type p_type, int p_node);
- void set_input_port_default_value(VisualShader::Type p_type, int p_node_id, int p_port_id, Variant p_value);
+ void set_input_port_default_value(VisualShader::Type p_type, int p_node_id, int p_port_id, const Variant &p_value);
void update_parameter_refs();
void set_parameter_name(VisualShader::Type p_type, int p_node_id, const String &p_name);
void update_curve(int p_node_id);
@@ -154,7 +154,7 @@ protected:
static void _bind_methods();
public:
- void set_edited_property(Variant p_variant);
+ void set_edited_property(const Variant &p_variant);
Variant get_edited_property() const;
VisualShaderEditedProperty() {}
@@ -360,7 +360,7 @@ class VisualShaderEditor : public VBoxContainer {
void _draw_color_over_button(Object *p_obj, Color p_color);
void _setup_node(VisualShaderNode *p_node, const Vector<Variant> &p_ops);
- void _add_node(int p_idx, const Vector<Variant> &p_ops, String p_resource_path = "", int p_node_idx = -1);
+ void _add_node(int p_idx, const Vector<Variant> &p_ops, const String &p_resource_path = "", int p_node_idx = -1);
void _add_varying(const String &p_name, VisualShader::VaryingMode p_mode, VisualShader::VaryingType p_type);
void _remove_varying(const String &p_name);
void _update_options_menu();
@@ -416,8 +416,8 @@ class VisualShaderEditor : public VBoxContainer {
void _convert_constants_to_parameters(bool p_vice_versa);
void _replace_node(VisualShader::Type p_type_id, int p_node_id, const StringName &p_from, const StringName &p_to);
- void _update_constant(VisualShader::Type p_type_id, int p_node_id, Variant p_var, int p_preview_port);
- void _update_parameter(VisualShader::Type p_type_id, int p_node_id, Variant p_var, int p_preview_port);
+ void _update_constant(VisualShader::Type p_type_id, int p_node_id, const Variant &p_var, int p_preview_port);
+ void _update_parameter(VisualShader::Type p_type_id, int p_node_id, const Variant &p_var, int p_preview_port);
void _connection_to_empty(const String &p_from, int p_from_slot, const Vector2 &p_release_position);
void _connection_from_empty(const String &p_to, int p_to_slot, const Vector2 &p_release_position);
@@ -470,9 +470,9 @@ class VisualShaderEditor : public VBoxContainer {
void _mode_selected(int p_id);
void _custom_mode_toggled(bool p_enabled);
- void _input_select_item(Ref<VisualShaderNodeInput> p_input, String p_name);
- void _parameter_ref_select_item(Ref<VisualShaderNodeParameterRef> p_parameter_ref, String p_name);
- void _varying_select_item(Ref<VisualShaderNodeVarying> p_varying, String p_name);
+ void _input_select_item(Ref<VisualShaderNodeInput> p_input, const String &p_name);
+ void _parameter_ref_select_item(Ref<VisualShaderNodeParameterRef> p_parameter_ref, const String &p_name);
+ void _varying_select_item(Ref<VisualShaderNodeVarying> p_varying, const String &p_name);
void _float_constant_selected(int p_which);
diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp
index c8197e2246..b295e5733e 100644
--- a/editor/project_converter_3_to_4.cpp
+++ b/editor/project_converter_3_to_4.cpp
@@ -47,15 +47,15 @@
#include "modules/regex/regex.h"
// Find "OS.set_property(x)", capturing x into $1.
-static String make_regex_gds_os_property_set(String name_set) {
+static String make_regex_gds_os_property_set(const String &name_set) {
return String("\\bOS\\.") + name_set + "\\s*\\((.*)\\)";
}
// Find "OS.property = x", capturing x into $1 or $2.
-static String make_regex_gds_os_property_assign(String name) {
+static String make_regex_gds_os_property_assign(const String &name) {
return String("\\bOS\\.") + name + "\\s*=\\s*([^#]+)";
}
// Find "OS.property" OR "OS.get_property()" / "OS.is_property()".
-static String make_regex_gds_os_property_get(String name, String get) {
+static String make_regex_gds_os_property_get(const String &name, const String &get) {
return String("\\bOS\\.(") + get + "_)?" + name + "(\\s*\\(\\s*\\))?";
}
@@ -746,7 +746,7 @@ Vector<SourceLine> ProjectConverter3To4::split_lines(const String &text) {
}
// Test expected results of gdscript
-bool ProjectConverter3To4::test_conversion_gdscript_builtin(String name, String expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &, bool), String what, const RegExContainer &reg_container, bool builtin_script) {
+bool ProjectConverter3To4::test_conversion_gdscript_builtin(const String &name, const String &expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &, bool), const String &what, const RegExContainer &reg_container, bool builtin_script) {
Vector<SourceLine> got = split_lines(name);
(this->*func)(got, reg_container, builtin_script);
@@ -756,7 +756,7 @@ bool ProjectConverter3To4::test_conversion_gdscript_builtin(String name, String
return true;
}
-bool ProjectConverter3To4::test_conversion_with_regex(String name, String expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &), String what, const RegExContainer &reg_container) {
+bool ProjectConverter3To4::test_conversion_with_regex(const String &name, const String &expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &), const String &what, const RegExContainer &reg_container) {
Vector<SourceLine> got = split_lines(name);
(this->*func)(got, reg_container);
@@ -766,7 +766,7 @@ bool ProjectConverter3To4::test_conversion_with_regex(String name, String expect
return true;
}
-bool ProjectConverter3To4::test_conversion_basic(String name, String expected, const char *array[][2], LocalVector<RegEx *> &regex_cache, String what) {
+bool ProjectConverter3To4::test_conversion_basic(const String &name, const String &expected, const char *array[][2], LocalVector<RegEx *> &regex_cache, const String &what) {
Vector<SourceLine> got = split_lines(name);
rename_common(array, regex_cache, got);
@@ -1638,7 +1638,7 @@ Vector<String> ProjectConverter3To4::check_for_rename_gdscript_functions(Vector<
return found_renames;
}
-bool ProjectConverter3To4::contains_function_call(String &line, String function) const {
+bool ProjectConverter3To4::contains_function_call(const String &line, const String &function) const {
// We want to convert the function only if it is completely standalone.
// For example, when we search for "connect(", we don't want to accidentally convert "reconnect(".
if (!line.contains(function)) {
@@ -2834,7 +2834,7 @@ Vector<String> ProjectConverter3To4::check_for_rename_input_map_scancode(Vector<
return found_renames;
}
-void ProjectConverter3To4::custom_rename(Vector<SourceLine> &source_lines, String from, String to) {
+void ProjectConverter3To4::custom_rename(Vector<SourceLine> &source_lines, const String &from, const String &to) {
RegEx reg = RegEx(String("\\b") + from + "\\b");
CRASH_COND(!reg.is_valid());
for (SourceLine &source_line : source_lines) {
@@ -2849,7 +2849,7 @@ void ProjectConverter3To4::custom_rename(Vector<SourceLine> &source_lines, Strin
}
};
-Vector<String> ProjectConverter3To4::check_for_custom_rename(Vector<String> &lines, String from, String to) {
+Vector<String> ProjectConverter3To4::check_for_custom_rename(Vector<String> &lines, const String &from, const String &to) {
Vector<String> found_renames;
RegEx reg = RegEx(String("\\b") + from + "\\b");
diff --git a/editor/project_converter_3_to_4.h b/editor/project_converter_3_to_4.h
index 2afd0a24e8..0f90028bc8 100644
--- a/editor/project_converter_3_to_4.h
+++ b/editor/project_converter_3_to_4.h
@@ -101,8 +101,8 @@ class ProjectConverter3To4 {
void rename_joypad_buttons_and_axes(Vector<SourceLine> &source_lines, const RegExContainer &reg_container);
Vector<String> check_for_rename_joypad_buttons_and_axes(Vector<String> &lines, const RegExContainer &reg_container);
- void custom_rename(Vector<SourceLine> &source_lines, String from, String to);
- Vector<String> check_for_custom_rename(Vector<String> &lines, String from, String to);
+ void custom_rename(Vector<SourceLine> &source_lines, const String &from, const String &to);
+ Vector<String> check_for_custom_rename(Vector<String> &lines, const String &from, const String &to);
void rename_common(const char *array[][2], LocalVector<RegEx *> &cached_regexes, Vector<SourceLine> &source_lines);
Vector<String> check_for_rename_common(const char *array[][2], LocalVector<RegEx *> &cached_regexes, Vector<String> &lines);
@@ -114,7 +114,7 @@ class ProjectConverter3To4 {
String connect_arguments(const Vector<String> &line, int from, int to = -1) const;
String get_starting_space(const String &line) const;
String get_object_of_execution(const String &line) const;
- bool contains_function_call(String &line, String function) const;
+ bool contains_function_call(const String &line, const String &function) const;
String line_formatter(int current_line, String from, String to, String line);
String simple_line_formatter(int current_line, String old_line, String line);
@@ -122,9 +122,9 @@ class ProjectConverter3To4 {
Vector<SourceLine> split_lines(const String &text);
bool test_single_array(const char *array[][2], bool ignore_second_check = false);
- bool test_conversion_gdscript_builtin(String name, String expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &, bool), String what, const RegExContainer &reg_container, bool builtin);
- bool test_conversion_with_regex(String name, String expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &), String what, const RegExContainer &reg_container);
- bool test_conversion_basic(String name, String expected, const char *array[][2], LocalVector<RegEx *> &regex_cache, String what);
+ bool test_conversion_gdscript_builtin(const String &name, const String &expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &, bool), const String &what, const RegExContainer &reg_container, bool builtin);
+ bool test_conversion_with_regex(const String &name, const String &expected, void (ProjectConverter3To4::*func)(Vector<SourceLine> &, const RegExContainer &), const String &what, const RegExContainer &reg_container);
+ bool test_conversion_basic(const String &name, const String &expected, const char *array[][2], LocalVector<RegEx *> &regex_cache, const String &what);
bool test_array_names();
bool test_conversion(RegExContainer &reg_container);
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index 367dd324c2..6a43d60cc7 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -380,7 +380,7 @@ void RenameDialog::_update_preview_int(int new_value) {
_update_preview();
}
-void RenameDialog::_update_preview(String new_text) {
+void RenameDialog::_update_preview(const String &new_text) {
if (lock_preview_update || preview_node == nullptr) {
return;
}
@@ -637,7 +637,7 @@ bool RenameDialog::_is_main_field(LineEdit *line_edit) {
(line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
}
-void RenameDialog::_insert_text(String text) {
+void RenameDialog::_insert_text(const String &text) {
LineEdit *focus_owner = Object::cast_to<LineEdit>(get_viewport()->gui_get_focus_owner());
if (_is_main_field(focus_owner)) {
diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h
index 6821cab982..37d159b4e2 100644
--- a/editor/rename_dialog.h
+++ b/editor/rename_dialog.h
@@ -52,7 +52,7 @@ class RenameDialog : public ConfirmationDialog {
virtual void ok_pressed() override { rename(); };
void _cancel_pressed() {}
void _features_toggled(bool pressed);
- void _insert_text(String text);
+ void _insert_text(const String &text);
void _update_substitute();
bool _is_main_field(LineEdit *line_edit);
@@ -61,7 +61,7 @@ class RenameDialog : public ConfirmationDialog {
String _substitute(const String &subject, const Node *node, int count);
String _regex(const String &pattern, const String &subject, const String &replacement);
String _postprocess(const String &subject);
- void _update_preview(String new_text = "");
+ void _update_preview(const String &new_text = "");
void _update_preview_int(int new_value = 0);
static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index f8e0628072..66b82ee648 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1356,7 +1356,7 @@ void SceneTreeDock::_property_selected(int p_idx) {
property_drop_node = nullptr;
}
-void SceneTreeDock::_perform_property_drop(Node *p_node, String p_property, Ref<Resource> p_res) {
+void SceneTreeDock::_perform_property_drop(Node *p_node, const String &p_property, Ref<Resource> p_res) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(vformat(TTR("Set %s"), p_property));
undo_redo->add_do_property(p_node, p_property, p_res);
@@ -2957,7 +2957,7 @@ void SceneTreeDock::set_selected(Node *p_node, bool p_emit_selected) {
scene_tree->set_selected(p_node, p_emit_selected);
}
-void SceneTreeDock::_new_scene_from(String p_file) {
+void SceneTreeDock::_new_scene_from(const String &p_file) {
List<Node *> selection = editor_selection->get_selected_node_list();
if (selection.size() != 1) {
@@ -3105,7 +3105,7 @@ void SceneTreeDock::_normalize_drop(Node *&to_node, int &to_pos, int p_type) {
}
}
-void SceneTreeDock::_files_dropped(Vector<String> p_files, NodePath p_to, int p_type) {
+void SceneTreeDock::_files_dropped(const Vector<String> &p_files, NodePath p_to, int p_type) {
Node *node = get_node(p_to);
ERR_FAIL_NULL(node);
@@ -3156,7 +3156,7 @@ void SceneTreeDock::_files_dropped(Vector<String> p_files, NodePath p_to, int p_
}
}
-void SceneTreeDock::_script_dropped(String p_file, NodePath p_to) {
+void SceneTreeDock::_script_dropped(const String &p_file, NodePath p_to) {
Ref<Script> scr = ResourceLoader::load(p_file);
ERR_FAIL_COND(!scr.is_valid());
Node *n = get_node(p_to);
@@ -3206,7 +3206,7 @@ void SceneTreeDock::_script_dropped(String p_file, NodePath p_to) {
}
}
-void SceneTreeDock::_nodes_dragged(Array p_nodes, NodePath p_to, int p_type) {
+void SceneTreeDock::_nodes_dragged(const Array &p_nodes, NodePath p_to, int p_type) {
if (!_validate_no_foreign()) {
return;
}
@@ -3581,7 +3581,7 @@ void SceneTreeDock::set_filter(const String &p_filter) {
scene_tree->set_filter(p_filter);
}
-void SceneTreeDock::save_branch_to_file(String p_directory) {
+void SceneTreeDock::save_branch_to_file(const String &p_directory) {
new_scene_from_dialog->set_current_dir(p_directory);
_tool_selected(TOOL_NEW_SCENE_FROM);
}
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index a6d2eab2e2..4c1eb5715a 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -139,7 +139,7 @@ class SceneTreeDock : public VBoxContainer {
Node *property_drop_node = nullptr;
String resource_drop_path;
- void _perform_property_drop(Node *p_node, String p_property, Ref<Resource> p_res);
+ void _perform_property_drop(Node *p_node, const String &p_property, Ref<Resource> p_res);
EditorData *editor_data = nullptr;
EditorSelection *editor_selection = nullptr;
@@ -238,7 +238,7 @@ class SceneTreeDock : public VBoxContainer {
virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
void _scene_tree_gui_input(Ref<InputEvent> p_event);
- void _new_scene_from(String p_file);
+ void _new_scene_from(const String &p_file);
void _set_node_owner_recursive(Node *p_node, Node *p_owner, const HashMap<const Node *, Node *> &p_inverse_duplimap);
bool _validate_no_foreign();
@@ -251,9 +251,9 @@ class SceneTreeDock : public VBoxContainer {
void _normalize_drop(Node *&to_node, int &to_pos, int p_type);
- void _nodes_dragged(Array p_nodes, NodePath p_to, int p_type);
- void _files_dropped(Vector<String> p_files, NodePath p_to, int p_type);
- void _script_dropped(String p_file, NodePath p_to);
+ void _nodes_dragged(const Array &p_nodes, NodePath p_to, int p_type);
+ void _files_dropped(const Vector<String> &p_files, NodePath p_to, int p_type);
+ void _script_dropped(const String &p_file, NodePath p_to);
void _quick_open();
void _tree_rmb(const Vector2 &p_menu_pos);
@@ -306,7 +306,7 @@ protected:
public:
String get_filter();
void set_filter(const String &p_filter);
- void save_branch_to_file(String p_directory);
+ void save_branch_to_file(const String &p_directory);
void _focus_node();
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 1da8fa49b4..d111fe8f36 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -46,7 +46,7 @@
#include "scene/gui/grid_container.h"
#include "scene/gui/line_edit.h"
-static String _get_parent_class_of_script(String p_path) {
+static String _get_parent_class_of_script(const String &p_path) {
if (!ResourceLoader::exists(p_path, "Script")) {
return "Object"; // A script eventually inherits from Object.
}
@@ -73,7 +73,7 @@ static String _get_parent_class_of_script(String p_path) {
return _get_parent_class_of_script(base->get_path());
}
-static Vector<String> _get_hierarchy(String p_class_name) {
+static Vector<String> _get_hierarchy(const String &p_class_name) {
Vector<String> hierarchy;
String class_name = p_class_name;
diff --git a/editor/themes/editor_color_map.cpp b/editor/themes/editor_color_map.cpp
index 0b3a237244..99bcf109d0 100644
--- a/editor/themes/editor_color_map.cpp
+++ b/editor/themes/editor_color_map.cpp
@@ -33,7 +33,7 @@
HashMap<Color, Color> EditorColorMap::color_conversion_map;
HashSet<StringName> EditorColorMap::color_conversion_exceptions;
-void EditorColorMap::add_conversion_color_pair(const String p_from_color, const String p_to_color) {
+void EditorColorMap::add_conversion_color_pair(const String &p_from_color, const String &p_to_color) {
color_conversion_map[Color::html(p_from_color)] = Color::html(p_to_color);
}
diff --git a/editor/themes/editor_color_map.h b/editor/themes/editor_color_map.h
index 4debd37faf..c1176749f2 100644
--- a/editor/themes/editor_color_map.h
+++ b/editor/themes/editor_color_map.h
@@ -47,7 +47,7 @@ class EditorColorMap {
static HashSet<StringName> color_conversion_exceptions;
public:
- static void add_conversion_color_pair(const String p_from_color, const String p_to_color);
+ static void add_conversion_color_pair(const String &p_from_color, const String &p_to_color);
static void add_conversion_exception(const StringName &p_icon_name);
static HashMap<Color, Color> &get_color_conversion_map() { return color_conversion_map; };
diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp
index 4a67bd6b31..23534568c6 100644
--- a/editor/themes/editor_theme_manager.cpp
+++ b/editor/themes/editor_theme_manager.cpp
@@ -1035,7 +1035,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_color("font_hovered_color", "ItemList", p_config.mono_color);
p_theme->set_color("font_selected_color", "ItemList", p_config.mono_color);
p_theme->set_color("font_outline_color", "ItemList", p_config.font_outline_color);
- p_theme->set_color("guide_color", "ItemList", guide_color);
+ p_theme->set_color("guide_color", "ItemList", Color(1, 1, 1, 0));
p_theme->set_constant("v_separation", "ItemList", p_config.forced_even_separation * 0.5 * EDSCALE);
p_theme->set_constant("h_separation", "ItemList", (p_config.increased_margin + 2) * EDSCALE);
p_theme->set_constant("icon_margin", "ItemList", (p_config.increased_margin + 2) * EDSCALE);
@@ -1748,10 +1748,14 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
Ref<StyleBoxFlat> menu_transparent_style = p_config.button_style->duplicate();
menu_transparent_style->set_bg_color(Color(1, 1, 1, 0));
menu_transparent_style->set_border_width_all(0);
+ Ref<StyleBoxFlat> main_screen_button_transparent = menu_transparent_style->duplicate();
+ for (int i = 0; i < 4; i++) {
+ menu_transparent_style->set_content_margin((Side)i, p_config.button_style->get_margin((Side)i) + p_config.button_style->get_border_width((Side)i));
+ }
p_theme->set_stylebox("MenuTransparent", EditorStringName(EditorStyles), menu_transparent_style);
p_theme->set_stylebox("MenuHover", EditorStringName(EditorStyles), p_config.button_style_hover);
- p_theme->set_stylebox("normal", "MainScreenButton", menu_transparent_style);
- p_theme->set_stylebox("pressed", "MainScreenButton", menu_transparent_style);
+ p_theme->set_stylebox("normal", "MainScreenButton", main_screen_button_transparent);
+ p_theme->set_stylebox("pressed", "MainScreenButton", main_screen_button_transparent);
p_theme->set_stylebox("hover_pressed", "MainScreenButton", p_config.button_style_hover);
// Run bar.
@@ -1810,11 +1814,14 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
// Flat button variations.
{
Ref<StyleBoxEmpty> style_flat_button = make_empty_stylebox();
+ Ref<StyleBoxFlat> style_flat_button_hover = p_config.button_style_hover->duplicate();
+ Ref<StyleBoxFlat> style_flat_button_pressed = p_config.button_style_pressed->duplicate();
+
for (int i = 0; i < 4; i++) {
style_flat_button->set_content_margin((Side)i, p_config.button_style->get_margin((Side)i) + p_config.button_style->get_border_width((Side)i));
+ style_flat_button_hover->set_content_margin((Side)i, p_config.button_style->get_margin((Side)i) + p_config.button_style->get_border_width((Side)i));
+ style_flat_button_pressed->set_content_margin((Side)i, p_config.button_style->get_margin((Side)i) + p_config.button_style->get_border_width((Side)i));
}
-
- Ref<StyleBoxFlat> style_flat_button_pressed = p_config.button_style_pressed->duplicate();
Color flat_pressed_color = p_config.dark_color_1.lightened(0.24).lerp(p_config.accent_color, 0.2) * Color(0.8, 0.8, 0.8, 0.85);
if (p_config.dark_theme) {
flat_pressed_color = p_config.dark_color_1.lerp(p_config.accent_color, 0.12) * Color(0.6, 0.6, 0.6, 0.85);
@@ -1822,12 +1829,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
style_flat_button_pressed->set_bg_color(flat_pressed_color);
p_theme->set_stylebox("normal", "FlatButton", style_flat_button);
- p_theme->set_stylebox("hover", "FlatButton", p_config.button_style_hover);
+ p_theme->set_stylebox("hover", "FlatButton", style_flat_button_hover);
p_theme->set_stylebox("pressed", "FlatButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatButton", style_flat_button);
p_theme->set_stylebox("normal", "FlatMenuButton", style_flat_button);
- p_theme->set_stylebox("hover", "FlatMenuButton", p_config.button_style_hover);
+ p_theme->set_stylebox("hover", "FlatMenuButton", style_flat_button_hover);
p_theme->set_stylebox("pressed", "FlatMenuButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button);
diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp
index b2b237269a..b810ec7fa2 100644
--- a/editor/window_wrapper.cpp
+++ b/editor/window_wrapper.cpp
@@ -286,7 +286,7 @@ void WindowWrapper::enable_window_on_screen(int p_screen, bool p_auto_scale) {
}
}
-void WindowWrapper::set_window_title(const String p_title) {
+void WindowWrapper::set_window_title(const String &p_title) {
if (!is_window_available()) {
return;
}
diff --git a/editor/window_wrapper.h b/editor/window_wrapper.h
index e8fcb13c92..a07e95f09e 100644
--- a/editor/window_wrapper.h
+++ b/editor/window_wrapper.h
@@ -78,7 +78,7 @@ public:
void restore_window_from_saved_position(const Rect2 p_window_rect, int p_screen, const Rect2 p_screen_rect);
void enable_window_on_screen(int p_screen = -1, bool p_auto_scale = false);
- void set_window_title(const String p_title);
+ void set_window_title(const String &p_title);
void set_margins_enabled(bool p_enabled);
WindowWrapper();
diff --git a/misc/extension_api_validation/4.2-stable.expected b/misc/extension_api_validation/4.2-stable.expected
index ef70c4ab18..c0a1e58c62 100644
--- a/misc/extension_api_validation/4.2-stable.expected
+++ b/misc/extension_api_validation/4.2-stable.expected
@@ -215,3 +215,12 @@ Renamed to EditorSceneFormatImporterFBX2GLTF.
The compat breakage was deemed necessary as this is a class most users wouldn't
use directly, and the name needs to be disambiguated with the new
EditorSceneFormatImporterUFBX.
+
+
+GH-88791
+--------
+Validate extension JSON: JSON file: Field was added in a way that breaks compatibility 'classes/Skeleton3D/methods/add_bone': return_value
+
+Added a return value for add_bone.
+Should not affect existing regular use - the return value would just be unused.
+Compatibility method registered.
diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h
index 6ac71b6946..bb7c8be431 100644
--- a/modules/csg/csg_shape.h
+++ b/modules/csg/csg_shape.h
@@ -35,7 +35,7 @@
#include "scene/3d/path_3d.h"
#include "scene/3d/visual_instance_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
#include "thirdparty/misc/mikktspace.h"
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 20d7fdb601..2d6c0c1d11 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1405,16 +1405,11 @@ String GDScript::debug_get_script_name(const Ref<Script> &p_script) {
}
#endif
-bool GDScript::is_equal_gdscript_paths(const String &p_path_a, const String &p_path_b) {
- String path_a = p_path_a;
- if (path_a.get_extension() == "gdc") {
- path_a = path_a.get_basename() + ".gd";
+String GDScript::canonicalize_path(const String &p_path) {
+ if (p_path.get_extension() == "gdc") {
+ return p_path.get_basename() + ".gd";
}
- String path_b = p_path_b;
- if (path_b.get_extension() == "gdc") {
- path_b = path_b.get_basename() + ".gd";
- }
- return path_a == path_b;
+ return p_path;
}
GDScript::UpdatableFuncPtr::UpdatableFuncPtr(GDScriptFunction *p_function) {
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h
index 981cbb3734..7c471c285b 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -230,7 +230,10 @@ public:
static String debug_get_script_name(const Ref<Script> &p_script);
#endif
- static bool is_equal_gdscript_paths(const String &p_path_a, const String &p_path_b);
+ static String canonicalize_path(const String &p_path);
+ _FORCE_INLINE_ static bool is_canonically_equal_paths(const String &p_path_a, const String &p_path_b) {
+ return canonicalize_path(p_path_a) == canonicalize_path(p_path_b);
+ }
_FORCE_INLINE_ StringName get_local_name() const { return local_name; }
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 6f45aca8b8..98d4a19a87 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -361,7 +361,7 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c
push_error(vformat(R"(Class "%s" hides a built-in type.)", class_name), p_class->identifier);
} else if (class_exists(class_name)) {
push_error(vformat(R"(Class "%s" hides a native class.)", class_name), p_class->identifier);
- } else if (ScriptServer::is_global_class(class_name) && (!GDScript::is_equal_gdscript_paths(ScriptServer::get_global_class_path(class_name), parser->script_path) || p_class != parser->head)) {
+ } else if (ScriptServer::is_global_class(class_name) && (!GDScript::is_canonically_equal_paths(ScriptServer::get_global_class_path(class_name), parser->script_path) || p_class != parser->head)) {
push_error(vformat(R"(Class "%s" hides a global script class.)", class_name), p_class->identifier);
} else if (ProjectSettings::get_singleton()->has_autoload(class_name) && ProjectSettings::get_singleton()->get_autoload(class_name).is_singleton) {
push_error(vformat(R"(Class "%s" hides an autoload singleton.)", class_name), p_class->identifier);
@@ -425,7 +425,7 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c
if (ScriptServer::is_global_class(name)) {
String base_path = ScriptServer::get_global_class_path(name);
- if (GDScript::is_equal_gdscript_paths(base_path, parser->script_path)) {
+ if (GDScript::is_canonically_equal_paths(base_path, parser->script_path)) {
base = parser->head->get_datatype();
} else {
Ref<GDScriptParserRef> base_parser = get_parser_for(base_path);
@@ -698,7 +698,7 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type
result.builtin_type = Variant::OBJECT;
result.native_type = first;
} else if (ScriptServer::is_global_class(first)) {
- if (GDScript::is_equal_gdscript_paths(parser->script_path, ScriptServer::get_global_class_path(first))) {
+ if (GDScript::is_canonically_equal_paths(parser->script_path, ScriptServer::get_global_class_path(first))) {
result = parser->head->get_datatype();
} else {
String path = ScriptServer::get_global_class_path(first);
@@ -4219,8 +4219,8 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) {
} else {
// TODO: Don't load if validating: use completion cache.
- // Must load GDScript and PackedScenes separately to permit cyclic references
- // as ResourceLoader::load() detect and reject those.
+ // Must load GDScript separately to permit cyclic references
+ // as ResourceLoader::load() detects and rejects those.
if (ResourceLoader::get_resource_type(p_preload->resolved_path) == "GDScript") {
Error err = OK;
Ref<GDScript> res = GDScriptCache::get_shallow_script(p_preload->resolved_path, err, parser->script_path);
@@ -4228,13 +4228,6 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) {
if (err != OK) {
push_error(vformat(R"(Could not preload resource script "%s".)", p_preload->resolved_path), p_preload->path);
}
- } else if (ResourceLoader::get_resource_type(p_preload->resolved_path) == "PackedScene") {
- Error err = OK;
- Ref<PackedScene> res = GDScriptCache::get_packed_scene(p_preload->resolved_path, err, parser->script_path);
- p_preload->resource = res;
- if (err != OK) {
- push_error(vformat(R"(Could not preload resource scene "%s".)", p_preload->resolved_path), p_preload->path);
- }
} else {
p_preload->resource = ResourceLoader::load(p_preload->resolved_path);
if (p_preload->resource.is_null()) {
diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp
index ef783ab564..7c27127dce 100644
--- a/modules/gdscript/gdscript_cache.cpp
+++ b/modules/gdscript/gdscript_cache.cpp
@@ -37,7 +37,6 @@
#include "core/io/file_access.h"
#include "core/templates/vector.h"
-#include "scene/resources/packed_scene.h"
bool GDScriptParserRef::is_valid() const {
return parser != nullptr;
@@ -144,13 +143,6 @@ void GDScriptCache::move_script(const String &p_from, const String &p_to) {
return;
}
- for (KeyValue<String, HashSet<String>> &E : singleton->packed_scene_dependencies) {
- if (E.value.has(p_from)) {
- E.value.insert(p_to);
- E.value.erase(p_from);
- }
- }
-
if (singleton->parser_map.has(p_from) && !p_from.is_empty()) {
singleton->parser_map[p_to] = singleton->parser_map[p_from];
}
@@ -178,15 +170,6 @@ void GDScriptCache::remove_script(const String &p_path) {
return;
}
- for (KeyValue<String, HashSet<String>> &E : singleton->packed_scene_dependencies) {
- if (!E.value.has(p_path)) {
- continue;
- }
- E.value.erase(p_path);
- }
-
- GDScriptCache::clear_unreferenced_packed_scenes();
-
if (singleton->parser_map.has(p_path)) {
singleton->parser_map[p_path]->clear();
singleton->parser_map.erase(p_path);
@@ -400,62 +383,6 @@ void GDScriptCache::remove_static_script(const String &p_fqcn) {
singleton->static_gdscript_cache.erase(p_fqcn);
}
-Ref<PackedScene> GDScriptCache::get_packed_scene(const String &p_path, Error &r_error, const String &p_owner) {
- MutexLock lock(singleton->mutex);
-
- String path = p_path;
- if (path.begins_with("uid://")) {
- path = ResourceUID::get_singleton()->get_id_path(ResourceUID::get_singleton()->text_to_id(path));
- }
-
- if (singleton->packed_scene_cache.has(path)) {
- singleton->packed_scene_dependencies[path].insert(p_owner);
- return singleton->packed_scene_cache[path];
- }
-
- Ref<PackedScene> scene = ResourceCache::get_ref(path);
- if (scene.is_valid()) {
- singleton->packed_scene_cache[path] = scene;
- singleton->packed_scene_dependencies[path].insert(p_owner);
- return scene;
- }
- scene.instantiate();
-
- r_error = OK;
- if (path.is_empty()) {
- r_error = ERR_FILE_BAD_PATH;
- return scene;
- }
-
- scene->set_path(path);
- singleton->packed_scene_cache[path] = scene;
- singleton->packed_scene_dependencies[path].insert(p_owner);
-
- scene->reload_from_file();
- return scene;
-}
-
-void GDScriptCache::clear_unreferenced_packed_scenes() {
- if (singleton == nullptr) {
- return;
- }
-
- MutexLock lock(singleton->mutex);
-
- if (singleton->cleared) {
- return;
- }
-
- for (KeyValue<String, HashSet<String>> &E : singleton->packed_scene_dependencies) {
- if (E.value.size() > 0 || !ResourceLoader::is_imported(E.key)) {
- continue;
- }
-
- singleton->packed_scene_dependencies.erase(E.key);
- singleton->packed_scene_cache.erase(E.key);
- }
-}
-
void GDScriptCache::clear() {
if (singleton == nullptr) {
return;
@@ -478,16 +405,10 @@ void GDScriptCache::clear() {
E->clear();
}
- singleton->packed_scene_dependencies.clear();
- singleton->packed_scene_cache.clear();
-
parser_map_refs.clear();
singleton->parser_map.clear();
singleton->shallow_gdscript_cache.clear();
singleton->full_gdscript_cache.clear();
-
- singleton->packed_scene_cache.clear();
- singleton->packed_scene_dependencies.clear();
}
GDScriptCache::GDScriptCache() {
diff --git a/modules/gdscript/gdscript_cache.h b/modules/gdscript/gdscript_cache.h
index 0754e9feb6..fc7abbd46e 100644
--- a/modules/gdscript/gdscript_cache.h
+++ b/modules/gdscript/gdscript_cache.h
@@ -37,7 +37,6 @@
#include "core/os/mutex.h"
#include "core/templates/hash_map.h"
#include "core/templates/hash_set.h"
-#include "scene/resources/packed_scene.h"
class GDScriptAnalyzer;
class GDScriptParser;
@@ -81,8 +80,6 @@ class GDScriptCache {
HashMap<String, Ref<GDScript>> full_gdscript_cache;
HashMap<String, Ref<GDScript>> static_gdscript_cache;
HashMap<String, HashSet<String>> dependencies;
- HashMap<String, Ref<PackedScene>> packed_scene_cache;
- HashMap<String, HashSet<String>> packed_scene_dependencies;
friend class GDScript;
friend class GDScriptParserRef;
@@ -107,9 +104,6 @@ public:
static void add_static_script(Ref<GDScript> p_script);
static void remove_static_script(const String &p_fqcn);
- static Ref<PackedScene> get_packed_scene(const String &p_path, Error &r_error, const String &p_owner = "");
- static void clear_unreferenced_packed_scenes();
-
static void clear();
GDScriptCache();
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 4625855329..f63b2ce0ee 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -551,7 +551,7 @@ void GDScriptParser::end_statement(const String &p_context) {
void GDScriptParser::parse_program() {
head = alloc_node<ClassNode>();
- head->fqcn = script_path;
+ head->fqcn = GDScript::canonicalize_path(script_path);
current_class = head;
bool can_have_class_or_extends = true;
@@ -709,7 +709,7 @@ GDScriptParser::ClassNode *GDScriptParser::parse_class(bool p_is_static) {
if (n_class->outer) {
String fqcn = n_class->outer->fqcn;
if (fqcn.is_empty()) {
- fqcn = script_path;
+ fqcn = GDScript::canonicalize_path(script_path);
}
n_class->fqcn = fqcn + "::" + n_class->identifier->name;
} else {
diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp
index 979b7e8579..853a8e0f19 100644
--- a/modules/gdscript/language_server/gdscript_workspace.cpp
+++ b/modules/gdscript/language_server/gdscript_workspace.cpp
@@ -641,7 +641,7 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S
while (!stack.is_empty()) {
current = Object::cast_to<Node>(stack.pop_back());
Ref<GDScript> scr = current->get_script();
- if (scr.is_valid() && GDScript::is_equal_gdscript_paths(scr->get_path(), path)) {
+ if (scr.is_valid() && GDScript::is_canonically_equal_paths(scr->get_path(), path)) {
break;
}
for (int i = 0; i < current->get_child_count(); ++i) {
@@ -650,7 +650,7 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S
}
Ref<GDScript> scr = current->get_script();
- if (!scr.is_valid() || !GDScript::is_equal_gdscript_paths(scr->get_path(), path)) {
+ if (!scr.is_valid() || !GDScript::is_canonically_equal_paths(scr->get_path(), path)) {
current = owner_scene_node;
}
}
diff --git a/modules/gdscript/language_server/godot_lsp.h b/modules/gdscript/language_server/godot_lsp.h
index e09adb74bd..284762018f 100644
--- a/modules/gdscript/language_server/godot_lsp.h
+++ b/modules/gdscript/language_server/godot_lsp.h
@@ -200,7 +200,7 @@ struct LocationLink {
/**
* The range that should be selected and revealed when this link is being followed, e.g the name of a function.
- * Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
+ * Must be contained by the `targetRange`. See also `DocumentSymbol#range`
*/
Range targetSelectionRange;
};
diff --git a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
index 2af716b867..1e64a6daa4 100644
--- a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
+++ b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
@@ -32,7 +32,7 @@
#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/3d/mesh_instance_3d.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
void GLTFDocumentExtensionConvertImporterMesh::_bind_methods() {
}
diff --git a/modules/gltf/extensions/physics/gltf_physics_shape.cpp b/modules/gltf/extensions/physics/gltf_physics_shape.cpp
index af4ac10313..467499a03f 100644
--- a/modules/gltf/extensions/physics/gltf_physics_shape.cpp
+++ b/modules/gltf/extensions/physics/gltf_physics_shape.cpp
@@ -34,13 +34,13 @@
#include "core/math/convex_hull.h"
#include "scene/3d/area_3d.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/capsule_shape_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/cylinder_shape_3d.h"
-#include "scene/resources/importer_mesh.h"
-#include "scene/resources/sphere_shape_3d.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"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/cylinder_shape_3d.h"
+#include "scene/resources/3d/importer_mesh.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
void GLTFPhysicsShape::_bind_methods() {
ClassDB::bind_static_method("GLTFPhysicsShape", D_METHOD("from_node", "shape_node"), &GLTFPhysicsShape::from_node);
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index afb3659699..0ed2100041 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -50,9 +50,9 @@
#include "scene/3d/light_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/multimesh_instance_3d.h"
+#include "scene/resources/3d/skin.h"
#include "scene/resources/image_texture.h"
#include "scene/resources/portable_compressed_texture.h"
-#include "scene/resources/skin.h"
#include "scene/resources/surface_tool.h"
#ifdef TOOLS_ENABLED
@@ -2796,7 +2796,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> p_state) {
Vector<Vector3> normals = array[Mesh::ARRAY_NORMAL];
for (int k = 0; k < vertex_num; k++) {
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(normals[k]);
+ Vector3 tan = Vector3(normals[i].z, -normals[i].x, normals[i].y).cross(normals[k].normalized()).normalized();
tangentsw[k * 4 + 0] = tan.x;
tangentsw[k * 4 + 1] = tan.y;
tangentsw[k * 4 + 2] = tan.z;
@@ -2822,6 +2822,19 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> p_state) {
}
array = mesh_surface_tool->commit_to_arrays();
+ if ((flags & RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES) && a.has("NORMAL") && (a.has("TANGENT") || generate_tangents)) {
+ // Compression is enabled, so let's validate that the normals and tangents are correct.
+ Vector<Vector3> normals = array[Mesh::ARRAY_NORMAL];
+ Vector<float> tangents = array[Mesh::ARRAY_TANGENT];
+ for (int vert = 0; vert < normals.size(); vert++) {
+ Vector3 tan = Vector3(tangents[vert * 4 + 0], tangents[vert * 4 + 1], tangents[vert * 4 + 2]);
+ if (abs(tan.dot(normals[vert])) > 0.0001) {
+ // Tangent is not perpendicular to the normal, so we can't use compression.
+ flags &= ~RS::ARRAY_FLAG_COMPRESS_ATTRIBUTES;
+ }
+ }
+ }
+
Array morphs;
//blend shapes
if (p.has("targets")) {
diff --git a/modules/gltf/structures/gltf_mesh.cpp b/modules/gltf/structures/gltf_mesh.cpp
index d04d3fcd7f..9566cc2379 100644
--- a/modules/gltf/structures/gltf_mesh.cpp
+++ b/modules/gltf/structures/gltf_mesh.cpp
@@ -30,7 +30,7 @@
#include "gltf_mesh.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
void GLTFMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_original_name"), &GLTFMesh::get_original_name);
diff --git a/modules/gltf/structures/gltf_mesh.h b/modules/gltf/structures/gltf_mesh.h
index c33e39df84..6983efeb2a 100644
--- a/modules/gltf/structures/gltf_mesh.h
+++ b/modules/gltf/structures/gltf_mesh.h
@@ -33,7 +33,7 @@
#include "../gltf_defines.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
class GLTFMesh : public Resource {
GDCLASS(GLTFMesh, Resource);
diff --git a/modules/gltf/structures/gltf_skin.cpp b/modules/gltf/structures/gltf_skin.cpp
index 8097c7b3d0..18aa90a628 100644
--- a/modules/gltf/structures/gltf_skin.cpp
+++ b/modules/gltf/structures/gltf_skin.cpp
@@ -33,7 +33,7 @@
#include "../gltf_template_convert.h"
#include "core/variant/typed_array.h"
-#include "scene/resources/skin.h"
+#include "scene/resources/3d/skin.h"
void GLTFSkin::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_skin_root"), &GLTFSkin::get_skin_root);
diff --git a/modules/gltf/structures/gltf_skin.h b/modules/gltf/structures/gltf_skin.h
index ce863da45d..4649a918e3 100644
--- a/modules/gltf/structures/gltf_skin.h
+++ b/modules/gltf/structures/gltf_skin.h
@@ -34,7 +34,7 @@
#include "../gltf_defines.h"
#include "core/io/resource.h"
-#include "scene/resources/skin.h"
+#include "scene/resources/3d/skin.h"
template <typename T>
class TypedArray;
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index e3475b3959..fb449a67f8 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -33,9 +33,9 @@
#include "core/core_string_names.h"
#include "core/io/marshalls.h"
#include "scene/3d/light_3d.h"
-#include "scene/resources/mesh_library.h"
+#include "scene/resources/3d/mesh_library.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "scene/resources/physics_material.h"
-#include "scene/resources/primitive_meshes.h"
#include "scene/resources/surface_tool.h"
#include "scene/scene_string_names.h"
#include "servers/navigation_server_3d.h"
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 348ac5194c..7398a540de 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -32,7 +32,7 @@
#define GRID_MAP_H
#include "scene/3d/node_3d.h"
-#include "scene/resources/mesh_library.h"
+#include "scene/resources/3d/mesh_library.h"
#include "scene/resources/multimesh.h"
//heh heh, godotsphir!! this shares no code and the design is completely different with previous projects i've done..
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 0345eebef6..88fe82c6b8 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -2851,7 +2851,22 @@ Ref<Resource> ResourceFormatLoaderCSharpScript::load(const String &p_path, const
ERR_FAIL_COND_V_MSG(!scr->get_path().is_empty() && scr->get_path() != p_original_path, Ref<Resource>(),
"The C# script path is different from the path it was registered in the C# dictionary.");
- scr->set_path(p_original_path, true);
+ Ref<Resource> existing = ResourceCache::get_ref(p_path);
+ switch (p_cache_mode) {
+ case ResourceFormatLoader::CACHE_MODE_IGNORE:
+ break;
+ case ResourceFormatLoader::CACHE_MODE_REUSE:
+ if (existing.is_null()) {
+ scr->set_path(p_original_path);
+ } else {
+ scr = existing;
+ }
+ break;
+ case ResourceFormatLoader::CACHE_MODE_REPLACE:
+ scr->set_path(p_original_path, true);
+ break;
+ }
+
scr->reload();
if (r_error) {
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index b4adc94c64..bf6cab11c7 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -511,6 +511,7 @@ namespace GodotTools
FocusMode = Control.FocusModeEnum.None,
Shortcut = EditorDefShortcut("mono/build_solution", "Build Project".TTR(), (Key)KeyModifierMask.MaskAlt | Key.B),
ShortcutInTooltip = true,
+ ThemeTypeVariation = "RunBarButton",
};
EditorShortcutOverride("mono/build_solution", "macos", (Key)KeyModifierMask.MaskMeta | (Key)KeyModifierMask.MaskCtrl | Key.B);
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 675651ccf7..7960a1ad5b 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -150,8 +150,268 @@ static String fix_doc_description(const String &p_bbcode) {
.strip_edges();
}
+String BindingsGenerator::bbcode_to_text(const String &p_bbcode, const TypeInterface *p_itype) {
+ // Based on the version in EditorHelp.
+
+ if (p_bbcode.is_empty()) {
+ return String();
+ }
+
+ DocTools *doc = EditorHelp::get_doc_data();
+
+ String bbcode = p_bbcode;
+
+ StringBuilder output;
+
+ List<String> tag_stack;
+ bool code_tag = false;
+
+ int pos = 0;
+ while (pos < bbcode.length()) {
+ int brk_pos = bbcode.find("[", pos);
+
+ if (brk_pos < 0) {
+ brk_pos = bbcode.length();
+ }
+
+ if (brk_pos > pos) {
+ String text = bbcode.substr(pos, brk_pos - pos);
+ if (code_tag || tag_stack.size() > 0) {
+ output.append("'" + text + "'");
+ } else {
+ output.append(text);
+ }
+ }
+
+ if (brk_pos == bbcode.length()) {
+ // Nothing else to add.
+ break;
+ }
+
+ int brk_end = bbcode.find("]", brk_pos + 1);
+
+ if (brk_end == -1) {
+ String text = bbcode.substr(brk_pos, bbcode.length() - brk_pos);
+ if (code_tag || tag_stack.size() > 0) {
+ output.append("'" + text + "'");
+ }
+
+ break;
+ }
+
+ String tag = bbcode.substr(brk_pos + 1, brk_end - brk_pos - 1);
+
+ if (tag.begins_with("/")) {
+ bool tag_ok = tag_stack.size() && tag_stack.front()->get() == tag.substr(1, tag.length());
+
+ if (!tag_ok) {
+ output.append("]");
+ pos = brk_pos + 1;
+ continue;
+ }
+
+ tag_stack.pop_front();
+ pos = brk_end + 1;
+ code_tag = false;
+ } else if (code_tag) {
+ output.append("[");
+ pos = brk_pos + 1;
+ } else if (tag.begins_with("method ") || tag.begins_with("constructor ") || tag.begins_with("operator ") || tag.begins_with("member ") || tag.begins_with("signal ") || tag.begins_with("enum ") || tag.begins_with("constant ") || tag.begins_with("theme_item ") || tag.begins_with("param ")) {
+ const int tag_end = tag.find(" ");
+ const String link_tag = tag.substr(0, tag_end);
+ const String link_target = tag.substr(tag_end + 1, tag.length()).lstrip(" ");
+
+ const Vector<String> link_target_parts = link_target.split(".");
+
+ if (link_target_parts.size() <= 0 || link_target_parts.size() > 2) {
+ ERR_PRINT("Invalid reference format: '" + tag + "'.");
+
+ output.append(tag);
+
+ pos = brk_end + 1;
+ continue;
+ }
+
+ const TypeInterface *target_itype;
+ StringName target_cname;
+
+ if (link_target_parts.size() == 2) {
+ target_itype = _get_type_or_null(TypeReference(link_target_parts[0]));
+ if (!target_itype) {
+ target_itype = _get_type_or_null(TypeReference("_" + link_target_parts[0]));
+ }
+ target_cname = link_target_parts[1];
+ } else {
+ target_itype = p_itype;
+ target_cname = link_target_parts[0];
+ }
+
+ if (link_tag == "method") {
+ _append_text_method(output, target_itype, target_cname, link_target, link_target_parts);
+ } else if (link_tag == "constructor") {
+ // TODO: Support constructors?
+ _append_text_undeclared(output, link_target);
+ } else if (link_tag == "operator") {
+ // TODO: Support operators?
+ _append_text_undeclared(output, link_target);
+ } else if (link_tag == "member") {
+ _append_text_member(output, target_itype, target_cname, link_target, link_target_parts);
+ } else if (link_tag == "signal") {
+ _append_text_signal(output, target_itype, target_cname, link_target, link_target_parts);
+ } else if (link_tag == "enum") {
+ _append_text_enum(output, target_itype, target_cname, link_target, link_target_parts);
+ } else if (link_tag == "constant") {
+ _append_text_constant(output, target_itype, target_cname, link_target, link_target_parts);
+ } else if (link_tag == "param") {
+ _append_text_param(output, link_target);
+ } else if (link_tag == "theme_item") {
+ // We do not declare theme_items in any way in C#, so there is nothing to reference.
+ _append_text_undeclared(output, link_target);
+ }
+
+ pos = brk_end + 1;
+ } else if (doc->class_list.has(tag)) {
+ if (tag == "Array" || tag == "Dictionary") {
+ output.append("'" BINDINGS_NAMESPACE_COLLECTIONS ".");
+ output.append(tag);
+ output.append("'");
+ } else if (tag == "bool" || tag == "int") {
+ output.append(tag);
+ } else if (tag == "float") {
+ output.append(
+#ifdef REAL_T_IS_DOUBLE
+ "double"
+#else
+ "float"
+#endif
+ );
+ } else if (tag == "Variant") {
+ output.append("'Godot.Variant'");
+ } else if (tag == "String") {
+ output.append("string");
+ } else if (tag == "Nil") {
+ output.append("null");
+ } else if (tag.begins_with("@")) {
+ // @GlobalScope, @GDScript, etc.
+ output.append("'" + tag + "'");
+ } else if (tag == "PackedByteArray") {
+ output.append("byte[]");
+ } else if (tag == "PackedInt32Array") {
+ output.append("int[]");
+ } else if (tag == "PackedInt64Array") {
+ output.append("long[]");
+ } else if (tag == "PackedFloat32Array") {
+ output.append("float[]");
+ } else if (tag == "PackedFloat64Array") {
+ output.append("double[]");
+ } else if (tag == "PackedStringArray") {
+ output.append("string[]");
+ } else if (tag == "PackedVector2Array") {
+ output.append("'" BINDINGS_NAMESPACE ".Vector2[]'");
+ } else if (tag == "PackedVector3Array") {
+ output.append("'" BINDINGS_NAMESPACE ".Vector3[]'");
+ } else if (tag == "PackedColorArray") {
+ output.append("'" BINDINGS_NAMESPACE ".Color[]'");
+ } else {
+ const TypeInterface *target_itype = _get_type_or_null(TypeReference(tag));
+
+ if (!target_itype) {
+ target_itype = _get_type_or_null(TypeReference("_" + tag));
+ }
+
+ if (target_itype) {
+ output.append("'" + target_itype->proxy_name + "'");
+ } else {
+ ERR_PRINT("Cannot resolve type reference in documentation: '" + tag + "'.");
+ output.append("'" + tag + "'");
+ }
+ }
+
+ pos = brk_end + 1;
+ } else if (tag == "b") {
+ // Bold is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "i") {
+ // Italic is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "code" || tag.begins_with("code ")) {
+ code_tag = true;
+ pos = brk_end + 1;
+ tag_stack.push_front("code");
+ } else if (tag == "kbd") {
+ // Keyboard combinations are not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "center") {
+ // Center alignment is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "br") {
+ // Break is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "u") {
+ // Underline is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "s") {
+ // Strikethrough is not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag == "url") {
+ int end = bbcode.find("[", brk_end);
+ if (end == -1) {
+ end = bbcode.length();
+ }
+ String url = bbcode.substr(brk_end + 1, end - brk_end - 1);
+ // Not supported. Just append the url.
+ output.append(url);
+
+ pos = brk_end + 1;
+ tag_stack.push_front(tag);
+ } else if (tag.begins_with("url=")) {
+ String url = tag.substr(4, tag.length());
+ // Not supported. Just append the url.
+ output.append(url);
+
+ pos = brk_end + 1;
+ tag_stack.push_front("url");
+ } else if (tag == "img") {
+ int end = bbcode.find("[", brk_end);
+ if (end == -1) {
+ end = bbcode.length();
+ }
+ String image = bbcode.substr(brk_end + 1, end - brk_end - 1);
+
+ // Not supported. Just append the bbcode.
+ output.append("[img]");
+ output.append(image);
+ output.append("[/img]");
+
+ pos = end;
+ tag_stack.push_front(tag);
+ } else if (tag.begins_with("color=")) {
+ // Not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front("color");
+ } else if (tag.begins_with("font=")) {
+ // Not supported.
+ pos = brk_end + 1;
+ tag_stack.push_front("font");
+ } else {
+ // Ignore unrecognized tag.
+ output.append("[");
+ pos = brk_pos + 1;
+ }
+ }
+
+ return output.as_string();
+}
+
String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterface *p_itype, bool p_is_signal) {
- // Based on the version in EditorHelp
+ // Based on the version in EditorHelp.
if (p_bbcode.is_empty()) {
return String();
@@ -200,7 +460,8 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
}
if (brk_pos == bbcode.length()) {
- break; // nothing else to add
+ // Nothing else to add.
+ break;
}
int brk_end = bbcode.find("]", brk_pos + 1);
@@ -316,7 +577,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
} else if (link_tag == "param") {
_append_xml_param(xml_output, link_target, p_is_signal);
} else if (link_tag == "theme_item") {
- // We do not declare theme_items in any way in C#, so there is nothing to reference
+ // We do not declare theme_items in any way in C#, so there is nothing to reference.
_append_xml_undeclared(xml_output, link_target);
}
@@ -345,7 +606,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
} else if (tag == "Nil") {
xml_output.append("<see langword=\"null\"/>");
} else if (tag.begins_with("@")) {
- // @GlobalScope, @GDScript, etc
+ // @GlobalScope, @GDScript, etc.
xml_output.append("<c>");
xml_output.append(tag);
xml_output.append("</c>");
@@ -432,22 +693,22 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
pos = brk_end + 1;
tag_stack.push_front("csharp");
} else if (tag == "kbd") {
- // keyboard combinations are not supported in xml comments
+ // Keyboard combinations are not supported in xml comments.
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "center") {
- // center alignment is not supported in xml comments
+ // Center alignment is not supported in xml comments.
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "br") {
xml_output.append("\n"); // FIXME: Should use <para> instead. Luckily this tag isn't used for now.
pos = brk_end + 1;
} else if (tag == "u") {
- // underline is not supported in Rider xml comments
+ // Underline is not supported in Rider xml comments.
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "s") {
- // strikethrough is not supported in xml comments
+ // Strikethrough is not supported in xml comments.
pos = brk_end + 1;
tag_stack.push_front(tag);
} else if (tag == "url") {
@@ -495,7 +756,8 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
tag_stack.push_front("font");
} else {
if (!line_del) {
- xml_output.append("["); // ignore
+ // Ignore unrecognized tag.
+ xml_output.append("[");
}
pos = brk_pos + 1;
}
@@ -506,6 +768,285 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
return xml_output.as_string();
}
+void BindingsGenerator::_append_text_method(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
+ if (p_link_target_parts[0] == name_cache.type_at_GlobalScope) {
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ OS::get_singleton()->print("Cannot resolve @GlobalScope method reference in documentation: %s\n", p_link_target.utf8().get_data());
+ }
+
+ // TODO Map what we can
+ _append_text_undeclared(p_output, p_link_target);
+ } else if (!p_target_itype || !p_target_itype->is_object_type) {
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ if (p_target_itype) {
+ OS::get_singleton()->print("Cannot resolve method reference for non-GodotObject type in documentation: %s\n", p_link_target.utf8().get_data());
+ } else {
+ OS::get_singleton()->print("Cannot resolve type from method reference in documentation: %s\n", p_link_target.utf8().get_data());
+ }
+ }
+
+ // TODO Map what we can
+ _append_text_undeclared(p_output, p_link_target);
+ } else {
+ if (p_target_cname == "_init") {
+ // The _init method is not declared in C#, reference the constructor instead
+ p_output.append("'new " BINDINGS_NAMESPACE ".");
+ p_output.append(p_target_itype->proxy_name);
+ p_output.append("()'");
+ } else {
+ const MethodInterface *target_imethod = p_target_itype->find_method_by_name(p_target_cname);
+
+ if (target_imethod) {
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(p_target_itype->proxy_name);
+ p_output.append(".");
+ p_output.append(target_imethod->proxy_name);
+ p_output.append("(");
+ bool first_key = true;
+ for (const ArgumentInterface &iarg : target_imethod->arguments) {
+ const TypeInterface *arg_type = _get_type_or_null(iarg.type);
+
+ if (first_key) {
+ first_key = false;
+ } else {
+ p_output.append(", ");
+ }
+ if (!arg_type) {
+ ERR_PRINT("Cannot resolve argument type in documentation: '" + p_link_target + "'.");
+ p_output.append(iarg.type.cname);
+ continue;
+ }
+ if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) {
+ p_output.append("Nullable<");
+ }
+ String arg_cs_type = arg_type->cs_type + _get_generic_type_parameters(*arg_type, iarg.type.generic_type_parameters);
+ p_output.append(arg_cs_type.replacen("params ", ""));
+ if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) {
+ p_output.append(">");
+ }
+ }
+ p_output.append(")'");
+ } else {
+ if (!p_target_itype->is_intentionally_ignored(p_link_target)) {
+ ERR_PRINT("Cannot resolve method reference in documentation: '" + p_link_target + "'.");
+ }
+
+ _append_text_undeclared(p_output, p_link_target);
+ }
+ }
+ }
+}
+
+void BindingsGenerator::_append_text_member(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
+ if (p_link_target.find("/") >= 0) {
+ // Properties with '/' (slash) in the name are not declared in C#, so there is nothing to reference.
+ _append_text_undeclared(p_output, p_link_target);
+ } else if (!p_target_itype || !p_target_itype->is_object_type) {
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ if (p_target_itype) {
+ OS::get_singleton()->print("Cannot resolve member reference for non-GodotObject type in documentation: %s\n", p_link_target.utf8().get_data());
+ } else {
+ OS::get_singleton()->print("Cannot resolve type from member reference in documentation: %s\n", p_link_target.utf8().get_data());
+ }
+ }
+
+ // TODO Map what we can
+ _append_text_undeclared(p_output, p_link_target);
+ } else {
+ const TypeInterface *current_itype = p_target_itype;
+ const PropertyInterface *target_iprop = nullptr;
+
+ while (target_iprop == nullptr && current_itype != nullptr) {
+ target_iprop = current_itype->find_property_by_name(p_target_cname);
+ if (target_iprop == nullptr) {
+ current_itype = _get_type_or_null(TypeReference(current_itype->base_name));
+ }
+ }
+
+ if (target_iprop) {
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(current_itype->proxy_name);
+ p_output.append(".");
+ p_output.append(target_iprop->proxy_name);
+ p_output.append("'");
+ } else {
+ if (!p_target_itype->is_intentionally_ignored(p_link_target)) {
+ ERR_PRINT("Cannot resolve member reference in documentation: '" + p_link_target + "'.");
+ }
+
+ _append_text_undeclared(p_output, p_link_target);
+ }
+ }
+}
+
+void BindingsGenerator::_append_text_signal(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
+ if (!p_target_itype || !p_target_itype->is_object_type) {
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ if (p_target_itype) {
+ OS::get_singleton()->print("Cannot resolve signal reference for non-GodotObject type in documentation: %s\n", p_link_target.utf8().get_data());
+ } else {
+ OS::get_singleton()->print("Cannot resolve type from signal reference in documentation: %s\n", p_link_target.utf8().get_data());
+ }
+ }
+
+ // TODO Map what we can
+ _append_text_undeclared(p_output, p_link_target);
+ } else {
+ const SignalInterface *target_isignal = p_target_itype->find_signal_by_name(p_target_cname);
+
+ if (target_isignal) {
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(p_target_itype->proxy_name);
+ p_output.append(".");
+ p_output.append(target_isignal->proxy_name);
+ p_output.append("'");
+ } else {
+ if (!p_target_itype->is_intentionally_ignored(p_link_target)) {
+ ERR_PRINT("Cannot resolve signal reference in documentation: '" + p_link_target + "'.");
+ }
+
+ _append_text_undeclared(p_output, p_link_target);
+ }
+ }
+}
+
+void BindingsGenerator::_append_text_enum(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
+ const StringName search_cname = !p_target_itype ? p_target_cname : StringName(p_target_itype->name + "." + (String)p_target_cname);
+
+ HashMap<StringName, TypeInterface>::ConstIterator enum_match = enum_types.find(search_cname);
+
+ if (!enum_match && search_cname != p_target_cname) {
+ enum_match = enum_types.find(p_target_cname);
+ }
+
+ if (enum_match) {
+ const TypeInterface &target_enum_itype = enum_match->value;
+
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(target_enum_itype.proxy_name); // Includes nesting class if any
+ p_output.append("'");
+ } else {
+ if (!p_target_itype->is_intentionally_ignored(p_link_target)) {
+ ERR_PRINT("Cannot resolve enum reference in documentation: '" + p_link_target + "'.");
+ }
+
+ _append_text_undeclared(p_output, p_link_target);
+ }
+}
+
+void BindingsGenerator::_append_text_constant(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
+ if (p_link_target_parts[0] == name_cache.type_at_GlobalScope) {
+ _append_text_constant_in_global_scope(p_output, p_target_cname, p_link_target);
+ } else if (!p_target_itype || !p_target_itype->is_object_type) {
+ // Search in @GlobalScope as a last resort if no class was specified
+ if (p_link_target_parts.size() == 1) {
+ _append_text_constant_in_global_scope(p_output, p_target_cname, p_link_target);
+ return;
+ }
+
+ if (OS::get_singleton()->is_stdout_verbose()) {
+ if (p_target_itype) {
+ OS::get_singleton()->print("Cannot resolve constant reference for non-GodotObject type in documentation: %s\n", p_link_target.utf8().get_data());
+ } else {
+ OS::get_singleton()->print("Cannot resolve type from constant reference in documentation: %s\n", p_link_target.utf8().get_data());
+ }
+ }
+
+ // TODO Map what we can
+ _append_text_undeclared(p_output, p_link_target);
+ } else {
+ // Try to find the constant in the current class
+ if (p_target_itype->is_singleton_instance) {
+ // Constants and enums are declared in the static singleton class.
+ p_target_itype = &obj_types[p_target_itype->cname];
+ }
+
+ const ConstantInterface *target_iconst = find_constant_by_name(p_target_cname, p_target_itype->constants);
+
+ if (target_iconst) {
+ // Found constant in current class
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(p_target_itype->proxy_name);
+ p_output.append(".");
+ p_output.append(target_iconst->proxy_name);
+ p_output.append("'");
+ } else {
+ // Try to find as enum constant in the current class
+ const EnumInterface *target_ienum = nullptr;
+
+ for (const EnumInterface &ienum : p_target_itype->enums) {
+ target_ienum = &ienum;
+ target_iconst = find_constant_by_name(p_target_cname, target_ienum->constants);
+ if (target_iconst) {
+ break;
+ }
+ }
+
+ if (target_iconst) {
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(p_target_itype->proxy_name);
+ p_output.append(".");
+ p_output.append(target_ienum->proxy_name);
+ p_output.append(".");
+ p_output.append(target_iconst->proxy_name);
+ p_output.append("'");
+ } else if (p_link_target_parts.size() == 1) {
+ // Also search in @GlobalScope as a last resort if no class was specified
+ _append_text_constant_in_global_scope(p_output, p_target_cname, p_link_target);
+ } else {
+ if (!p_target_itype->is_intentionally_ignored(p_link_target)) {
+ ERR_PRINT("Cannot resolve constant reference in documentation: '" + p_link_target + "'.");
+ }
+
+ _append_xml_undeclared(p_output, p_link_target);
+ }
+ }
+ }
+}
+
+void BindingsGenerator::_append_text_constant_in_global_scope(StringBuilder &p_output, const String &p_target_cname, const String &p_link_target) {
+ // Try to find as a global constant
+ const ConstantInterface *target_iconst = find_constant_by_name(p_target_cname, global_constants);
+
+ if (target_iconst) {
+ // Found global constant
+ p_output.append("'" BINDINGS_NAMESPACE "." BINDINGS_GLOBAL_SCOPE_CLASS ".");
+ p_output.append(target_iconst->proxy_name);
+ p_output.append("'");
+ } else {
+ // Try to find as global enum constant
+ const EnumInterface *target_ienum = nullptr;
+
+ for (const EnumInterface &ienum : global_enums) {
+ target_ienum = &ienum;
+ target_iconst = find_constant_by_name(p_target_cname, target_ienum->constants);
+ if (target_iconst) {
+ break;
+ }
+ }
+
+ if (target_iconst) {
+ p_output.append("'" BINDINGS_NAMESPACE ".");
+ p_output.append(target_ienum->proxy_name);
+ p_output.append(".");
+ p_output.append(target_iconst->proxy_name);
+ p_output.append("'");
+ } else {
+ ERR_PRINT("Cannot resolve global constant reference in documentation: '" + p_link_target + "'.");
+ _append_text_undeclared(p_output, p_link_target);
+ }
+ }
+}
+
+void BindingsGenerator::_append_text_param(StringBuilder &p_output, const String &p_link_target) {
+ const String link_target = snake_to_camel_case(p_link_target);
+ p_output.append("'" + link_target + "'");
+}
+
+void BindingsGenerator::_append_text_undeclared(StringBuilder &p_output, const String &p_link_target) {
+ p_output.append("'" + p_link_target + "'");
+}
+
void BindingsGenerator::_append_xml_method(StringBuilder &p_xml_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
if (p_link_target_parts[0] == name_cache.type_at_GlobalScope) {
if (OS::get_singleton()->is_stdout_verbose()) {
@@ -1429,10 +1970,12 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output.append("/// </summary>\n");
}
+ }
- if (class_doc->is_deprecated) {
- output.append("[Obsolete(\"This class is deprecated.\")]\n");
- }
+ if (itype.is_deprecated) {
+ output.append("[Obsolete(\"");
+ output.append(bbcode_to_text(itype.deprecation_message, &itype));
+ output.append("\")]\n");
}
// We generate a `GodotClassName` attribute if the engine class name is not the same as the
@@ -1489,10 +2032,12 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output.append(INDENT1 "/// </summary>");
}
+ }
- if (iconstant.const_doc->is_deprecated) {
- output.append(MEMBER_BEGIN "[Obsolete(\"This constant is deprecated.\")]");
- }
+ if (iconstant.is_deprecated) {
+ output.append(MEMBER_BEGIN "[Obsolete(\"");
+ output.append(bbcode_to_text(iconstant.deprecation_message, &itype));
+ output.append("\")]");
}
output.append(MEMBER_BEGIN "public const long ");
@@ -1537,10 +2082,12 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output.append(INDENT2 "/// </summary>\n");
}
+ }
- if (iconstant.const_doc->is_deprecated) {
- output.append(INDENT2 "[Obsolete(\"This enum member is deprecated.\")]\n");
- }
+ if (iconstant.is_deprecated) {
+ output.append(INDENT2 "[Obsolete(\"");
+ output.append(bbcode_to_text(iconstant.deprecation_message, &itype));
+ output.append("\")]\n");
}
output.append(INDENT2);
@@ -1992,10 +2539,12 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte
p_output.append(INDENT1 "/// </summary>");
}
+ }
- if (p_iprop.prop_doc->is_deprecated) {
- p_output.append(MEMBER_BEGIN "[Obsolete(\"This property is deprecated.\")]");
- }
+ if (p_iprop.is_deprecated) {
+ p_output.append(MEMBER_BEGIN "[Obsolete(\"");
+ p_output.append(bbcode_to_text(p_iprop.deprecation_message, &p_itype));
+ p_output.append("\")]");
}
p_output.append(MEMBER_BEGIN "public ");
@@ -2248,15 +2797,9 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf
}
if (p_imethod.is_deprecated) {
- if (p_imethod.deprecation_message.is_empty()) {
- WARN_PRINT("An empty deprecation message is discouraged. Method: '" + p_imethod.proxy_name + "'.");
- }
-
p_output.append(MEMBER_BEGIN "[Obsolete(\"");
- p_output.append(p_imethod.deprecation_message);
+ p_output.append(bbcode_to_text(p_imethod.deprecation_message, &p_itype));
p_output.append("\")]");
- } else if (p_imethod.method_doc && p_imethod.method_doc->is_deprecated) {
- p_output.append(MEMBER_BEGIN "[Obsolete(\"This method is deprecated.\")]");
}
if (p_imethod.is_compat) {
@@ -2401,12 +2944,8 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
p_output.append(INDENT1 "/// </summary>");
if (p_isignal.is_deprecated) {
- if (p_isignal.deprecation_message.is_empty()) {
- WARN_PRINT("An empty deprecation message is discouraged. Signal: '" + p_isignal.proxy_name + "'.");
- }
-
p_output.append(MEMBER_BEGIN "[Obsolete(\"");
- p_output.append(p_isignal.deprecation_message);
+ p_output.append(bbcode_to_text(p_isignal.deprecation_message, &p_itype));
p_output.append("\")]");
}
@@ -2459,15 +2998,11 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
p_output.append(INDENT1 "/// </summary>");
}
-
- if (p_isignal.method_doc->is_deprecated) {
- p_output.append(MEMBER_BEGIN "[Obsolete(\"This signal is deprecated.\")]");
- }
}
if (p_isignal.is_deprecated) {
p_output.append(MEMBER_BEGIN "[Obsolete(\"");
- p_output.append(p_isignal.deprecation_message);
+ p_output.append(bbcode_to_text(p_isignal.deprecation_message, &p_itype));
p_output.append("\")]");
}
@@ -3029,6 +3564,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
itype.is_ref_counted = ClassDB::is_parent_class(type_cname, name_cache.type_RefCounted);
itype.memory_own = itype.is_ref_counted;
+ if (itype.class_doc) {
+ itype.is_deprecated = itype.class_doc->is_deprecated;
+ itype.deprecation_message = itype.class_doc->deprecated_message;
+
+ if (itype.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Type: '" + itype.proxy_name + "'.");
+ itype.deprecation_message = "This class is deprecated.";
+ }
+ }
+
if (itype.is_singleton && compat_singletons.has(itype.cname)) {
itype.is_singleton = false;
itype.is_compat_singleton = true;
@@ -3103,6 +3648,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
}
}
+ if (iprop.prop_doc) {
+ iprop.is_deprecated = iprop.prop_doc->is_deprecated;
+ iprop.deprecation_message = iprop.prop_doc->deprecated_message;
+
+ if (iprop.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Property: '" + itype.proxy_name + "." + iprop.proxy_name + "'.");
+ iprop.deprecation_message = "This property is deprecated.";
+ }
+ }
+
itype.properties.push_back(iprop);
}
@@ -3282,6 +3837,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
}
}
+ if (imethod.method_doc) {
+ imethod.is_deprecated = imethod.method_doc->is_deprecated;
+ imethod.deprecation_message = imethod.method_doc->deprecated_message;
+
+ if (imethod.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Method: '" + itype.proxy_name + "." + imethod.proxy_name + "'.");
+ imethod.deprecation_message = "This method is deprecated.";
+ }
+ }
+
ERR_FAIL_COND_V_MSG(itype.find_property_by_name(imethod.cname), false,
"Method name conflicts with property: '" + itype.name + "." + imethod.name + "'.");
@@ -3388,6 +3953,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
}
}
+ if (isignal.method_doc) {
+ isignal.is_deprecated = isignal.method_doc->is_deprecated;
+ isignal.deprecation_message = isignal.method_doc->deprecated_message;
+
+ if (isignal.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Signal: '" + itype.proxy_name + "." + isignal.proxy_name + "'.");
+ isignal.deprecation_message = "This signal is deprecated.";
+ }
+ }
+
itype.signals_.push_back(isignal);
}
@@ -3428,6 +4003,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
}
}
+ if (iconstant.const_doc) {
+ iconstant.is_deprecated = iconstant.const_doc->is_deprecated;
+ iconstant.deprecation_message = iconstant.const_doc->deprecated_message;
+
+ if (iconstant.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Enum member: '" + itype.proxy_name + "." + ienum.proxy_name + "." + iconstant.proxy_name + "'.");
+ iconstant.deprecation_message = "This enum member is deprecated.";
+ }
+ }
+
ienum.constants.push_back(iconstant);
}
@@ -3470,6 +4055,16 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
}
}
+ if (iconstant.const_doc) {
+ iconstant.is_deprecated = iconstant.const_doc->is_deprecated;
+ iconstant.deprecation_message = iconstant.const_doc->deprecated_message;
+
+ if (iconstant.deprecation_message.is_empty()) {
+ WARN_PRINT("An empty deprecation message is discouraged. Constant: '" + itype.proxy_name + "." + iconstant.proxy_name + "'.");
+ iconstant.deprecation_message = "This constant is deprecated.";
+ }
+ }
+
itype.constants.push_back(iconstant);
}
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index aa4e5ea093..bb0ba0cb00 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -47,7 +47,10 @@ class BindingsGenerator {
String name;
String proxy_name;
int64_t value = 0;
- const DocData::ConstantDoc *const_doc;
+ const DocData::ConstantDoc *const_doc = nullptr;
+
+ bool is_deprecated = false;
+ String deprecation_message;
ConstantInterface() {}
@@ -86,6 +89,9 @@ class BindingsGenerator {
StringName getter;
const DocData::PropertyDoc *prop_doc;
+
+ bool is_deprecated = false;
+ String deprecation_message;
};
struct TypeReference {
@@ -427,6 +433,9 @@ class BindingsGenerator {
const DocData::ClassDoc *class_doc = nullptr;
+ bool is_deprecated = false;
+ String deprecation_message;
+
List<ConstantInterface> constants;
List<EnumInterface> enums;
List<PropertyInterface> properties;
@@ -765,8 +774,18 @@ class BindingsGenerator {
return p_type->name;
}
+ String bbcode_to_text(const String &p_bbcode, const TypeInterface *p_itype);
String bbcode_to_xml(const String &p_bbcode, const TypeInterface *p_itype, bool p_is_signal = false);
+ void _append_text_method(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
+ void _append_text_member(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
+ void _append_text_signal(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
+ void _append_text_enum(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
+ void _append_text_constant(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
+ void _append_text_constant_in_global_scope(StringBuilder &p_output, const String &p_target_cname, const String &p_link_target);
+ void _append_text_param(StringBuilder &p_output, const String &p_link_target);
+ void _append_text_undeclared(StringBuilder &p_output, const String &p_link_target);
+
void _append_xml_method(StringBuilder &p_xml_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
void _append_xml_member(StringBuilder &p_xml_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
void _append_xml_signal(StringBuilder &p_xml_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
index bd92e48bce..8f1bc109c0 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
@@ -492,7 +492,10 @@ namespace Godot
}
/// <summary>
- /// Returns this vector projected onto another vector <paramref name="onNormal"/>.
+ /// Returns a new vector resulting from projecting this vector onto the given vector <paramref name="onNormal"/>.
+ /// The resulting new vector is parallel to <paramref name="onNormal"/>.
+ /// See also <see cref="Slide(Vector2)"/>.
+ /// Note: If the vector <paramref name="onNormal"/> is a zero vector, the components of the resulting new vector will be <see cref="real_t.NaN"/>.
/// </summary>
/// <param name="onNormal">The vector to project onto.</param>
/// <returns>The projected vector.</returns>
@@ -583,9 +586,12 @@ namespace Godot
}
/// <summary>
- /// Returns this vector slid along a plane defined by the given <paramref name="normal"/>.
+ /// Returns a new vector resulting from sliding this vector along a line with normal <paramref name="normal"/>.
+ /// The resulting new vector is perpendicular to <paramref name="normal"/>, and is equivalent to this vector minus its projection on <paramref name="normal"/>.
+ /// See also <see cref="Project(Vector2)"/>.
+ /// Note: The vector <paramref name="normal"/> must be normalized. See also <see cref="Normalized()"/>.
/// </summary>
- /// <param name="normal">The normal vector defining the plane to slide on.</param>
+ /// <param name="normal">The normal vector of the plane to slide on.</param>
/// <returns>The slid vector.</returns>
public readonly Vector2 Slide(Vector2 normal)
{
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
index 6e77512fc8..74c1616e3d 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs
@@ -514,7 +514,10 @@ namespace Godot
}
/// <summary>
- /// Returns this vector projected onto another vector <paramref name="onNormal"/>.
+ /// Returns a new vector resulting from projecting this vector onto the given vector <paramref name="onNormal"/>.
+ /// The resulting new vector is parallel to <paramref name="onNormal"/>.
+ /// See also <see cref="Slide(Vector3)"/>.
+ /// Note: If the vector <paramref name="onNormal"/> is a zero vector, the components of the resulting new vector will be <see cref="real_t.NaN"/>.
/// </summary>
/// <param name="onNormal">The vector to project onto.</param>
/// <returns>The projected vector.</returns>
@@ -626,9 +629,12 @@ namespace Godot
}
/// <summary>
- /// Returns this vector slid along a plane defined by the given <paramref name="normal"/>.
+ /// Returns a new vector resulting from sliding this vector along a plane with normal <paramref name="normal"/>.
+ /// The resulting new vector is perpendicular to <paramref name="normal"/>, and is equivalent to this vector minus its projection on <paramref name="normal"/>.
+ /// See also <see cref="Project(Vector3)"/>.
+ /// Note: The vector <paramref name="normal"/> must be normalized. See also <see cref="Normalized()"/>.
/// </summary>
- /// <param name="normal">The normal vector defining the plane to slide on.</param>
+ /// <param name="normal">The normal vector of the plane to slide on.</param>
/// <returns>The slid vector.</returns>
public readonly Vector3 Slide(Vector3 normal)
{
diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp
index 51974e7767..f6df212d35 100644
--- a/modules/multiplayer/editor/replication_editor.cpp
+++ b/modules/multiplayer/editor/replication_editor.cpp
@@ -292,7 +292,7 @@ ReplicationEditor::ReplicationEditor() {
vb->add_child(tree);
drop_label = memnew(Label);
- drop_label->set_text(TTR("Add properties using the options above, or\ndrag them them from the inspector and drop them here."));
+ drop_label->set_text(TTR("Add properties using the options above, or\ndrag them from the inspector and drop them here."));
drop_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
drop_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
tree->add_child(drop_label);
diff --git a/modules/multiplayer/scene_multiplayer.cpp b/modules/multiplayer/scene_multiplayer.cpp
index 6f7a3493a1..99aba680cc 100644
--- a/modules/multiplayer/scene_multiplayer.cpp
+++ b/modules/multiplayer/scene_multiplayer.cpp
@@ -428,7 +428,7 @@ void SceneMultiplayer::disconnect_peer(int p_id) {
if (pending_peers.has(p_id)) {
pending_peers.erase(p_id);
} else if (connected_peers.has(p_id)) {
- connected_peers.has(p_id);
+ connected_peers.erase(p_id);
}
multiplayer_peer->disconnect_peer(p_id);
}
diff --git a/modules/multiplayer/scene_replication_interface.cpp b/modules/multiplayer/scene_replication_interface.cpp
index b61cf0bf1d..bb32eed1a9 100644
--- a/modules/multiplayer/scene_replication_interface.cpp
+++ b/modules/multiplayer/scene_replication_interface.cpp
@@ -421,7 +421,7 @@ Error SceneReplicationInterface::_update_spawn_visibility(int p_peer, const Obje
// Check visibility for each peers.
for (const KeyValue<int, PeerInfo> &E : peers_info) {
if (is_visible) {
- // This is fast, since the the object is visible to everyone, we don't need to check each peer.
+ // This is fast, since the object is visible to everyone, we don't need to check each peer.
if (E.value.spawn_nodes.has(p_oid)) {
// Already spawned.
continue;
diff --git a/modules/navigation/godot_navigation_server_2d.cpp b/modules/navigation/2d/godot_navigation_server_2d.cpp
index 28bcd16310..28bcd16310 100644
--- a/modules/navigation/godot_navigation_server_2d.cpp
+++ b/modules/navigation/2d/godot_navigation_server_2d.cpp
diff --git a/modules/navigation/godot_navigation_server_2d.h b/modules/navigation/2d/godot_navigation_server_2d.h
index 225fd8f3a6..a148887a65 100644
--- a/modules/navigation/godot_navigation_server_2d.h
+++ b/modules/navigation/2d/godot_navigation_server_2d.h
@@ -31,11 +31,11 @@
#ifndef GODOT_NAVIGATION_SERVER_2D_H
#define GODOT_NAVIGATION_SERVER_2D_H
-#include "nav_agent.h"
-#include "nav_link.h"
-#include "nav_map.h"
-#include "nav_obstacle.h"
-#include "nav_region.h"
+#include "../nav_agent.h"
+#include "../nav_link.h"
+#include "../nav_map.h"
+#include "../nav_obstacle.h"
+#include "../nav_region.h"
#include "servers/navigation_server_2d.h"
diff --git a/modules/navigation/nav_mesh_generator_2d.cpp b/modules/navigation/2d/nav_mesh_generator_2d.cpp
index 836dee8178..9fdfb20842 100644
--- a/modules/navigation/nav_mesh_generator_2d.cpp
+++ b/modules/navigation/2d/nav_mesh_generator_2d.cpp
@@ -38,13 +38,13 @@
#include "scene/2d/physics_body_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/2d/tile_map.h"
-#include "scene/resources/capsule_shape_2d.h"
-#include "scene/resources/circle_shape_2d.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/capsule_shape_2d.h"
+#include "scene/resources/2d/circle_shape_2d.h"
+#include "scene/resources/2d/concave_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/rectangle_shape_2d.h"
#include "scene/resources/navigation_mesh_source_geometry_data_2d.h"
#include "scene/resources/navigation_polygon.h"
-#include "scene/resources/rectangle_shape_2d.h"
#include "thirdparty/clipper2/include/clipper2/clipper.h"
#include "thirdparty/misc/polypartition.h"
diff --git a/modules/navigation/nav_mesh_generator_2d.h b/modules/navigation/2d/nav_mesh_generator_2d.h
index b606f3f6fc..b606f3f6fc 100644
--- a/modules/navigation/nav_mesh_generator_2d.h
+++ b/modules/navigation/2d/nav_mesh_generator_2d.h
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/3d/godot_navigation_server_3d.cpp
index a3b23da6b6..d293b9edbe 100644
--- a/modules/navigation/godot_navigation_server.cpp
+++ b/modules/navigation/3d/godot_navigation_server_3d.cpp
@@ -1,5 +1,5 @@
/**************************************************************************/
-/* godot_navigation_server.cpp */
+/* godot_navigation_server_3d.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
-#include "godot_navigation_server.h"
+#include "godot_navigation_server_3d.h"
#ifndef _3D_DISABLED
#include "nav_mesh_generator_3d.h"
@@ -42,58 +42,58 @@ using namespace NavigationUtilities;
/// an instance of that struct with the submitted parameters.
/// Then, that struct is stored in an array; the `sync` function consume that array.
-#define COMMAND_1(F_NAME, T_0, D_0) \
- struct MERGE(F_NAME, _command) : public SetCommand { \
- T_0 d_0; \
- MERGE(F_NAME, _command) \
- (T_0 p_d_0) : \
- d_0(p_d_0) {} \
- virtual void exec(GodotNavigationServer *server) override { \
- server->MERGE(_cmd_, F_NAME)(d_0); \
- } \
- }; \
- void GodotNavigationServer::F_NAME(T_0 D_0) { \
- auto cmd = memnew(MERGE(F_NAME, _command)( \
- D_0)); \
- add_command(cmd); \
- } \
- void GodotNavigationServer::MERGE(_cmd_, F_NAME)(T_0 D_0)
-
-#define COMMAND_2(F_NAME, T_0, D_0, T_1, D_1) \
- struct MERGE(F_NAME, _command) : public SetCommand { \
- T_0 d_0; \
- T_1 d_1; \
- MERGE(F_NAME, _command) \
- ( \
- T_0 p_d_0, \
- T_1 p_d_1) : \
- d_0(p_d_0), \
- d_1(p_d_1) {} \
- virtual void exec(GodotNavigationServer *server) override { \
- server->MERGE(_cmd_, F_NAME)(d_0, d_1); \
- } \
- }; \
- void GodotNavigationServer::F_NAME(T_0 D_0, T_1 D_1) { \
- auto cmd = memnew(MERGE(F_NAME, _command)( \
- D_0, \
- D_1)); \
- add_command(cmd); \
- } \
- void GodotNavigationServer::MERGE(_cmd_, F_NAME)(T_0 D_0, T_1 D_1)
-
-GodotNavigationServer::GodotNavigationServer() {}
-
-GodotNavigationServer::~GodotNavigationServer() {
+#define COMMAND_1(F_NAME, T_0, D_0) \
+ struct MERGE(F_NAME, _command) : public SetCommand { \
+ T_0 d_0; \
+ MERGE(F_NAME, _command) \
+ (T_0 p_d_0) : \
+ d_0(p_d_0) {} \
+ virtual void exec(GodotNavigationServer3D *server) override { \
+ server->MERGE(_cmd_, F_NAME)(d_0); \
+ } \
+ }; \
+ void GodotNavigationServer3D::F_NAME(T_0 D_0) { \
+ auto cmd = memnew(MERGE(F_NAME, _command)( \
+ D_0)); \
+ add_command(cmd); \
+ } \
+ void GodotNavigationServer3D::MERGE(_cmd_, F_NAME)(T_0 D_0)
+
+#define COMMAND_2(F_NAME, T_0, D_0, T_1, D_1) \
+ struct MERGE(F_NAME, _command) : public SetCommand { \
+ T_0 d_0; \
+ T_1 d_1; \
+ MERGE(F_NAME, _command) \
+ ( \
+ T_0 p_d_0, \
+ T_1 p_d_1) : \
+ d_0(p_d_0), \
+ d_1(p_d_1) {} \
+ virtual void exec(GodotNavigationServer3D *server) override { \
+ server->MERGE(_cmd_, F_NAME)(d_0, d_1); \
+ } \
+ }; \
+ void GodotNavigationServer3D::F_NAME(T_0 D_0, T_1 D_1) { \
+ auto cmd = memnew(MERGE(F_NAME, _command)( \
+ D_0, \
+ D_1)); \
+ add_command(cmd); \
+ } \
+ void GodotNavigationServer3D::MERGE(_cmd_, F_NAME)(T_0 D_0, T_1 D_1)
+
+GodotNavigationServer3D::GodotNavigationServer3D() {}
+
+GodotNavigationServer3D::~GodotNavigationServer3D() {
flush_queries();
}
-void GodotNavigationServer::add_command(SetCommand *command) {
+void GodotNavigationServer3D::add_command(SetCommand *command) {
MutexLock lock(commands_mutex);
commands.push_back(command);
}
-TypedArray<RID> GodotNavigationServer::get_maps() const {
+TypedArray<RID> GodotNavigationServer3D::get_maps() const {
TypedArray<RID> all_map_rids;
List<RID> maps_owned;
map_owner.get_owned_list(&maps_owned);
@@ -105,7 +105,7 @@ TypedArray<RID> GodotNavigationServer::get_maps() const {
return all_map_rids;
}
-RID GodotNavigationServer::map_create() {
+RID GodotNavigationServer3D::map_create() {
MutexLock lock(operations_mutex);
RID rid = map_owner.make_rid();
@@ -131,7 +131,7 @@ COMMAND_2(map_set_active, RID, p_map, bool, p_active) {
}
}
-bool GodotNavigationServer::map_is_active(RID p_map) const {
+bool GodotNavigationServer3D::map_is_active(RID p_map) const {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, false);
@@ -145,7 +145,7 @@ COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) {
map->set_up(p_up);
}
-Vector3 GodotNavigationServer::map_get_up(RID p_map) const {
+Vector3 GodotNavigationServer3D::map_get_up(RID p_map) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector3());
@@ -159,7 +159,7 @@ COMMAND_2(map_set_cell_size, RID, p_map, real_t, p_cell_size) {
map->set_cell_size(p_cell_size);
}
-real_t GodotNavigationServer::map_get_cell_size(RID p_map) const {
+real_t GodotNavigationServer3D::map_get_cell_size(RID p_map) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, 0);
@@ -173,7 +173,7 @@ COMMAND_2(map_set_cell_height, RID, p_map, real_t, p_cell_height) {
map->set_cell_height(p_cell_height);
}
-real_t GodotNavigationServer::map_get_cell_height(RID p_map) const {
+real_t GodotNavigationServer3D::map_get_cell_height(RID p_map) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, 0);
@@ -187,7 +187,7 @@ COMMAND_2(map_set_merge_rasterizer_cell_scale, RID, p_map, float, p_value) {
map->set_merge_rasterizer_cell_scale(p_value);
}
-float GodotNavigationServer::map_get_merge_rasterizer_cell_scale(RID p_map) const {
+float GodotNavigationServer3D::map_get_merge_rasterizer_cell_scale(RID p_map) const {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, false);
@@ -201,7 +201,7 @@ COMMAND_2(map_set_use_edge_connections, RID, p_map, bool, p_enabled) {
map->set_use_edge_connections(p_enabled);
}
-bool GodotNavigationServer::map_get_use_edge_connections(RID p_map) const {
+bool GodotNavigationServer3D::map_get_use_edge_connections(RID p_map) const {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, false);
@@ -215,7 +215,7 @@ COMMAND_2(map_set_edge_connection_margin, RID, p_map, real_t, p_connection_margi
map->set_edge_connection_margin(p_connection_margin);
}
-real_t GodotNavigationServer::map_get_edge_connection_margin(RID p_map) const {
+real_t GodotNavigationServer3D::map_get_edge_connection_margin(RID p_map) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, 0);
@@ -229,49 +229,49 @@ COMMAND_2(map_set_link_connection_radius, RID, p_map, real_t, p_connection_radiu
map->set_link_connection_radius(p_connection_radius);
}
-real_t GodotNavigationServer::map_get_link_connection_radius(RID p_map) const {
+real_t GodotNavigationServer3D::map_get_link_connection_radius(RID p_map) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, 0);
return map->get_link_connection_radius();
}
-Vector<Vector3> GodotNavigationServer::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize, uint32_t p_navigation_layers) const {
+Vector<Vector3> GodotNavigationServer3D::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize, uint32_t p_navigation_layers) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector<Vector3>());
return map->get_path(p_origin, p_destination, p_optimize, p_navigation_layers, nullptr, nullptr, nullptr);
}
-Vector3 GodotNavigationServer::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
+Vector3 GodotNavigationServer3D::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector3());
return map->get_closest_point_to_segment(p_from, p_to, p_use_collision);
}
-Vector3 GodotNavigationServer::map_get_closest_point(RID p_map, const Vector3 &p_point) const {
+Vector3 GodotNavigationServer3D::map_get_closest_point(RID p_map, const Vector3 &p_point) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector3());
return map->get_closest_point(p_point);
}
-Vector3 GodotNavigationServer::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const {
+Vector3 GodotNavigationServer3D::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector3());
return map->get_closest_point_normal(p_point);
}
-RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const {
+RID GodotNavigationServer3D::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, RID());
return map->get_closest_point_owner(p_point);
}
-TypedArray<RID> GodotNavigationServer::map_get_links(RID p_map) const {
+TypedArray<RID> GodotNavigationServer3D::map_get_links(RID p_map) const {
TypedArray<RID> link_rids;
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, link_rids);
@@ -285,7 +285,7 @@ TypedArray<RID> GodotNavigationServer::map_get_links(RID p_map) const {
return link_rids;
}
-TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const {
+TypedArray<RID> GodotNavigationServer3D::map_get_regions(RID p_map) const {
TypedArray<RID> regions_rids;
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, regions_rids);
@@ -299,7 +299,7 @@ TypedArray<RID> GodotNavigationServer::map_get_regions(RID p_map) const {
return regions_rids;
}
-TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const {
+TypedArray<RID> GodotNavigationServer3D::map_get_agents(RID p_map) const {
TypedArray<RID> agents_rids;
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, agents_rids);
@@ -313,7 +313,7 @@ TypedArray<RID> GodotNavigationServer::map_get_agents(RID p_map) const {
return agents_rids;
}
-TypedArray<RID> GodotNavigationServer::map_get_obstacles(RID p_map) const {
+TypedArray<RID> GodotNavigationServer3D::map_get_obstacles(RID p_map) const {
TypedArray<RID> obstacles_rids;
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, obstacles_rids);
@@ -325,7 +325,7 @@ TypedArray<RID> GodotNavigationServer::map_get_obstacles(RID p_map) const {
return obstacles_rids;
}
-RID GodotNavigationServer::region_get_map(RID p_region) const {
+RID GodotNavigationServer3D::region_get_map(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, RID());
@@ -335,7 +335,7 @@ RID GodotNavigationServer::region_get_map(RID p_region) const {
return RID();
}
-RID GodotNavigationServer::agent_get_map(RID p_agent) const {
+RID GodotNavigationServer3D::agent_get_map(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, RID());
@@ -345,14 +345,14 @@ RID GodotNavigationServer::agent_get_map(RID p_agent) const {
return RID();
}
-Vector3 GodotNavigationServer::map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const {
+Vector3 GodotNavigationServer3D::map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const {
const NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, Vector3());
return map->get_random_point(p_navigation_layers, p_uniformly);
}
-RID GodotNavigationServer::region_create() {
+RID GodotNavigationServer3D::region_create() {
MutexLock lock(operations_mutex);
RID rid = region_owner.make_rid();
@@ -368,7 +368,7 @@ COMMAND_2(region_set_enabled, RID, p_region, bool, p_enabled) {
region->set_enabled(p_enabled);
}
-bool GodotNavigationServer::region_get_enabled(RID p_region) const {
+bool GodotNavigationServer3D::region_get_enabled(RID p_region) const {
const NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, false);
@@ -382,7 +382,7 @@ COMMAND_2(region_set_use_edge_connections, RID, p_region, bool, p_enabled) {
region->set_use_edge_connections(p_enabled);
}
-bool GodotNavigationServer::region_get_use_edge_connections(RID p_region) const {
+bool GodotNavigationServer3D::region_get_use_edge_connections(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, false);
@@ -405,7 +405,7 @@ COMMAND_2(region_set_transform, RID, p_region, Transform3D, p_transform) {
region->set_transform(p_transform);
}
-Transform3D GodotNavigationServer::region_get_transform(RID p_region) const {
+Transform3D GodotNavigationServer3D::region_get_transform(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, Transform3D());
@@ -420,7 +420,7 @@ COMMAND_2(region_set_enter_cost, RID, p_region, real_t, p_enter_cost) {
region->set_enter_cost(p_enter_cost);
}
-real_t GodotNavigationServer::region_get_enter_cost(RID p_region) const {
+real_t GodotNavigationServer3D::region_get_enter_cost(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, 0);
@@ -435,7 +435,7 @@ COMMAND_2(region_set_travel_cost, RID, p_region, real_t, p_travel_cost) {
region->set_travel_cost(p_travel_cost);
}
-real_t GodotNavigationServer::region_get_travel_cost(RID p_region) const {
+real_t GodotNavigationServer3D::region_get_travel_cost(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, 0);
@@ -449,14 +449,14 @@ COMMAND_2(region_set_owner_id, RID, p_region, ObjectID, p_owner_id) {
region->set_owner_id(p_owner_id);
}
-ObjectID GodotNavigationServer::region_get_owner_id(RID p_region) const {
+ObjectID GodotNavigationServer3D::region_get_owner_id(RID p_region) const {
const NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, ObjectID());
return region->get_owner_id();
}
-bool GodotNavigationServer::region_owns_point(RID p_region, const Vector3 &p_point) const {
+bool GodotNavigationServer3D::region_owns_point(RID p_region, const Vector3 &p_point) const {
const NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, false);
@@ -474,7 +474,7 @@ COMMAND_2(region_set_navigation_layers, RID, p_region, uint32_t, p_navigation_la
region->set_navigation_layers(p_navigation_layers);
}
-uint32_t GodotNavigationServer::region_get_navigation_layers(RID p_region) const {
+uint32_t GodotNavigationServer3D::region_get_navigation_layers(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, 0);
@@ -489,7 +489,7 @@ COMMAND_2(region_set_navigation_mesh, RID, p_region, Ref<NavigationMesh>, p_navi
}
#ifndef DISABLE_DEPRECATED
-void GodotNavigationServer::region_bake_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh, Node *p_root_node) {
+void GodotNavigationServer3D::region_bake_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh, Node *p_root_node) {
ERR_FAIL_COND(p_navigation_mesh.is_null());
ERR_FAIL_NULL(p_root_node);
@@ -505,35 +505,35 @@ void GodotNavigationServer::region_bake_navigation_mesh(Ref<NavigationMesh> p_na
}
#endif // DISABLE_DEPRECATED
-int GodotNavigationServer::region_get_connections_count(RID p_region) const {
+int GodotNavigationServer3D::region_get_connections_count(RID p_region) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, 0);
return region->get_connections_count();
}
-Vector3 GodotNavigationServer::region_get_connection_pathway_start(RID p_region, int p_connection_id) const {
+Vector3 GodotNavigationServer3D::region_get_connection_pathway_start(RID p_region, int p_connection_id) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, Vector3());
return region->get_connection_pathway_start(p_connection_id);
}
-Vector3 GodotNavigationServer::region_get_connection_pathway_end(RID p_region, int p_connection_id) const {
+Vector3 GodotNavigationServer3D::region_get_connection_pathway_end(RID p_region, int p_connection_id) const {
NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, Vector3());
return region->get_connection_pathway_end(p_connection_id);
}
-Vector3 GodotNavigationServer::region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const {
+Vector3 GodotNavigationServer3D::region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const {
const NavRegion *region = region_owner.get_or_null(p_region);
ERR_FAIL_NULL_V(region, Vector3());
return region->get_random_point(p_navigation_layers, p_uniformly);
}
-RID GodotNavigationServer::link_create() {
+RID GodotNavigationServer3D::link_create() {
MutexLock lock(operations_mutex);
RID rid = link_owner.make_rid();
@@ -551,7 +551,7 @@ COMMAND_2(link_set_map, RID, p_link, RID, p_map) {
link->set_map(map);
}
-RID GodotNavigationServer::link_get_map(const RID p_link) const {
+RID GodotNavigationServer3D::link_get_map(const RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, RID());
@@ -568,7 +568,7 @@ COMMAND_2(link_set_enabled, RID, p_link, bool, p_enabled) {
link->set_enabled(p_enabled);
}
-bool GodotNavigationServer::link_get_enabled(RID p_link) const {
+bool GodotNavigationServer3D::link_get_enabled(RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, false);
@@ -582,7 +582,7 @@ COMMAND_2(link_set_bidirectional, RID, p_link, bool, p_bidirectional) {
link->set_bidirectional(p_bidirectional);
}
-bool GodotNavigationServer::link_is_bidirectional(RID p_link) const {
+bool GodotNavigationServer3D::link_is_bidirectional(RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, false);
@@ -596,7 +596,7 @@ COMMAND_2(link_set_navigation_layers, RID, p_link, uint32_t, p_navigation_layers
link->set_navigation_layers(p_navigation_layers);
}
-uint32_t GodotNavigationServer::link_get_navigation_layers(const RID p_link) const {
+uint32_t GodotNavigationServer3D::link_get_navigation_layers(const RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, 0);
@@ -610,7 +610,7 @@ COMMAND_2(link_set_start_position, RID, p_link, Vector3, p_position) {
link->set_start_position(p_position);
}
-Vector3 GodotNavigationServer::link_get_start_position(RID p_link) const {
+Vector3 GodotNavigationServer3D::link_get_start_position(RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, Vector3());
@@ -624,7 +624,7 @@ COMMAND_2(link_set_end_position, RID, p_link, Vector3, p_position) {
link->set_end_position(p_position);
}
-Vector3 GodotNavigationServer::link_get_end_position(RID p_link) const {
+Vector3 GodotNavigationServer3D::link_get_end_position(RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, Vector3());
@@ -638,7 +638,7 @@ COMMAND_2(link_set_enter_cost, RID, p_link, real_t, p_enter_cost) {
link->set_enter_cost(p_enter_cost);
}
-real_t GodotNavigationServer::link_get_enter_cost(const RID p_link) const {
+real_t GodotNavigationServer3D::link_get_enter_cost(const RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, 0);
@@ -652,7 +652,7 @@ COMMAND_2(link_set_travel_cost, RID, p_link, real_t, p_travel_cost) {
link->set_travel_cost(p_travel_cost);
}
-real_t GodotNavigationServer::link_get_travel_cost(const RID p_link) const {
+real_t GodotNavigationServer3D::link_get_travel_cost(const RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, 0);
@@ -666,14 +666,14 @@ COMMAND_2(link_set_owner_id, RID, p_link, ObjectID, p_owner_id) {
link->set_owner_id(p_owner_id);
}
-ObjectID GodotNavigationServer::link_get_owner_id(RID p_link) const {
+ObjectID GodotNavigationServer3D::link_get_owner_id(RID p_link) const {
const NavLink *link = link_owner.get_or_null(p_link);
ERR_FAIL_NULL_V(link, ObjectID());
return link->get_owner_id();
}
-RID GodotNavigationServer::agent_create() {
+RID GodotNavigationServer3D::agent_create() {
MutexLock lock(operations_mutex);
RID rid = agent_owner.make_rid();
@@ -689,7 +689,7 @@ COMMAND_2(agent_set_avoidance_enabled, RID, p_agent, bool, p_enabled) {
agent->set_avoidance_enabled(p_enabled);
}
-bool GodotNavigationServer::agent_get_avoidance_enabled(RID p_agent) const {
+bool GodotNavigationServer3D::agent_get_avoidance_enabled(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, false);
@@ -703,7 +703,7 @@ COMMAND_2(agent_set_use_3d_avoidance, RID, p_agent, bool, p_enabled) {
agent->set_use_3d_avoidance(p_enabled);
}
-bool GodotNavigationServer::agent_get_use_3d_avoidance(RID p_agent) const {
+bool GodotNavigationServer3D::agent_get_use_3d_avoidance(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, false);
@@ -726,7 +726,7 @@ COMMAND_2(agent_set_paused, RID, p_agent, bool, p_paused) {
agent->set_paused(p_paused);
}
-bool GodotNavigationServer::agent_get_paused(RID p_agent) const {
+bool GodotNavigationServer3D::agent_get_paused(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, false);
@@ -740,7 +740,7 @@ COMMAND_2(agent_set_neighbor_distance, RID, p_agent, real_t, p_distance) {
agent->set_neighbor_distance(p_distance);
}
-real_t GodotNavigationServer::agent_get_neighbor_distance(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_neighbor_distance(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -754,7 +754,7 @@ COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count) {
agent->set_max_neighbors(p_count);
}
-int GodotNavigationServer::agent_get_max_neighbors(RID p_agent) const {
+int GodotNavigationServer3D::agent_get_max_neighbors(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -769,7 +769,7 @@ COMMAND_2(agent_set_time_horizon_agents, RID, p_agent, real_t, p_time_horizon) {
agent->set_time_horizon_agents(p_time_horizon);
}
-real_t GodotNavigationServer::agent_get_time_horizon_agents(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_time_horizon_agents(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -784,7 +784,7 @@ COMMAND_2(agent_set_time_horizon_obstacles, RID, p_agent, real_t, p_time_horizon
agent->set_time_horizon_obstacles(p_time_horizon);
}
-real_t GodotNavigationServer::agent_get_time_horizon_obstacles(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_time_horizon_obstacles(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -799,7 +799,7 @@ COMMAND_2(agent_set_radius, RID, p_agent, real_t, p_radius) {
agent->set_radius(p_radius);
}
-real_t GodotNavigationServer::agent_get_radius(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_radius(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -814,7 +814,7 @@ COMMAND_2(agent_set_height, RID, p_agent, real_t, p_height) {
agent->set_height(p_height);
}
-real_t GodotNavigationServer::agent_get_height(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_height(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -829,7 +829,7 @@ COMMAND_2(agent_set_max_speed, RID, p_agent, real_t, p_max_speed) {
agent->set_max_speed(p_max_speed);
}
-real_t GodotNavigationServer::agent_get_max_speed(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_max_speed(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -843,7 +843,7 @@ COMMAND_2(agent_set_velocity, RID, p_agent, Vector3, p_velocity) {
agent->set_velocity(p_velocity);
}
-Vector3 GodotNavigationServer::agent_get_velocity(RID p_agent) const {
+Vector3 GodotNavigationServer3D::agent_get_velocity(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, Vector3());
@@ -864,14 +864,14 @@ COMMAND_2(agent_set_position, RID, p_agent, Vector3, p_position) {
agent->set_position(p_position);
}
-Vector3 GodotNavigationServer::agent_get_position(RID p_agent) const {
+Vector3 GodotNavigationServer3D::agent_get_position(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, Vector3());
return agent->get_position();
}
-bool GodotNavigationServer::agent_is_map_changed(RID p_agent) const {
+bool GodotNavigationServer3D::agent_is_map_changed(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, false);
@@ -893,7 +893,7 @@ COMMAND_2(agent_set_avoidance_callback, RID, p_agent, Callable, p_callback) {
}
}
-bool GodotNavigationServer::agent_has_avoidance_callback(RID p_agent) const {
+bool GodotNavigationServer3D::agent_has_avoidance_callback(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, false);
@@ -906,7 +906,7 @@ COMMAND_2(agent_set_avoidance_layers, RID, p_agent, uint32_t, p_layers) {
agent->set_avoidance_layers(p_layers);
}
-uint32_t GodotNavigationServer::agent_get_avoidance_layers(RID p_agent) const {
+uint32_t GodotNavigationServer3D::agent_get_avoidance_layers(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -919,7 +919,7 @@ COMMAND_2(agent_set_avoidance_mask, RID, p_agent, uint32_t, p_mask) {
agent->set_avoidance_mask(p_mask);
}
-uint32_t GodotNavigationServer::agent_get_avoidance_mask(RID p_agent) const {
+uint32_t GodotNavigationServer3D::agent_get_avoidance_mask(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
@@ -934,14 +934,14 @@ COMMAND_2(agent_set_avoidance_priority, RID, p_agent, real_t, p_priority) {
agent->set_avoidance_priority(p_priority);
}
-real_t GodotNavigationServer::agent_get_avoidance_priority(RID p_agent) const {
+real_t GodotNavigationServer3D::agent_get_avoidance_priority(RID p_agent) const {
NavAgent *agent = agent_owner.get_or_null(p_agent);
ERR_FAIL_NULL_V(agent, 0);
return agent->get_avoidance_priority();
}
-RID GodotNavigationServer::obstacle_create() {
+RID GodotNavigationServer3D::obstacle_create() {
MutexLock lock(operations_mutex);
RID rid = obstacle_owner.make_rid();
@@ -964,7 +964,7 @@ COMMAND_2(obstacle_set_avoidance_enabled, RID, p_obstacle, bool, p_enabled) {
obstacle->set_avoidance_enabled(p_enabled);
}
-bool GodotNavigationServer::obstacle_get_avoidance_enabled(RID p_obstacle) const {
+bool GodotNavigationServer3D::obstacle_get_avoidance_enabled(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, false);
@@ -978,7 +978,7 @@ COMMAND_2(obstacle_set_use_3d_avoidance, RID, p_obstacle, bool, p_enabled) {
obstacle->set_use_3d_avoidance(p_enabled);
}
-bool GodotNavigationServer::obstacle_get_use_3d_avoidance(RID p_obstacle) const {
+bool GodotNavigationServer3D::obstacle_get_use_3d_avoidance(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, false);
@@ -994,7 +994,7 @@ COMMAND_2(obstacle_set_map, RID, p_obstacle, RID, p_map) {
obstacle->set_map(map);
}
-RID GodotNavigationServer::obstacle_get_map(RID p_obstacle) const {
+RID GodotNavigationServer3D::obstacle_get_map(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, RID());
if (obstacle->get_map()) {
@@ -1010,7 +1010,7 @@ COMMAND_2(obstacle_set_paused, RID, p_obstacle, bool, p_paused) {
obstacle->set_paused(p_paused);
}
-bool GodotNavigationServer::obstacle_get_paused(RID p_obstacle) const {
+bool GodotNavigationServer3D::obstacle_get_paused(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, false);
@@ -1025,7 +1025,7 @@ COMMAND_2(obstacle_set_radius, RID, p_obstacle, real_t, p_radius) {
obstacle->set_radius(p_radius);
}
-real_t GodotNavigationServer::obstacle_get_radius(RID p_obstacle) const {
+real_t GodotNavigationServer3D::obstacle_get_radius(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, 0);
@@ -1038,7 +1038,7 @@ COMMAND_2(obstacle_set_height, RID, p_obstacle, real_t, p_height) {
obstacle->set_height(p_height);
}
-real_t GodotNavigationServer::obstacle_get_height(RID p_obstacle) const {
+real_t GodotNavigationServer3D::obstacle_get_height(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, 0);
@@ -1052,7 +1052,7 @@ COMMAND_2(obstacle_set_velocity, RID, p_obstacle, Vector3, p_velocity) {
obstacle->set_velocity(p_velocity);
}
-Vector3 GodotNavigationServer::obstacle_get_velocity(RID p_obstacle) const {
+Vector3 GodotNavigationServer3D::obstacle_get_velocity(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, Vector3());
@@ -1065,20 +1065,20 @@ COMMAND_2(obstacle_set_position, RID, p_obstacle, Vector3, p_position) {
obstacle->set_position(p_position);
}
-Vector3 GodotNavigationServer::obstacle_get_position(RID p_obstacle) const {
+Vector3 GodotNavigationServer3D::obstacle_get_position(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, Vector3());
return obstacle->get_position();
}
-void GodotNavigationServer::obstacle_set_vertices(RID p_obstacle, const Vector<Vector3> &p_vertices) {
+void GodotNavigationServer3D::obstacle_set_vertices(RID p_obstacle, const Vector<Vector3> &p_vertices) {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL(obstacle);
obstacle->set_vertices(p_vertices);
}
-Vector<Vector3> GodotNavigationServer::obstacle_get_vertices(RID p_obstacle) const {
+Vector<Vector3> GodotNavigationServer3D::obstacle_get_vertices(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, Vector<Vector3>());
@@ -1091,14 +1091,14 @@ COMMAND_2(obstacle_set_avoidance_layers, RID, p_obstacle, uint32_t, p_layers) {
obstacle->set_avoidance_layers(p_layers);
}
-uint32_t GodotNavigationServer::obstacle_get_avoidance_layers(RID p_obstacle) const {
+uint32_t GodotNavigationServer3D::obstacle_get_avoidance_layers(RID p_obstacle) const {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_obstacle);
ERR_FAIL_NULL_V(obstacle, 0);
return obstacle->get_avoidance_layers();
}
-void GodotNavigationServer::parse_source_geometry_data(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, Node *p_root_node, const Callable &p_callback) {
+void GodotNavigationServer3D::parse_source_geometry_data(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, Node *p_root_node, const Callable &p_callback) {
#ifndef _3D_DISABLED
ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "The SceneTree can only be parsed on the main thread. Call this function from the main thread or use call_deferred().");
ERR_FAIL_COND_MSG(!p_navigation_mesh.is_valid(), "Invalid navigation mesh.");
@@ -1110,7 +1110,7 @@ void GodotNavigationServer::parse_source_geometry_data(const Ref<NavigationMesh>
#endif // _3D_DISABLED
}
-void GodotNavigationServer::bake_from_source_geometry_data(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, const Callable &p_callback) {
+void GodotNavigationServer3D::bake_from_source_geometry_data(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, const Callable &p_callback) {
#ifndef _3D_DISABLED
ERR_FAIL_COND_MSG(!p_navigation_mesh.is_valid(), "Invalid navigation mesh.");
ERR_FAIL_COND_MSG(!p_source_geometry_data.is_valid(), "Invalid NavigationMeshSourceGeometryData3D.");
@@ -1120,7 +1120,7 @@ void GodotNavigationServer::bake_from_source_geometry_data(const Ref<NavigationM
#endif // _3D_DISABLED
}
-void GodotNavigationServer::bake_from_source_geometry_data_async(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, const Callable &p_callback) {
+void GodotNavigationServer3D::bake_from_source_geometry_data_async(const Ref<NavigationMesh> &p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data, const Callable &p_callback) {
#ifndef _3D_DISABLED
ERR_FAIL_COND_MSG(!p_navigation_mesh.is_valid(), "Invalid navigation mesh.");
ERR_FAIL_COND_MSG(!p_source_geometry_data.is_valid(), "Invalid NavigationMeshSourceGeometryData3D.");
@@ -1130,7 +1130,7 @@ void GodotNavigationServer::bake_from_source_geometry_data_async(const Ref<Navig
#endif // _3D_DISABLED
}
-bool GodotNavigationServer::is_baking_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh) const {
+bool GodotNavigationServer3D::is_baking_navigation_mesh(Ref<NavigationMesh> p_navigation_mesh) const {
#ifdef _3D_DISABLED
return false;
#else
@@ -1206,7 +1206,7 @@ COMMAND_1(free, RID, p_object) {
}
}
-void GodotNavigationServer::internal_free_agent(RID p_object) {
+void GodotNavigationServer3D::internal_free_agent(RID p_object) {
NavAgent *agent = agent_owner.get_or_null(p_object);
if (agent) {
if (agent->get_map() != nullptr) {
@@ -1217,7 +1217,7 @@ void GodotNavigationServer::internal_free_agent(RID p_object) {
}
}
-void GodotNavigationServer::internal_free_obstacle(RID p_object) {
+void GodotNavigationServer3D::internal_free_obstacle(RID p_object) {
NavObstacle *obstacle = obstacle_owner.get_or_null(p_object);
if (obstacle) {
NavAgent *obstacle_agent = obstacle->get_agent();
@@ -1234,13 +1234,13 @@ void GodotNavigationServer::internal_free_obstacle(RID p_object) {
}
}
-void GodotNavigationServer::set_active(bool p_active) {
+void GodotNavigationServer3D::set_active(bool p_active) {
MutexLock lock(operations_mutex);
active = p_active;
}
-void GodotNavigationServer::flush_queries() {
+void GodotNavigationServer3D::flush_queries() {
// In c++ we can't be sure that this is performed in the main thread
// even with mutable functions.
MutexLock lock(commands_mutex);
@@ -1253,7 +1253,7 @@ void GodotNavigationServer::flush_queries() {
commands.clear();
}
-void GodotNavigationServer::map_force_update(RID p_map) {
+void GodotNavigationServer3D::map_force_update(RID p_map) {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL(map);
@@ -1262,14 +1262,14 @@ void GodotNavigationServer::map_force_update(RID p_map) {
map->sync();
}
-uint32_t GodotNavigationServer::map_get_iteration_id(RID p_map) const {
+uint32_t GodotNavigationServer3D::map_get_iteration_id(RID p_map) const {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, 0);
return map->get_iteration_id();
}
-void GodotNavigationServer::sync() {
+void GodotNavigationServer3D::sync() {
#ifndef _3D_DISABLED
if (navmesh_generator_3d) {
navmesh_generator_3d->sync();
@@ -1277,7 +1277,7 @@ void GodotNavigationServer::sync() {
#endif // _3D_DISABLED
}
-void GodotNavigationServer::process(real_t p_delta_time) {
+void GodotNavigationServer3D::process(real_t p_delta_time) {
flush_queries();
if (!active) {
@@ -1328,13 +1328,13 @@ void GodotNavigationServer::process(real_t p_delta_time) {
pm_edge_free_count = _new_pm_edge_free_count;
}
-void GodotNavigationServer::init() {
+void GodotNavigationServer3D::init() {
#ifndef _3D_DISABLED
navmesh_generator_3d = memnew(NavMeshGenerator3D);
#endif // _3D_DISABLED
}
-void GodotNavigationServer::finish() {
+void GodotNavigationServer3D::finish() {
flush_queries();
#ifndef _3D_DISABLED
if (navmesh_generator_3d) {
@@ -1345,7 +1345,7 @@ void GodotNavigationServer::finish() {
#endif // _3D_DISABLED
}
-PathQueryResult GodotNavigationServer::_query_path(const PathQueryParameters &p_parameters) const {
+PathQueryResult GodotNavigationServer3D::_query_path(const PathQueryParameters &p_parameters) const {
PathQueryResult r_query_result;
const NavMap *map = map_owner.get_or_null(p_parameters.map);
@@ -1385,7 +1385,7 @@ PathQueryResult GodotNavigationServer::_query_path(const PathQueryParameters &p_
return r_query_result;
}
-int GodotNavigationServer::get_process_info(ProcessInfo p_info) const {
+int GodotNavigationServer3D::get_process_info(ProcessInfo p_info) const {
switch (p_info) {
case INFO_ACTIVE_MAPS: {
return active_maps.size();
diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/3d/godot_navigation_server_3d.h
index 8af0eb1874..f7d991d47a 100644
--- a/modules/navigation/godot_navigation_server.h
+++ b/modules/navigation/3d/godot_navigation_server_3d.h
@@ -1,5 +1,5 @@
/**************************************************************************/
-/* godot_navigation_server.h */
+/* godot_navigation_server_3d.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
-#ifndef GODOT_NAVIGATION_SERVER_H
-#define GODOT_NAVIGATION_SERVER_H
+#ifndef GODOT_NAVIGATION_SERVER_3D_H
+#define GODOT_NAVIGATION_SERVER_3D_H
-#include "nav_agent.h"
-#include "nav_link.h"
-#include "nav_map.h"
-#include "nav_obstacle.h"
-#include "nav_region.h"
+#include "../nav_agent.h"
+#include "../nav_link.h"
+#include "../nav_map.h"
+#include "../nav_obstacle.h"
+#include "../nav_region.h"
#include "core/templates/local_vector.h"
#include "core/templates/rid.h"
@@ -55,17 +55,17 @@
virtual void F_NAME(T_0 D_0, T_1 D_1) override; \
void MERGE(_cmd_, F_NAME)(T_0 D_0, T_1 D_1)
-class GodotNavigationServer;
+class GodotNavigationServer3D;
#ifndef _3D_DISABLED
class NavMeshGenerator3D;
#endif // _3D_DISABLED
struct SetCommand {
virtual ~SetCommand() {}
- virtual void exec(GodotNavigationServer *server) = 0;
+ virtual void exec(GodotNavigationServer3D *server) = 0;
};
-class GodotNavigationServer : public NavigationServer3D {
+class GodotNavigationServer3D : public NavigationServer3D {
Mutex commands_mutex;
/// Mutex used to make any operation threadsafe.
Mutex operations_mutex;
@@ -97,8 +97,8 @@ class GodotNavigationServer : public NavigationServer3D {
int pm_edge_free_count = 0;
public:
- GodotNavigationServer();
- virtual ~GodotNavigationServer();
+ GodotNavigationServer3D();
+ virtual ~GodotNavigationServer3D();
void add_command(SetCommand *command);
@@ -286,4 +286,4 @@ private:
#undef COMMAND_1
#undef COMMAND_2
-#endif // GODOT_NAVIGATION_SERVER_H
+#endif // GODOT_NAVIGATION_SERVER_3D_H
diff --git a/modules/navigation/nav_mesh_generator_3d.cpp b/modules/navigation/3d/nav_mesh_generator_3d.cpp
index 95854f29e7..4cd4f60edc 100644
--- a/modules/navigation/nav_mesh_generator_3d.cpp
+++ b/modules/navigation/3d/nav_mesh_generator_3d.cpp
@@ -38,18 +38,18 @@
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/multimesh_instance_3d.h"
#include "scene/3d/physics_body_3d.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/capsule_shape_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/cylinder_shape_3d.h"
-#include "scene/resources/height_map_shape_3d.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"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/cylinder_shape_3d.h"
+#include "scene/resources/3d/height_map_shape_3d.h"
+#include "scene/resources/3d/primitive_meshes.h"
+#include "scene/resources/3d/shape_3d.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
+#include "scene/resources/3d/world_boundary_shape_3d.h"
#include "scene/resources/navigation_mesh.h"
#include "scene/resources/navigation_mesh_source_geometry_data_3d.h"
-#include "scene/resources/primitive_meshes.h"
-#include "scene/resources/shape_3d.h"
-#include "scene/resources/sphere_shape_3d.h"
-#include "scene/resources/world_boundary_shape_3d.h"
#include "modules/modules_enabled.gen.h" // For csg, gridmap.
diff --git a/modules/navigation/nav_mesh_generator_3d.h b/modules/navigation/3d/nav_mesh_generator_3d.h
index 0251b02235..0251b02235 100644
--- a/modules/navigation/nav_mesh_generator_3d.h
+++ b/modules/navigation/3d/nav_mesh_generator_3d.h
diff --git a/modules/navigation/navigation_mesh_generator.cpp b/modules/navigation/3d/navigation_mesh_generator.cpp
index 8393896db1..8393896db1 100644
--- a/modules/navigation/navigation_mesh_generator.cpp
+++ b/modules/navigation/3d/navigation_mesh_generator.cpp
diff --git a/modules/navigation/navigation_mesh_generator.h b/modules/navigation/3d/navigation_mesh_generator.h
index 08fe9f9142..08fe9f9142 100644
--- a/modules/navigation/navigation_mesh_generator.h
+++ b/modules/navigation/3d/navigation_mesh_generator.h
diff --git a/modules/navigation/SCsub b/modules/navigation/SCsub
index 46bcb0fba4..02d3b7487e 100644
--- a/modules/navigation/SCsub
+++ b/modules/navigation/SCsub
@@ -74,6 +74,9 @@ env.modules_sources += thirdparty_obj
module_obj = []
env_navigation.add_source_files(module_obj, "*.cpp")
+env_navigation.add_source_files(module_obj, "2d/*.cpp")
+if not env["disable_3d"]:
+ env_navigation.add_source_files(module_obj, "3d/*.cpp")
if env.editor_build:
env_navigation.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj
diff --git a/modules/navigation/register_types.cpp b/modules/navigation/register_types.cpp
index 525fe71134..dbc9e53035 100644
--- a/modules/navigation/register_types.cpp
+++ b/modules/navigation/register_types.cpp
@@ -30,12 +30,12 @@
#include "register_types.h"
-#include "godot_navigation_server.h"
-#include "godot_navigation_server_2d.h"
+#include "2d/godot_navigation_server_2d.h"
+#include "3d/godot_navigation_server_3d.h"
#ifndef DISABLE_DEPRECATED
#ifndef _3D_DISABLED
-#include "navigation_mesh_generator.h"
+#include "3d/navigation_mesh_generator.h"
#endif
#endif // DISABLE_DEPRECATED
@@ -53,8 +53,8 @@ NavigationMeshGenerator *_nav_mesh_generator = nullptr;
#endif
#endif // DISABLE_DEPRECATED
-NavigationServer3D *new_server() {
- return memnew(GodotNavigationServer);
+NavigationServer3D *new_navigation_server_3d() {
+ return memnew(GodotNavigationServer3D);
}
NavigationServer2D *new_navigation_server_2d() {
@@ -63,7 +63,7 @@ NavigationServer2D *new_navigation_server_2d() {
void initialize_navigation_module(ModuleInitializationLevel p_level) {
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
- NavigationServer3DManager::set_default_server(new_server);
+ NavigationServer3DManager::set_default_server(new_navigation_server_3d);
NavigationServer2DManager::set_default_server(new_navigation_server_2d);
#ifndef DISABLE_DEPRECATED
diff --git a/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp b/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp
index e57491e7c6..477a1c2609 100644
--- a/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp
+++ b/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp
@@ -30,6 +30,7 @@
#include "openxr_eye_gaze_interaction.h"
+#include "core/config/project_settings.h"
#include "core/os/os.h"
#include "../action_map/openxr_interaction_profile_metadata.h"
@@ -52,7 +53,11 @@ OpenXREyeGazeInteractionExtension::~OpenXREyeGazeInteractionExtension() {
HashMap<String, bool *> OpenXREyeGazeInteractionExtension::get_requested_extensions() {
HashMap<String, bool *> request_extensions;
- request_extensions[XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME] = &available;
+ // Only enable this extension when requested.
+ // We still register our meta data or the action map editor will fail.
+ if (GLOBAL_GET("xr/openxr/extensions/eye_gaze_interaction") && (!OS::get_singleton()->has_feature("mobile") || OS::get_singleton()->has_feature(XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME))) {
+ request_extensions[XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME] = &available;
+ }
return request_extensions;
}
diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp
index a0a93c8694..3d34b27407 100644
--- a/modules/openxr/register_types.cpp
+++ b/modules/openxr/register_types.cpp
@@ -117,11 +117,9 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) {
OpenXRAPI::register_extension_wrapper(memnew(OpenXRWMRControllerExtension));
OpenXRAPI::register_extension_wrapper(memnew(OpenXRML2ControllerExtension));
OpenXRAPI::register_extension_wrapper(memnew(OpenXRMetaControllerExtension));
+ OpenXRAPI::register_extension_wrapper(memnew(OpenXREyeGazeInteractionExtension));
// register gated extensions
- if (GLOBAL_GET("xr/openxr/extensions/eye_gaze_interaction") && (!OS::get_singleton()->has_feature("mobile") || OS::get_singleton()->has_feature(XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME))) {
- OpenXRAPI::register_extension_wrapper(memnew(OpenXREyeGazeInteractionExtension));
- }
if (GLOBAL_GET("xr/openxr/extensions/hand_tracking")) {
OpenXRAPI::register_extension_wrapper(memnew(OpenXRHandTrackingExtension));
}
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index 28ab8e3335..471fda74bf 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -379,7 +379,8 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
} else if (p.begins_with("ro.build.version.sdk=")) {
d.api_level = p.get_slice("=", 1).to_int();
} else if (p.begins_with("ro.product.cpu.abi=")) {
- d.description += "CPU: " + p.get_slice("=", 1).strip_edges() + "\n";
+ d.architecture = p.get_slice("=", 1).strip_edges();
+ d.description += "CPU: " + d.architecture + "\n";
} else if (p.begins_with("ro.product.manufacturer=")) {
d.description += "Manufacturer: " + p.get_slice("=", 1).strip_edges() + "\n";
} else if (p.begins_with("ro.board.platform=")) {
@@ -1992,6 +1993,12 @@ String EditorExportPlatformAndroid::get_option_tooltip(int p_index) const {
return s;
}
+String EditorExportPlatformAndroid::get_device_architecture(int p_index) const {
+ ERR_FAIL_INDEX_V(p_index, devices.size(), "");
+ MutexLock lock(device_lock);
+ return devices[p_index].architecture;
+}
+
Error EditorExportPlatformAndroid::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
ERR_FAIL_INDEX_V(p_device, devices.size(), ERR_INVALID_PARAMETER);
diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h
index e25655c6cc..b968302449 100644
--- a/platform/android/export/export_plugin.h
+++ b/platform/android/export/export_plugin.h
@@ -76,6 +76,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
String name;
String description;
int api_level = 0;
+ String architecture;
};
struct APKExportData {
@@ -221,6 +222,8 @@ public:
virtual String get_option_tooltip(int p_index) const override;
+ virtual String get_device_architecture(int p_index) const override;
+
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) override;
virtual Ref<Texture2D> get_run_icon() const override;
diff --git a/platform/macos/dir_access_macos.mm b/platform/macos/dir_access_macos.mm
index 66d81f2687..37f717c9de 100644
--- a/platform/macos/dir_access_macos.mm
+++ b/platform/macos/dir_access_macos.mm
@@ -41,9 +41,10 @@
String DirAccessMacOS::fix_unicode_name(const char *p_name) const {
String fname;
- NSString *nsstr = [[NSString stringWithUTF8String:p_name] precomposedStringWithCanonicalMapping];
-
- fname.parse_utf8([nsstr UTF8String]);
+ if (p_name != nullptr) {
+ NSString *nsstr = [[NSString stringWithUTF8String:p_name] precomposedStringWithCanonicalMapping];
+ fname.parse_utf8([nsstr UTF8String]);
+ }
return fname;
}
diff --git a/platform/macos/godot_application_delegate.mm b/platform/macos/godot_application_delegate.mm
index 2e76d4aa97..b3759e66f5 100644
--- a/platform/macos/godot_application_delegate.mm
+++ b/platform/macos/godot_application_delegate.mm
@@ -125,7 +125,8 @@
- (void)applicationDidFinishLaunching:(NSNotification *)notice {
NSString *nsappname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
- NSString *nsbundleid_env = [NSString stringWithUTF8String:getenv("__CFBundleIdentifier")];
+ const char *bundled_id = getenv("__CFBundleIdentifier");
+ NSString *nsbundleid_env = [NSString stringWithUTF8String:(bundled_id != nullptr) ? bundled_id : ""];
NSString *nsbundleid = [[NSBundle mainBundle] bundleIdentifier];
if (nsappname == nil || isatty(STDOUT_FILENO) || isatty(STDIN_FILENO) || isatty(STDERR_FILENO) || ![nsbundleid isEqualToString:nsbundleid_env]) {
// If the executable is started from terminal or is not bundled, macOS WindowServer won't register and activate app window correctly (menu and title bar are grayed out and input ignored).
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 16eabf6855..6f3f6189e5 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -35,6 +35,7 @@
#include "core/config/project_settings.h"
#include "core/io/marshalls.h"
+#include "core/version.h"
#include "drivers/png/png_driver_common.h"
#include "main/main.h"
#include "scene/resources/atlas_texture.h"
@@ -51,6 +52,9 @@
#include <avrt.h>
#include <dwmapi.h>
+#include <propkey.h>
+#include <propvarutil.h>
+#include <shellapi.h>
#include <shlwapi.h>
#include <shobjidl.h>
#include <wbemcli.h>
@@ -1375,6 +1379,15 @@ void DisplayServerWindows::delete_sub_window(WindowID p_window) {
WindowData &wd = windows[p_window];
+ IPropertyStore *prop_store;
+ HRESULT hr = SHGetPropertyStoreForWindow(wd.hWnd, IID_IPropertyStore, (void **)&prop_store);
+ if (hr == S_OK) {
+ PROPVARIANT val;
+ PropVariantInit(&val);
+ prop_store->SetValue(PKEY_AppUserModel_ID, val);
+ prop_store->Release();
+ }
+
while (wd.transient_children.size()) {
window_set_transient(*wd.transient_children.begin(), INVALID_WINDOW_ID);
}
@@ -4956,6 +4969,33 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode,
wd.last_pressure_update = 0;
wd.last_tilt = Vector2();
+ IPropertyStore *prop_store;
+ HRESULT hr = SHGetPropertyStoreForWindow(wd.hWnd, IID_IPropertyStore, (void **)&prop_store);
+ if (hr == S_OK) {
+ PROPVARIANT val;
+ String appname;
+ if (Engine::get_singleton()->is_editor_hint()) {
+ appname = "Godot.GodotEditor." + String(VERSION_BRANCH);
+ } else {
+ String name = GLOBAL_GET("application/config/name");
+ String version = GLOBAL_GET("application/config/version");
+ if (version.is_empty()) {
+ version = "0";
+ }
+ String clean_app_name = name.to_pascal_case();
+ for (int i = 0; i < clean_app_name.length(); i++) {
+ if (!is_ascii_alphanumeric_char(clean_app_name[i]) && clean_app_name[i] != '_' && clean_app_name[i] != '.') {
+ clean_app_name[i] = '_';
+ }
+ }
+ clean_app_name = clean_app_name.substr(0, 120 - version.length()).trim_suffix(".");
+ appname = "Godot." + clean_app_name + "." + version;
+ }
+ InitPropVariantFromString((PCWSTR)appname.utf16().get_data(), &val);
+ prop_store->SetValue(PKEY_AppUserModel_ID, val);
+ prop_store->Release();
+ }
+
// IME.
wd.im_himc = ImmGetContext(wd.hWnd);
ImmAssociateContext(wd.hWnd, (HIMC)0);
@@ -5354,6 +5394,26 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
}
#endif
+ String appname;
+ if (Engine::get_singleton()->is_editor_hint()) {
+ appname = "Godot.GodotEditor." + String(VERSION_BRANCH);
+ } else {
+ String name = GLOBAL_GET("application/config/name");
+ String version = GLOBAL_GET("application/config/version");
+ if (version.is_empty()) {
+ version = "0";
+ }
+ String clean_app_name = name.to_pascal_case();
+ for (int i = 0; i < clean_app_name.length(); i++) {
+ if (!is_ascii_alphanumeric_char(clean_app_name[i]) && clean_app_name[i] != '_' && clean_app_name[i] != '.') {
+ clean_app_name[i] = '_';
+ }
+ }
+ clean_app_name = clean_app_name.substr(0, 120 - version.length()).trim_suffix(".");
+ appname = "Godot." + clean_app_name + "." + version;
+ }
+ SetCurrentProcessExplicitAppUserModelID((PCWSTR)appname.utf16().get_data());
+
mouse_monitor = SetWindowsHookEx(WH_MOUSE, ::MouseProc, nullptr, GetCurrentThreadId());
Point2i window_position;
diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h
index 780793f289..2c8534665c 100644
--- a/scene/2d/collision_object_2d.h
+++ b/scene/2d/collision_object_2d.h
@@ -33,7 +33,7 @@
#include "scene/2d/node_2d.h"
#include "scene/main/viewport.h"
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
#include "servers/physics_server_2d.h"
class CollisionObject2D : public Node2D {
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index d2f71eca9d..3bc5bce8f0 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -33,8 +33,8 @@
#include "collision_object_2d.h"
#include "core/math/geometry_2d.h"
#include "scene/2d/area_2d.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/concave_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
#include "thirdparty/misc/polypartition.h"
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index ee413c7bc2..5539e49135 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -32,8 +32,8 @@
#include "collision_object_2d.h"
#include "scene/2d/area_2d.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/concave_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
void CollisionShape2D::_shape_changed() {
queue_redraw();
diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h
index 3e13dd698c..65436f1539 100644
--- a/scene/2d/collision_shape_2d.h
+++ b/scene/2d/collision_shape_2d.h
@@ -32,7 +32,7 @@
#define COLLISION_SHAPE_2D_H
#include "scene/2d/node_2d.h"
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class CollisionObject2D;
diff --git a/scene/2d/shape_cast_2d.cpp b/scene/2d/shape_cast_2d.cpp
index 90d80d7549..38e3b3180b 100644
--- a/scene/2d/shape_cast_2d.cpp
+++ b/scene/2d/shape_cast_2d.cpp
@@ -33,7 +33,7 @@
#include "core/config/engine.h"
#include "scene/2d/collision_object_2d.h"
#include "scene/2d/physics_body_2d.h"
-#include "scene/resources/circle_shape_2d.h"
+#include "scene/resources/2d/circle_shape_2d.h"
#include "servers/physics_2d/godot_physics_server_2d.h"
void ShapeCast2D::set_target_position(const Vector2 &p_point) {
diff --git a/scene/2d/shape_cast_2d.h b/scene/2d/shape_cast_2d.h
index a577c351fd..6b8fd5b798 100644
--- a/scene/2d/shape_cast_2d.h
+++ b/scene/2d/shape_cast_2d.h
@@ -32,7 +32,7 @@
#define SHAPE_CAST_2D_H
#include "scene/2d/node_2d.h"
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
#include "scene/resources/world_2d.h"
class CollisionObject2D;
diff --git a/scene/2d/skeleton_2d.h b/scene/2d/skeleton_2d.h
index 6a36a31552..ad6a47bf43 100644
--- a/scene/2d/skeleton_2d.h
+++ b/scene/2d/skeleton_2d.h
@@ -32,7 +32,7 @@
#define SKELETON_2D_H
#include "scene/2d/node_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
class Skeleton2D;
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index 16750625e5..c9844f29af 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -32,7 +32,7 @@
#define TILE_MAP_H
#include "scene/2d/tile_map_layer_group.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class Control;
class TileMapLayer;
diff --git a/scene/2d/tile_map_layer.cpp b/scene/2d/tile_map_layer.cpp
index 8b2542b34e..2753fee7e9 100644
--- a/scene/2d/tile_map_layer.cpp
+++ b/scene/2d/tile_map_layer.cpp
@@ -1666,7 +1666,7 @@ void TileMapLayer::_internal_update() {
Vector<Vector2i> to_delete;
for (SelfList<CellData> *cell_data_list_element = dirty.cell_list.first(); cell_data_list_element; cell_data_list_element = cell_data_list_element->next()) {
CellData &cell_data = *cell_data_list_element->self();
- // Select the the cell from tile_map if it is invalid.
+ // Select the cell from tile_map if it is invalid.
if (cell_data.cell.source_id == TileSet::INVALID_SOURCE) {
to_delete.push_back(cell_data.coords);
}
@@ -2978,4 +2978,4 @@ TerrainConstraint::TerrainConstraint(Ref<TileSet> p_tile_set, const Vector2i &p_
}
}
terrain = p_terrain;
-} \ No newline at end of file
+}
diff --git a/scene/2d/tile_map_layer.h b/scene/2d/tile_map_layer.h
index ac03f3155f..5a0c51d7e5 100644
--- a/scene/2d/tile_map_layer.h
+++ b/scene/2d/tile_map_layer.h
@@ -32,7 +32,7 @@
#define TILE_MAP_LAYER_H
#include "scene/2d/tile_map.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
class TileSetAtlasSource;
diff --git a/scene/2d/tile_map_layer_group.cpp b/scene/2d/tile_map_layer_group.cpp
index ac0de380a3..c596534474 100644
--- a/scene/2d/tile_map_layer_group.cpp
+++ b/scene/2d/tile_map_layer_group.cpp
@@ -32,7 +32,7 @@
#include "core/core_string_names.h"
#include "scene/2d/tile_map_layer.h"
-#include "scene/resources/tile_set.h"
+#include "scene/resources/2d/tile_set.h"
#ifdef TOOLS_ENABLED
diff --git a/scene/2d/touch_screen_button.h b/scene/2d/touch_screen_button.h
index c7dc0a323e..4467604e2b 100644
--- a/scene/2d/touch_screen_button.h
+++ b/scene/2d/touch_screen_button.h
@@ -32,8 +32,8 @@
#define TOUCH_SCREEN_BUTTON_H
#include "scene/2d/node_2d.h"
+#include "scene/resources/2d/rectangle_shape_2d.h"
#include "scene/resources/bit_map.h"
-#include "scene/resources/rectangle_shape_2d.h"
#include "scene/resources/texture.h"
class TouchScreenButton : public Node2D {
diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp
index 0cfe0f8cb7..bbd2ef2fb8 100644
--- a/scene/3d/collision_object_3d.cpp
+++ b/scene/3d/collision_object_3d.cpp
@@ -30,7 +30,7 @@
#include "collision_object_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
#include "scene/scene_string_names.h"
void CollisionObject3D::_notification(int p_what) {
diff --git a/scene/3d/collision_polygon_3d.cpp b/scene/3d/collision_polygon_3d.cpp
index 9c1a7181aa..abde05778d 100644
--- a/scene/3d/collision_polygon_3d.cpp
+++ b/scene/3d/collision_polygon_3d.cpp
@@ -32,7 +32,7 @@
#include "collision_object_3d.h"
#include "core/math/geometry_2d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
void CollisionPolygon3D::_build_polygon() {
if (!collision_object) {
diff --git a/scene/3d/collision_polygon_3d.h b/scene/3d/collision_polygon_3d.h
index 61290a7947..fe4cf40ee3 100644
--- a/scene/3d/collision_polygon_3d.h
+++ b/scene/3d/collision_polygon_3d.h
@@ -32,7 +32,7 @@
#define COLLISION_POLYGON_3D_H
#include "scene/3d/node_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class CollisionObject3D;
class CollisionPolygon3D : public Node3D {
diff --git a/scene/3d/collision_shape_3d.cpp b/scene/3d/collision_shape_3d.cpp
index 61941a0e53..08fc62ae4f 100644
--- a/scene/3d/collision_shape_3d.cpp
+++ b/scene/3d/collision_shape_3d.cpp
@@ -32,9 +32,9 @@
#include "mesh_instance_3d.h"
#include "physics_body_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/world_boundary_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/world_boundary_shape_3d.h"
#include "vehicle_body_3d.h"
void CollisionShape3D::make_convex_from_siblings() {
diff --git a/scene/3d/collision_shape_3d.h b/scene/3d/collision_shape_3d.h
index bc0e70f8ac..15f6ef73cb 100644
--- a/scene/3d/collision_shape_3d.h
+++ b/scene/3d/collision_shape_3d.h
@@ -32,7 +32,7 @@
#define COLLISION_SHAPE_3D_H
#include "scene/3d/node_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class CollisionObject3D;
class CollisionShape3D : public Node3D {
diff --git a/scene/3d/gpu_particles_3d.h b/scene/3d/gpu_particles_3d.h
index 0c9f2c1378..b5aee6fe34 100644
--- a/scene/3d/gpu_particles_3d.h
+++ b/scene/3d/gpu_particles_3d.h
@@ -32,7 +32,7 @@
#define GPU_PARTICLES_3D_H
#include "scene/3d/visual_instance_3d.h"
-#include "scene/resources/skin.h"
+#include "scene/resources/3d/skin.h"
class GPUParticles3D : public GeometryInstance3D {
private:
diff --git a/scene/3d/importer_mesh_instance_3d.cpp b/scene/3d/importer_mesh_instance_3d.cpp
index 2216b3818d..ad44c9e56a 100644
--- a/scene/3d/importer_mesh_instance_3d.cpp
+++ b/scene/3d/importer_mesh_instance_3d.cpp
@@ -30,7 +30,7 @@
#include "importer_mesh_instance_3d.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
void ImporterMeshInstance3D::set_mesh(const Ref<ImporterMesh> &p_mesh) {
mesh = p_mesh;
diff --git a/scene/3d/importer_mesh_instance_3d.h b/scene/3d/importer_mesh_instance_3d.h
index d48721383f..fbd95d4b68 100644
--- a/scene/3d/importer_mesh_instance_3d.h
+++ b/scene/3d/importer_mesh_instance_3d.h
@@ -33,8 +33,8 @@
#include "scene/3d/node_3d.h"
#include "scene/3d/visual_instance_3d.h"
+#include "scene/resources/3d/skin.h"
#include "scene/resources/immediate_mesh.h"
-#include "scene/resources/skin.h"
class ImporterMesh;
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp
index 35baf81e89..eeb41573f7 100644
--- a/scene/3d/mesh_instance_3d.cpp
+++ b/scene/3d/mesh_instance_3d.cpp
@@ -32,8 +32,8 @@
#include "collision_shape_3d.h"
#include "physics_body_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
bool MeshInstance3D::_set(const StringName &p_name, const Variant &p_value) {
//this is not _too_ bad performance wise, really. it only arrives here if the property was not set anywhere else.
diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h
index 20030210c6..7f8c3e6e68 100644
--- a/scene/3d/node_3d.h
+++ b/scene/3d/node_3d.h
@@ -32,7 +32,7 @@
#define NODE_3D_H
#include "scene/main/node.h"
-#include "scene/resources/world_3d.h"
+#include "scene/resources/3d/world_3d.h"
class Node3DGizmo : public RefCounted {
GDCLASS(Node3DGizmo, RefCounted);
diff --git a/scene/3d/occluder_instance_3d.cpp b/scene/3d/occluder_instance_3d.cpp
index a76488e479..8d995a8785 100644
--- a/scene/3d/occluder_instance_3d.cpp
+++ b/scene/3d/occluder_instance_3d.cpp
@@ -36,7 +36,7 @@
#include "core/math/triangulate.h"
#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/3d/mesh_instance_3d.h"
-#include "scene/resources/importer_mesh.h"
+#include "scene/resources/3d/importer_mesh.h"
#include "scene/resources/surface_tool.h"
#ifdef TOOLS_ENABLED
diff --git a/scene/3d/shape_cast_3d.cpp b/scene/3d/shape_cast_3d.cpp
index 4d9eeada06..2da5f52928 100644
--- a/scene/3d/shape_cast_3d.cpp
+++ b/scene/3d/shape_cast_3d.cpp
@@ -32,7 +32,7 @@
#include "scene/3d/collision_object_3d.h"
#include "scene/3d/mesh_instance_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
void ShapeCast3D::_notification(int p_what) {
switch (p_what) {
diff --git a/scene/3d/shape_cast_3d.h b/scene/3d/shape_cast_3d.h
index 043e35090f..9052db9046 100644
--- a/scene/3d/shape_cast_3d.h
+++ b/scene/3d/shape_cast_3d.h
@@ -32,7 +32,7 @@
#define SHAPE_CAST_3D_H
#include "scene/3d/node_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class CollisionObject3D;
diff --git a/scene/3d/skeleton_3d.compat.inc b/scene/3d/skeleton_3d.compat.inc
new file mode 100644
index 0000000000..6410ab335a
--- /dev/null
+++ b/scene/3d/skeleton_3d.compat.inc
@@ -0,0 +1,41 @@
+/**************************************************************************/
+/* skeleton_3d.compat.inc */
+/**************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/**************************************************************************/
+/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
+/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/**************************************************************************/
+
+#ifndef DISABLE_DEPRECATED
+
+void Skeleton3D::_add_bone_bind_compat_88791(const String &p_name) {
+ add_bone(p_name);
+}
+
+void Skeleton3D::_bind_compatibility_methods() {
+ ClassDB::bind_compatibility_method(D_METHOD("add_bone", "p_name"), &Skeleton3D::_add_bone_bind_compat_88791);
+}
+
+#endif // DISABLE_DEPRECATED
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp
index cae1b2ce9c..f448d1c6e2 100644
--- a/scene/3d/skeleton_3d.cpp
+++ b/scene/3d/skeleton_3d.cpp
@@ -29,6 +29,7 @@
/**************************************************************************/
#include "skeleton_3d.h"
+#include "skeleton_3d.compat.inc"
#include "core/variant/type_info.h"
#include "scene/3d/physics_body_3d.h"
@@ -409,18 +410,21 @@ uint64_t Skeleton3D::get_version() const {
return version;
}
-void Skeleton3D::add_bone(const String &p_name) {
- ERR_FAIL_COND(p_name.is_empty() || p_name.contains(":") || p_name.contains("/") || name_to_bone_index.has(p_name));
+int Skeleton3D::add_bone(const String &p_name) {
+ ERR_FAIL_COND_V_MSG(p_name.is_empty() || p_name.contains(":") || p_name.contains("/"), -1, vformat("Bone name cannot be empty or contain ':' or '/'.", p_name));
+ ERR_FAIL_COND_V_MSG(name_to_bone_index.has(p_name), -1, vformat("Skeleton3D \"%s\" already has a bone with name \"%s\".", to_string(), p_name));
Bone b;
b.name = p_name;
bones.push_back(b);
- name_to_bone_index.insert(p_name, bones.size() - 1);
+ int new_idx = bones.size() - 1;
+ name_to_bone_index.insert(p_name, new_idx);
process_order_dirty = true;
version++;
rest_dirty = true;
_make_dirty();
update_gizmos();
+ return new_idx;
}
int Skeleton3D::find_bone(const String &p_name) const {
diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h
index 7d4df1d1f2..979e2e52b7 100644
--- a/scene/3d/skeleton_3d.h
+++ b/scene/3d/skeleton_3d.h
@@ -32,7 +32,7 @@
#define SKELETON_3D_H
#include "scene/3d/node_3d.h"
-#include "scene/resources/skin.h"
+#include "scene/resources/3d/skin.h"
typedef int BoneId;
@@ -138,6 +138,12 @@ private:
void _update_process_order();
+#ifndef DISABLE_DEPRECATED
+ void _add_bone_bind_compat_88791(const String &p_name);
+
+ static void _bind_compatibility_methods();
+#endif // DISABLE_DEPRECATED
+
protected:
bool _get(const StringName &p_path, Variant &r_ret) const;
bool _set(const StringName &p_path, const Variant &p_value);
@@ -153,7 +159,7 @@ public:
// skeleton creation api
uint64_t get_version() const;
- void add_bone(const String &p_name);
+ int add_bone(const String &p_name);
int find_bone(const String &p_name) const;
String get_bone_name(int p_bone) const;
void set_bone_name(int p_bone, const String &p_name);
diff --git a/scene/3d/spring_arm_3d.cpp b/scene/3d/spring_arm_3d.cpp
index 9151fa9593..8d2f10310c 100644
--- a/scene/3d/spring_arm_3d.cpp
+++ b/scene/3d/spring_arm_3d.cpp
@@ -31,7 +31,7 @@
#include "spring_arm_3d.h"
#include "scene/3d/camera_3d.h"
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
void SpringArm3D::_notification(int p_what) {
switch (p_what) {
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 978fb56f78..b1870eea55 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -50,10 +50,6 @@ void Button::_set_internal_margin(Side p_side, float p_value) {
void Button::_queue_update_size_cache() {
}
-void Button::_set_h_separation_is_valid_when_no_text(bool p_h_separation_is_valid_when_no_text) {
- h_separation_is_valid_when_no_text = p_h_separation_is_valid_when_no_text;
-}
-
Ref<StyleBox> Button::_get_current_stylebox() const {
Ref<StyleBox> stylebox = theme_cache.normal;
const bool rtl = is_layout_rtl();
@@ -180,14 +176,12 @@ void Button::_notification(int p_what) {
float right_internal_margin_with_h_separation = _internal_margin[SIDE_RIGHT];
{ // The width reserved for internal element in derived classes (and h_separation if need).
- if (!xl_text.is_empty() || h_separation_is_valid_when_no_text) {
- if (_internal_margin[SIDE_LEFT] > 0.0f) {
- left_internal_margin_with_h_separation += h_separation;
- }
+ if (_internal_margin[SIDE_LEFT] > 0.0f) {
+ left_internal_margin_with_h_separation += h_separation;
+ }
- if (_internal_margin[SIDE_RIGHT] > 0.0f) {
- right_internal_margin_with_h_separation += h_separation;
- }
+ if (_internal_margin[SIDE_RIGHT] > 0.0f) {
+ right_internal_margin_with_h_separation += h_separation;
}
drawable_size_remained.width -= left_internal_margin_with_h_separation + right_internal_margin_with_h_separation; // The size after the internal element is stripped.
diff --git a/scene/gui/button.h b/scene/gui/button.h
index 6efbafe0ad..86fdbd35d5 100644
--- a/scene/gui/button.h
+++ b/scene/gui/button.h
@@ -56,8 +56,6 @@ private:
VerticalAlignment vertical_icon_alignment = VERTICAL_ALIGNMENT_CENTER;
float _internal_margin[4] = {};
- bool h_separation_is_valid_when_no_text = false;
-
struct ThemeCache {
Ref<StyleBox> normal;
Ref<StyleBox> normal_mirrored;
@@ -105,7 +103,6 @@ protected:
void _set_internal_margin(Side p_side, float p_value);
virtual void _queue_update_size_cache();
- void _set_h_separation_is_valid_when_no_text(bool p_h_separation_is_valid_when_no_text);
Ref<StyleBox> _get_current_stylebox() const;
void _notification(int p_what);
static void _bind_methods();
diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp
index 6c02ba1a86..46c20e4a1c 100644
--- a/scene/gui/check_box.cpp
+++ b/scene/gui/check_box.cpp
@@ -64,12 +64,18 @@ Size2 CheckBox::get_icon_size() const {
Size2 CheckBox::get_minimum_size() const {
Size2 minsize = Button::get_minimum_size();
- Size2 tex_size = get_icon_size();
- minsize.width += tex_size.width;
- if (get_text().length() > 0) {
- minsize.width += MAX(0, theme_cache.h_separation);
+ const Size2 tex_size = get_icon_size();
+ if (tex_size.width > 0 || tex_size.height > 0) {
+ const Size2 padding = _get_current_stylebox()->get_minimum_size();
+ Size2 content_size = minsize - padding;
+ if (content_size.width > 0 && tex_size.width > 0) {
+ content_size.width += MAX(0, theme_cache.h_separation);
+ }
+ content_size.width += tex_size.width;
+ content_size.height = MAX(content_size.height, tex_size.height);
+
+ minsize = content_size + padding;
}
- minsize.height = MAX(minsize.height, tex_size.height + theme_cache.normal_style->get_margin(SIDE_TOP) + theme_cache.normal_style->get_margin(SIDE_BOTTOM));
return minsize;
}
diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp
index d9fabc5459..ca2ef220fd 100644
--- a/scene/gui/check_button.cpp
+++ b/scene/gui/check_button.cpp
@@ -68,12 +68,18 @@ Size2 CheckButton::get_icon_size() const {
Size2 CheckButton::get_minimum_size() const {
Size2 minsize = Button::get_minimum_size();
- Size2 tex_size = get_icon_size();
- minsize.width += tex_size.width;
- if (get_text().length() > 0) {
- minsize.width += MAX(0, theme_cache.h_separation);
+ const Size2 tex_size = get_icon_size();
+ if (tex_size.width > 0 || tex_size.height > 0) {
+ const Size2 padding = _get_current_stylebox()->get_minimum_size();
+ Size2 content_size = minsize - padding;
+ if (content_size.width > 0 && tex_size.width > 0) {
+ content_size.width += MAX(0, theme_cache.h_separation);
+ }
+ content_size.width += tex_size.width;
+ content_size.height = MAX(content_size.height, tex_size.height);
+
+ minsize = content_size + padding;
}
- minsize.height = MAX(minsize.height, tex_size.height + theme_cache.normal_style->get_margin(SIDE_TOP) + theme_cache.normal_style->get_margin(SIDE_BOTTOM));
return minsize;
}
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 6613f25b4c..0e10652f07 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -614,8 +614,6 @@ void OptionButton::set_disable_shortcuts(bool p_disabled) {
OptionButton::OptionButton(const String &p_text) :
Button(p_text) {
- _set_h_separation_is_valid_when_no_text(true);
-
set_toggle_mode(true);
set_process_shortcut_input(true);
set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 59be64b6dc..79a5f2b557 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -229,7 +229,7 @@ void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_chan
}
text.write[p_line].height = height;
- // If this line has shrunk, this may no longer the the tallest line.
+ // If this line has shrunk, this may no longer the tallest line.
if (old_height == line_height && height < line_height) {
_calculate_line_height();
} else {
@@ -241,7 +241,7 @@ void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_chan
int line_width = get_line_width(p_line);
text.write[p_line].width = line_width;
- // If this line has shrunk, this may no longer the the longest line.
+ // If this line has shrunk, this may no longer the longest line.
if (old_width == max_width && line_width < max_width) {
_calculate_max_line_width();
} else if (!is_hidden(p_line)) {
@@ -731,7 +731,7 @@ void TextEdit::_notification(int p_what) {
// Draw the minimap.
- // Add visual feedback when dragging or hovering the the visible area rectangle.
+ // Add visual feedback when dragging or hovering the visible area rectangle.
float viewport_alpha;
if (dragging_minimap) {
viewport_alpha = 0.25;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index f827f68def..67f8a97212 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2963,12 +2963,12 @@ void Node::replace_by(Node *p_node, bool p_keep_groups) {
}
p_node->set_owner(owner);
- for (int i = 0; i < owned.size(); i++) {
- owned[i]->set_owner(p_node);
+ for (Node *E : owned) {
+ E->set_owner(p_node);
}
- for (int i = 0; i < owned_by_owner.size(); i++) {
- owned_by_owner[i]->set_owner(owner);
+ for (Node *E : owned_by_owner) {
+ E->set_owner(owner);
}
p_node->set_scene_file_path(get_scene_file_path());
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index a29311af43..8d0bad6942 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -55,12 +55,12 @@
#include "scene/resources/mesh.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/world_2d.h"
-#include "scene/resources/world_3d.h"
#include "scene/scene_string_names.h"
#include "servers/display_server.h"
#include "servers/navigation_server_3d.h"
#include "servers/physics_server_2d.h"
#ifndef _3D_DISABLED
+#include "scene/resources/3d/world_3d.h"
#include "servers/physics_server_3d.h"
#endif // _3D_DISABLED
#include "window.h"
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index b582576412..0bb2688fea 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -4769,7 +4769,7 @@ void Viewport::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_debanding"), "set_use_debanding", "is_using_debanding");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_occlusion_culling"), "set_use_occlusion_culling", "is_using_occlusion_culling");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mesh_lod_threshold", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_mesh_lod_threshold", "get_mesh_lod_threshold");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Lighting,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Lighting,Overdraw,Wireframe,Normal Buffer,VoxelGI Albedo,VoxelGI Lighting,VoxelGI Emission,Shadow Atlas,Directional Shadow Map,Scene Luminance,SSAO,SSIL,Directional Shadow Splits,Decal Atlas,SDFGI Cascades,SDFGI Probes,VoxelGI/SDFGI Buffer,Disable Mesh LOD,OmniLight3D Cluster,SpotLight3D Cluster,Decal Cluster,ReflectionProbe Cluster,Occlusion Culling Buffer,Motion Vectors,Internal Buffer"), "set_debug_draw", "get_debug_draw");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_hdr_2d"), "set_use_hdr_2d", "is_using_hdr_2d");
#ifndef _3D_DISABLED
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 035c6c0695..b156cd0422 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -139,6 +139,25 @@
#include "scene/main/timer.h"
#include "scene/main/viewport.h"
#include "scene/main/window.h"
+#include "scene/resources/2d/capsule_shape_2d.h"
+#include "scene/resources/2d/circle_shape_2d.h"
+#include "scene/resources/2d/concave_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/polygon_path_finder.h"
+#include "scene/resources/2d/rectangle_shape_2d.h"
+#include "scene/resources/2d/segment_shape_2d.h"
+#include "scene/resources/2d/separation_ray_shape_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_lookat.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_stack_2d.h"
+#include "scene/resources/2d/tile_set.h"
+#include "scene/resources/2d/world_boundary_shape_2d.h"
#include "scene/resources/animated_texture.h"
#include "scene/resources/animation_library.h"
#include "scene/resources/atlas_texture.h"
@@ -148,12 +167,8 @@
#include "scene/resources/bone_map.h"
#include "scene/resources/camera_attributes.h"
#include "scene/resources/camera_texture.h"
-#include "scene/resources/capsule_shape_2d.h"
-#include "scene/resources/circle_shape_2d.h"
#include "scene/resources/compositor.h"
#include "scene/resources/compressed_texture.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
#include "scene/resources/curve_texture.h"
#include "scene/resources/environment.h"
#include "scene/resources/font.h"
@@ -174,25 +189,11 @@
#include "scene/resources/particle_process_material.h"
#include "scene/resources/physics_material.h"
#include "scene/resources/placeholder_textures.h"
-#include "scene/resources/polygon_path_finder.h"
#include "scene/resources/portable_compressed_texture.h"
-#include "scene/resources/rectangle_shape_2d.h"
#include "scene/resources/resource_format_text.h"
-#include "scene/resources/segment_shape_2d.h"
-#include "scene/resources/separation_ray_shape_2d.h"
#include "scene/resources/shader_include.h"
-#include "scene/resources/skeleton_modification_2d.h"
-#include "scene/resources/skeleton_modification_2d_ccdik.h"
-#include "scene/resources/skeleton_modification_2d_fabrik.h"
-#include "scene/resources/skeleton_modification_2d_jiggle.h"
-#include "scene/resources/skeleton_modification_2d_lookat.h"
-#include "scene/resources/skeleton_modification_2d_physicalbones.h"
-#include "scene/resources/skeleton_modification_2d_stackholder.h"
-#include "scene/resources/skeleton_modification_2d_twoboneik.h"
-#include "scene/resources/skeleton_modification_stack_2d.h"
#include "scene/resources/skeleton_profile.h"
#include "scene/resources/sky.h"
-#include "scene/resources/sky_material.h"
#include "scene/resources/style_box.h"
#include "scene/resources/style_box_flat.h"
#include "scene/resources/style_box_line.h"
@@ -205,14 +206,12 @@
#include "scene/resources/texture.h"
#include "scene/resources/texture_rd.h"
#include "scene/resources/theme.h"
-#include "scene/resources/tile_set.h"
#include "scene/resources/video_stream.h"
#include "scene/resources/visual_shader.h"
#include "scene/resources/visual_shader_nodes.h"
#include "scene/resources/visual_shader_particle_nodes.h"
#include "scene/resources/visual_shader_sdf_nodes.h"
#include "scene/resources/world_2d.h"
-#include "scene/resources/world_boundary_shape_2d.h"
#include "scene/scene_string_names.h"
#include "scene/theme/theme_db.h"
@@ -265,20 +264,21 @@
#include "scene/3d/xr_hand_modifier_3d.h"
#include "scene/3d/xr_nodes.h"
#include "scene/animation/root_motion_view.h"
-#include "scene/resources/box_shape_3d.h"
-#include "scene/resources/capsule_shape_3d.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
-#include "scene/resources/cylinder_shape_3d.h"
-#include "scene/resources/fog_material.h"
-#include "scene/resources/height_map_shape_3d.h"
-#include "scene/resources/importer_mesh.h"
-#include "scene/resources/mesh_library.h"
-#include "scene/resources/primitive_meshes.h"
-#include "scene/resources/separation_ray_shape_3d.h"
-#include "scene/resources/sphere_shape_3d.h"
-#include "scene/resources/world_3d.h"
-#include "scene/resources/world_boundary_shape_3d.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"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/cylinder_shape_3d.h"
+#include "scene/resources/3d/fog_material.h"
+#include "scene/resources/3d/height_map_shape_3d.h"
+#include "scene/resources/3d/importer_mesh.h"
+#include "scene/resources/3d/mesh_library.h"
+#include "scene/resources/3d/primitive_meshes.h"
+#include "scene/resources/3d/separation_ray_shape_3d.h"
+#include "scene/resources/3d/sky_material.h"
+#include "scene/resources/3d/sphere_shape_3d.h"
+#include "scene/resources/3d/world_3d.h"
+#include "scene/resources/3d/world_boundary_shape_3d.h"
#endif // _3D_DISABLED
static Ref<ResourceFormatSaverText> resource_saver_text;
diff --git a/scene/resources/2d/SCsub b/scene/resources/2d/SCsub
new file mode 100644
index 0000000000..fdf20e0bde
--- /dev/null
+++ b/scene/resources/2d/SCsub
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+Import("env")
+
+env.add_source_files(env.scene_sources, "*.cpp")
+env.add_source_files(env.scene_sources, "skeleton/*.cpp")
diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/2d/capsule_shape_2d.cpp
index 8268040ed9..8268040ed9 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/2d/capsule_shape_2d.cpp
diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/2d/capsule_shape_2d.h
index 4912466f96..cfd3fc6b26 100644
--- a/scene/resources/capsule_shape_2d.h
+++ b/scene/resources/2d/capsule_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef CAPSULE_SHAPE_2D_H
#define CAPSULE_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class CapsuleShape2D : public Shape2D {
GDCLASS(CapsuleShape2D, Shape2D);
diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/2d/circle_shape_2d.cpp
index 0b207c33ca..0b207c33ca 100644
--- a/scene/resources/circle_shape_2d.cpp
+++ b/scene/resources/2d/circle_shape_2d.cpp
diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/2d/circle_shape_2d.h
index ab0bff4ca8..203a8240eb 100644
--- a/scene/resources/circle_shape_2d.h
+++ b/scene/resources/2d/circle_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef CIRCLE_SHAPE_2D_H
#define CIRCLE_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class CircleShape2D : public Shape2D {
GDCLASS(CircleShape2D, Shape2D);
diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/2d/concave_polygon_shape_2d.cpp
index 56734a8f0b..56734a8f0b 100644
--- a/scene/resources/concave_polygon_shape_2d.cpp
+++ b/scene/resources/2d/concave_polygon_shape_2d.cpp
diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/2d/concave_polygon_shape_2d.h
index 7b3540a20d..8b0b77acaa 100644
--- a/scene/resources/concave_polygon_shape_2d.h
+++ b/scene/resources/2d/concave_polygon_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef CONCAVE_POLYGON_SHAPE_2D_H
#define CONCAVE_POLYGON_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class ConcavePolygonShape2D : public Shape2D {
GDCLASS(ConcavePolygonShape2D, Shape2D);
diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/2d/convex_polygon_shape_2d.cpp
index 0d9e570149..0d9e570149 100644
--- a/scene/resources/convex_polygon_shape_2d.cpp
+++ b/scene/resources/2d/convex_polygon_shape_2d.cpp
diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/2d/convex_polygon_shape_2d.h
index 71b98a0d25..2e448f1133 100644
--- a/scene/resources/convex_polygon_shape_2d.h
+++ b/scene/resources/2d/convex_polygon_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef CONVEX_POLYGON_SHAPE_2D_H
#define CONVEX_POLYGON_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class ConvexPolygonShape2D : public Shape2D {
GDCLASS(ConvexPolygonShape2D, Shape2D);
diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/2d/polygon_path_finder.cpp
index 617a53f0a3..617a53f0a3 100644
--- a/scene/resources/polygon_path_finder.cpp
+++ b/scene/resources/2d/polygon_path_finder.cpp
diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/2d/polygon_path_finder.h
index a6cf6cd584..a6cf6cd584 100644
--- a/scene/resources/polygon_path_finder.h
+++ b/scene/resources/2d/polygon_path_finder.h
diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/2d/rectangle_shape_2d.cpp
index 65b1653293..65b1653293 100644
--- a/scene/resources/rectangle_shape_2d.cpp
+++ b/scene/resources/2d/rectangle_shape_2d.cpp
diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/2d/rectangle_shape_2d.h
index f990b5967e..80fbc51b5c 100644
--- a/scene/resources/rectangle_shape_2d.h
+++ b/scene/resources/2d/rectangle_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef RECTANGLE_SHAPE_2D_H
#define RECTANGLE_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class RectangleShape2D : public Shape2D {
GDCLASS(RectangleShape2D, Shape2D);
diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/2d/segment_shape_2d.cpp
index 864b4c952b..864b4c952b 100644
--- a/scene/resources/segment_shape_2d.cpp
+++ b/scene/resources/2d/segment_shape_2d.cpp
diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/2d/segment_shape_2d.h
index 4bec192fd2..ad2ece883d 100644
--- a/scene/resources/segment_shape_2d.h
+++ b/scene/resources/2d/segment_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef SEGMENT_SHAPE_2D_H
#define SEGMENT_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class SegmentShape2D : public Shape2D {
GDCLASS(SegmentShape2D, Shape2D);
diff --git a/scene/resources/separation_ray_shape_2d.cpp b/scene/resources/2d/separation_ray_shape_2d.cpp
index 83d526626d..83d526626d 100644
--- a/scene/resources/separation_ray_shape_2d.cpp
+++ b/scene/resources/2d/separation_ray_shape_2d.cpp
diff --git a/scene/resources/separation_ray_shape_2d.h b/scene/resources/2d/separation_ray_shape_2d.h
index 8eab73d9c5..0359b41b6e 100644
--- a/scene/resources/separation_ray_shape_2d.h
+++ b/scene/resources/2d/separation_ray_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef SEPARATION_RAY_SHAPE_2D_H
#define SEPARATION_RAY_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class SeparationRayShape2D : public Shape2D {
GDCLASS(SeparationRayShape2D, Shape2D);
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/2d/shape_2d.cpp
index 2de9b70f53..2de9b70f53 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/2d/shape_2d.cpp
diff --git a/scene/resources/shape_2d.h b/scene/resources/2d/shape_2d.h
index b1a5b24d05..b1a5b24d05 100644
--- a/scene/resources/shape_2d.h
+++ b/scene/resources/2d/shape_2d.h
diff --git a/scene/resources/skeleton_modification_2d.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d.cpp
index 88a0f7b92d..88a0f7b92d 100644
--- a/scene/resources/skeleton_modification_2d.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d.cpp
diff --git a/scene/resources/skeleton_modification_2d.h b/scene/resources/2d/skeleton/skeleton_modification_2d.h
index c00c3c8dc2..413b860a99 100644
--- a/scene/resources/skeleton_modification_2d.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_stack_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_stack_2d.h"
///////////////////////////////////////
// SkeletonModification2D
diff --git a/scene/resources/skeleton_modification_2d_ccdik.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.cpp
index 1ad8d0eccc..1ad8d0eccc 100644
--- a/scene/resources/skeleton_modification_2d_ccdik.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.cpp
diff --git a/scene/resources/skeleton_modification_2d_ccdik.h b/scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.h
index 39ea02c1df..34da89c31c 100644
--- a/scene/resources/skeleton_modification_2d_ccdik.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_CCDIK_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DCCDIK
diff --git a/scene/resources/skeleton_modification_2d_fabrik.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.cpp
index dd1c4a91d5..dd1c4a91d5 100644
--- a/scene/resources/skeleton_modification_2d_fabrik.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.cpp
diff --git a/scene/resources/skeleton_modification_2d_fabrik.h b/scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.h
index 3c8f1f779c..edc29ecf12 100644
--- a/scene/resources/skeleton_modification_2d_fabrik.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_FABRIK_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DFABRIK
diff --git a/scene/resources/skeleton_modification_2d_jiggle.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.cpp
index 2ace9577e4..2ace9577e4 100644
--- a/scene/resources/skeleton_modification_2d_jiggle.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.cpp
diff --git a/scene/resources/skeleton_modification_2d_jiggle.h b/scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.h
index 9e0d8d1bd4..7e9855839c 100644
--- a/scene/resources/skeleton_modification_2d_jiggle.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_JIGGLE_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DJIGGLE
diff --git a/scene/resources/skeleton_modification_2d_lookat.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_lookat.cpp
index 8f6f6bc4ae..8f6f6bc4ae 100644
--- a/scene/resources/skeleton_modification_2d_lookat.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_lookat.cpp
diff --git a/scene/resources/skeleton_modification_2d_lookat.h b/scene/resources/2d/skeleton/skeleton_modification_2d_lookat.h
index d952d249f9..fbce45b83a 100644
--- a/scene/resources/skeleton_modification_2d_lookat.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_lookat.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_LOOKAT_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DLookAt
diff --git a/scene/resources/skeleton_modification_2d_physicalbones.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.cpp
index e000e947cd..e000e947cd 100644
--- a/scene/resources/skeleton_modification_2d_physicalbones.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.cpp
diff --git a/scene/resources/skeleton_modification_2d_physicalbones.h b/scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.h
index ec1b63bf73..09bf00782c 100644
--- a/scene/resources/skeleton_modification_2d_physicalbones.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_PHYSICALBONES_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DJIGGLE
diff --git a/scene/resources/skeleton_modification_2d_stackholder.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.cpp
index 6d4cd290f1..6d4cd290f1 100644
--- a/scene/resources/skeleton_modification_2d_stackholder.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.cpp
diff --git a/scene/resources/skeleton_modification_2d_stackholder.h b/scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.h
index 17fa5f5cfe..b1054f6429 100644
--- a/scene/resources/skeleton_modification_2d_stackholder.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_STACKHOLDER_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DJIGGLE
diff --git a/scene/resources/skeleton_modification_2d_twoboneik.cpp b/scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.cpp
index 4458cdc0e3..c3366d5c36 100644
--- a/scene/resources/skeleton_modification_2d_twoboneik.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.cpp
@@ -281,16 +281,16 @@ void SkeletonModification2DTwoBoneIK::update_joint_one_bone2d_cache() {
if (stack->skeleton->has_node(joint_one_bone2d_node)) {
Node *node = stack->skeleton->get_node(joint_one_bone2d_node);
ERR_FAIL_COND_MSG(!node || stack->skeleton == node,
- "Cannot update update joint one Bone2D cache: node is this modification's skeleton or cannot be found!");
+ "Cannot update joint one Bone2D cache: node is this modification's skeleton or cannot be found!");
ERR_FAIL_COND_MSG(!node->is_inside_tree(),
- "Cannot update update joint one Bone2D cache: node is not in the scene tree!");
+ "Cannot update joint one Bone2D cache: node is not in the scene tree!");
joint_one_bone2d_node_cache = node->get_instance_id();
Bone2D *bone = Object::cast_to<Bone2D>(node);
if (bone) {
joint_one_bone_idx = bone->get_index_in_skeleton();
} else {
- ERR_FAIL_MSG("update joint one Bone2D cache: Nodepath to Bone2D is not a Bone2D node!");
+ ERR_FAIL_MSG("Update joint one Bone2D cache: Nodepath to Bone2D is not a Bone2D node!");
}
}
}
@@ -309,16 +309,16 @@ void SkeletonModification2DTwoBoneIK::update_joint_two_bone2d_cache() {
if (stack->skeleton->has_node(joint_two_bone2d_node)) {
Node *node = stack->skeleton->get_node(joint_two_bone2d_node);
ERR_FAIL_COND_MSG(!node || stack->skeleton == node,
- "Cannot update update joint two Bone2D cache: node is this modification's skeleton or cannot be found!");
+ "Cannot update joint two Bone2D cache: node is this modification's skeleton or cannot be found!");
ERR_FAIL_COND_MSG(!node->is_inside_tree(),
- "Cannot update update joint two Bone2D cache: node is not in scene tree!");
+ "Cannot update joint two Bone2D cache: node is not in scene tree!");
joint_two_bone2d_node_cache = node->get_instance_id();
Bone2D *bone = Object::cast_to<Bone2D>(node);
if (bone) {
joint_two_bone_idx = bone->get_index_in_skeleton();
} else {
- ERR_FAIL_MSG("update joint two Bone2D cache: Nodepath to Bone2D is not a Bone2D node!");
+ ERR_FAIL_MSG("Update joint two Bone2D cache: Nodepath to Bone2D is not a Bone2D node!");
}
}
}
diff --git a/scene/resources/skeleton_modification_2d_twoboneik.h b/scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.h
index 7a5cd91c86..d528ffa66b 100644
--- a/scene/resources/skeleton_modification_2d_twoboneik.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_2D_TWOBONEIK_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModification2DJIGGLE
diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/2d/skeleton/skeleton_modification_stack_2d.cpp
index dcc69d4831..dcc69d4831 100644
--- a/scene/resources/skeleton_modification_stack_2d.cpp
+++ b/scene/resources/2d/skeleton/skeleton_modification_stack_2d.cpp
diff --git a/scene/resources/skeleton_modification_stack_2d.h b/scene/resources/2d/skeleton/skeleton_modification_stack_2d.h
index 6e501436fd..0732153997 100644
--- a/scene/resources/skeleton_modification_stack_2d.h
+++ b/scene/resources/2d/skeleton/skeleton_modification_stack_2d.h
@@ -32,7 +32,7 @@
#define SKELETON_MODIFICATION_STACK_2D_H
#include "scene/2d/skeleton_2d.h"
-#include "scene/resources/skeleton_modification_2d.h"
+#include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
///////////////////////////////////////
// SkeletonModificationStack2D
diff --git a/scene/resources/tile_set.compat.inc b/scene/resources/2d/tile_set.compat.inc
index 873ae3aa93..873ae3aa93 100644
--- a/scene/resources/tile_set.compat.inc
+++ b/scene/resources/2d/tile_set.compat.inc
diff --git a/scene/resources/tile_set.cpp b/scene/resources/2d/tile_set.cpp
index 7e08d727ac..5ac7f127b0 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/2d/tile_set.cpp
@@ -36,7 +36,6 @@
#include "core/templates/local_vector.h"
#include "core/templates/rb_set.h"
#include "scene/gui/control.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
#include "scene/resources/image_texture.h"
#include "servers/navigation_server_2d.h"
diff --git a/scene/resources/tile_set.h b/scene/resources/2d/tile_set.h
index f26ed461c3..b55afd2de5 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/2d/tile_set.h
@@ -37,13 +37,11 @@
#include "core/templates/rb_set.h"
#include "scene/2d/light_occluder_2d.h"
#include "scene/main/canvas_item.h"
-#include "scene/resources/concave_polygon_shape_2d.h"
-#include "scene/resources/convex_polygon_shape_2d.h"
+#include "scene/resources/2d/convex_polygon_shape_2d.h"
#include "scene/resources/image_texture.h"
#include "scene/resources/navigation_polygon.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/physics_material.h"
-#include "scene/resources/shape_2d.h"
#ifndef DISABLE_DEPRECATED
#include "scene/resources/shader.h"
diff --git a/scene/resources/world_boundary_shape_2d.cpp b/scene/resources/2d/world_boundary_shape_2d.cpp
index 294653659a..294653659a 100644
--- a/scene/resources/world_boundary_shape_2d.cpp
+++ b/scene/resources/2d/world_boundary_shape_2d.cpp
diff --git a/scene/resources/world_boundary_shape_2d.h b/scene/resources/2d/world_boundary_shape_2d.h
index a79b8e4e1f..a7f11e39b7 100644
--- a/scene/resources/world_boundary_shape_2d.h
+++ b/scene/resources/2d/world_boundary_shape_2d.h
@@ -31,7 +31,7 @@
#ifndef WORLD_BOUNDARY_SHAPE_2D_H
#define WORLD_BOUNDARY_SHAPE_2D_H
-#include "scene/resources/shape_2d.h"
+#include "scene/resources/2d/shape_2d.h"
class WorldBoundaryShape2D : public Shape2D {
GDCLASS(WorldBoundaryShape2D, Shape2D);
diff --git a/scene/resources/3d/SCsub b/scene/resources/3d/SCsub
new file mode 100644
index 0000000000..fdf20e0bde
--- /dev/null
+++ b/scene/resources/3d/SCsub
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+Import("env")
+
+env.add_source_files(env.scene_sources, "*.cpp")
+env.add_source_files(env.scene_sources, "skeleton/*.cpp")
diff --git a/scene/resources/box_shape_3d.cpp b/scene/resources/3d/box_shape_3d.cpp
index 313aeb1bca..313aeb1bca 100644
--- a/scene/resources/box_shape_3d.cpp
+++ b/scene/resources/3d/box_shape_3d.cpp
diff --git a/scene/resources/box_shape_3d.h b/scene/resources/3d/box_shape_3d.h
index 8903a049e1..45c1cde5d7 100644
--- a/scene/resources/box_shape_3d.h
+++ b/scene/resources/3d/box_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef BOX_SHAPE_3D_H
#define BOX_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class BoxShape3D : public Shape3D {
GDCLASS(BoxShape3D, Shape3D);
diff --git a/scene/resources/capsule_shape_3d.cpp b/scene/resources/3d/capsule_shape_3d.cpp
index 9e16801060..9e16801060 100644
--- a/scene/resources/capsule_shape_3d.cpp
+++ b/scene/resources/3d/capsule_shape_3d.cpp
diff --git a/scene/resources/capsule_shape_3d.h b/scene/resources/3d/capsule_shape_3d.h
index 48e5851c18..90ee3b584a 100644
--- a/scene/resources/capsule_shape_3d.h
+++ b/scene/resources/3d/capsule_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef CAPSULE_SHAPE_3D_H
#define CAPSULE_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class CapsuleShape3D : public Shape3D {
GDCLASS(CapsuleShape3D, Shape3D);
diff --git a/scene/resources/concave_polygon_shape_3d.cpp b/scene/resources/3d/concave_polygon_shape_3d.cpp
index 82b125905f..82b125905f 100644
--- a/scene/resources/concave_polygon_shape_3d.cpp
+++ b/scene/resources/3d/concave_polygon_shape_3d.cpp
diff --git a/scene/resources/concave_polygon_shape_3d.h b/scene/resources/3d/concave_polygon_shape_3d.h
index 89ff742cb1..a5e46474d5 100644
--- a/scene/resources/concave_polygon_shape_3d.h
+++ b/scene/resources/3d/concave_polygon_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef CONCAVE_POLYGON_SHAPE_3D_H
#define CONCAVE_POLYGON_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class ConcavePolygonShape3D : public Shape3D {
GDCLASS(ConcavePolygonShape3D, Shape3D);
diff --git a/scene/resources/convex_polygon_shape_3d.cpp b/scene/resources/3d/convex_polygon_shape_3d.cpp
index 3bfeeca461..3bfeeca461 100644
--- a/scene/resources/convex_polygon_shape_3d.cpp
+++ b/scene/resources/3d/convex_polygon_shape_3d.cpp
diff --git a/scene/resources/convex_polygon_shape_3d.h b/scene/resources/3d/convex_polygon_shape_3d.h
index deb3d30f9b..7d1ac123c6 100644
--- a/scene/resources/convex_polygon_shape_3d.h
+++ b/scene/resources/3d/convex_polygon_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef CONVEX_POLYGON_SHAPE_3D_H
#define CONVEX_POLYGON_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class ConvexPolygonShape3D : public Shape3D {
GDCLASS(ConvexPolygonShape3D, Shape3D);
diff --git a/scene/resources/cylinder_shape_3d.cpp b/scene/resources/3d/cylinder_shape_3d.cpp
index a91282fd33..a91282fd33 100644
--- a/scene/resources/cylinder_shape_3d.cpp
+++ b/scene/resources/3d/cylinder_shape_3d.cpp
diff --git a/scene/resources/cylinder_shape_3d.h b/scene/resources/3d/cylinder_shape_3d.h
index ea4b3bb96c..bd57bc2a97 100644
--- a/scene/resources/cylinder_shape_3d.h
+++ b/scene/resources/3d/cylinder_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef CYLINDER_SHAPE_3D_H
#define CYLINDER_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class CylinderShape3D : public Shape3D {
GDCLASS(CylinderShape3D, Shape3D);
diff --git a/scene/resources/fog_material.cpp b/scene/resources/3d/fog_material.cpp
index 5e4f1970ee..5e4f1970ee 100644
--- a/scene/resources/fog_material.cpp
+++ b/scene/resources/3d/fog_material.cpp
diff --git a/scene/resources/fog_material.h b/scene/resources/3d/fog_material.h
index 7557fd5114..7557fd5114 100644
--- a/scene/resources/fog_material.h
+++ b/scene/resources/3d/fog_material.h
diff --git a/scene/resources/height_map_shape_3d.cpp b/scene/resources/3d/height_map_shape_3d.cpp
index 35c905bd43..35c905bd43 100644
--- a/scene/resources/height_map_shape_3d.cpp
+++ b/scene/resources/3d/height_map_shape_3d.cpp
diff --git a/scene/resources/height_map_shape_3d.h b/scene/resources/3d/height_map_shape_3d.h
index eff025c816..363d9ec0e9 100644
--- a/scene/resources/height_map_shape_3d.h
+++ b/scene/resources/3d/height_map_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef HEIGHT_MAP_SHAPE_3D_H
#define HEIGHT_MAP_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class HeightMapShape3D : public Shape3D {
GDCLASS(HeightMapShape3D, Shape3D);
diff --git a/scene/resources/importer_mesh.cpp b/scene/resources/3d/importer_mesh.cpp
index 952e99608d..952e99608d 100644
--- a/scene/resources/importer_mesh.cpp
+++ b/scene/resources/3d/importer_mesh.cpp
diff --git a/scene/resources/importer_mesh.h b/scene/resources/3d/importer_mesh.h
index 7a19aabd29..ff8683449b 100644
--- a/scene/resources/importer_mesh.h
+++ b/scene/resources/3d/importer_mesh.h
@@ -33,8 +33,8 @@
#include "core/io/resource.h"
#include "core/templates/local_vector.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
#include "scene/resources/mesh.h"
#include "scene/resources/navigation_mesh.h"
diff --git a/scene/resources/mesh_library.cpp b/scene/resources/3d/mesh_library.cpp
index c2f721a80f..c2f721a80f 100644
--- a/scene/resources/mesh_library.cpp
+++ b/scene/resources/3d/mesh_library.cpp
diff --git a/scene/resources/mesh_library.h b/scene/resources/3d/mesh_library.h
index f1a1e3e273..f1a1e3e273 100644
--- a/scene/resources/mesh_library.h
+++ b/scene/resources/3d/mesh_library.h
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/3d/primitive_meshes.cpp
index b8b4854109..b8b4854109 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/3d/primitive_meshes.cpp
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/3d/primitive_meshes.h
index 5b788b726e..5b788b726e 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/3d/primitive_meshes.h
diff --git a/scene/resources/separation_ray_shape_3d.cpp b/scene/resources/3d/separation_ray_shape_3d.cpp
index 07e93b8b79..07e93b8b79 100644
--- a/scene/resources/separation_ray_shape_3d.cpp
+++ b/scene/resources/3d/separation_ray_shape_3d.cpp
diff --git a/scene/resources/separation_ray_shape_3d.h b/scene/resources/3d/separation_ray_shape_3d.h
index bf42aba77f..f24f0eae9e 100644
--- a/scene/resources/separation_ray_shape_3d.h
+++ b/scene/resources/3d/separation_ray_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef SEPARATION_RAY_SHAPE_3D_H
#define SEPARATION_RAY_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class SeparationRayShape3D : public Shape3D {
GDCLASS(SeparationRayShape3D, Shape3D);
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/3d/shape_3d.cpp
index 5a79392ba5..5a79392ba5 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/3d/shape_3d.cpp
diff --git a/scene/resources/shape_3d.h b/scene/resources/3d/shape_3d.h
index 5e6cdbe421..5e6cdbe421 100644
--- a/scene/resources/shape_3d.h
+++ b/scene/resources/3d/shape_3d.h
diff --git a/scene/resources/skin.cpp b/scene/resources/3d/skin.cpp
index a4fb371ece..a4fb371ece 100644
--- a/scene/resources/skin.cpp
+++ b/scene/resources/3d/skin.cpp
diff --git a/scene/resources/skin.h b/scene/resources/3d/skin.h
index 5df820660c..5df820660c 100644
--- a/scene/resources/skin.h
+++ b/scene/resources/3d/skin.h
diff --git a/scene/resources/sky_material.cpp b/scene/resources/3d/sky_material.cpp
index 640261d615..640261d615 100644
--- a/scene/resources/sky_material.cpp
+++ b/scene/resources/3d/sky_material.cpp
diff --git a/scene/resources/sky_material.h b/scene/resources/3d/sky_material.h
index 4ffb18c6b4..4ffb18c6b4 100644
--- a/scene/resources/sky_material.h
+++ b/scene/resources/3d/sky_material.h
diff --git a/scene/resources/sphere_shape_3d.cpp b/scene/resources/3d/sphere_shape_3d.cpp
index 56b78471ec..56b78471ec 100644
--- a/scene/resources/sphere_shape_3d.cpp
+++ b/scene/resources/3d/sphere_shape_3d.cpp
diff --git a/scene/resources/sphere_shape_3d.h b/scene/resources/3d/sphere_shape_3d.h
index e98eff12e2..8e95cea608 100644
--- a/scene/resources/sphere_shape_3d.h
+++ b/scene/resources/3d/sphere_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef SPHERE_SHAPE_3D_H
#define SPHERE_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class SphereShape3D : public Shape3D {
GDCLASS(SphereShape3D, Shape3D);
diff --git a/scene/resources/world_3d.cpp b/scene/resources/3d/world_3d.cpp
index bf91b1eb33..bf91b1eb33 100644
--- a/scene/resources/world_3d.cpp
+++ b/scene/resources/3d/world_3d.cpp
diff --git a/scene/resources/world_3d.h b/scene/resources/3d/world_3d.h
index 06b06aea98..06b06aea98 100644
--- a/scene/resources/world_3d.h
+++ b/scene/resources/3d/world_3d.h
diff --git a/scene/resources/world_boundary_shape_3d.cpp b/scene/resources/3d/world_boundary_shape_3d.cpp
index beaaddc95e..beaaddc95e 100644
--- a/scene/resources/world_boundary_shape_3d.cpp
+++ b/scene/resources/3d/world_boundary_shape_3d.cpp
diff --git a/scene/resources/world_boundary_shape_3d.h b/scene/resources/3d/world_boundary_shape_3d.h
index 1f4cc67475..06cff6aa9a 100644
--- a/scene/resources/world_boundary_shape_3d.h
+++ b/scene/resources/3d/world_boundary_shape_3d.h
@@ -31,7 +31,7 @@
#ifndef WORLD_BOUNDARY_SHAPE_3D_H
#define WORLD_BOUNDARY_SHAPE_3D_H
-#include "scene/resources/shape_3d.h"
+#include "scene/resources/3d/shape_3d.h"
class WorldBoundaryShape3D : public Shape3D {
GDCLASS(WorldBoundaryShape3D, Shape3D);
diff --git a/scene/resources/SCsub b/scene/resources/SCsub
index 9e21c627f9..ceff213a02 100644
--- a/scene/resources/SCsub
+++ b/scene/resources/SCsub
@@ -22,3 +22,6 @@ env.scene_sources += scene_obj
# Needed to force rebuilding the scene files when the thirdparty code is updated.
env.Depends(scene_obj, thirdparty_obj)
+
+SConscript("2d/SCsub")
+SConscript("3d/SCsub")
diff --git a/scene/resources/immediate_mesh.cpp b/scene/resources/immediate_mesh.cpp
index a51e28c9fe..907c0ab4ca 100644
--- a/scene/resources/immediate_mesh.cpp
+++ b/scene/resources/immediate_mesh.cpp
@@ -208,7 +208,7 @@ void ImmediateMesh::surface_end() {
if (uses_tangents) {
t = tangents[i].normal.octahedron_tangent_encode(tangents[i].d);
} else {
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(normals[i].normalized());
+ Vector3 tan = Vector3(normals[i].z, -normals[i].x, normals[i].y).cross(normals[i].normalized()).normalized();
t = tan.octahedron_tangent_encode(1.0);
}
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index dcad58e6e2..a4e634af36 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -34,8 +34,8 @@
#include "core/templates/pair.h"
#include "scene/resources/surface_tool.h"
-#include "scene/resources/concave_polygon_shape_3d.h"
-#include "scene/resources/convex_polygon_shape_3d.h"
+#include "scene/resources/3d/concave_polygon_shape_3d.h"
+#include "scene/resources/3d/convex_polygon_shape_3d.h"
void MeshConvexDecompositionSettings::set_max_concavity(real_t p_max_concavity) {
max_concavity = CLAMP(p_max_concavity, 0.001, 1.0);
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h
index 5233d75009..5c0e4e60aa 100644
--- a/scene/resources/mesh.h
+++ b/scene/resources/mesh.h
@@ -34,6 +34,7 @@
#include "core/io/resource.h"
#include "core/math/face3.h"
#include "core/math/triangle_mesh.h"
+#include "scene/resources/3d/shape_3d.h"
#include "scene/resources/material.h"
#include "servers/rendering_server.h"
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index 653f234d3d..f51d8dd0bf 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -880,9 +880,9 @@ void SurfaceTool::create_vertex_array_from_triangle_arrays(const Array &p_arrays
v.normal = narr[i];
}
if (lformat & RS::ARRAY_FORMAT_TANGENT) {
- Plane p(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2], tarr[i * 4 + 3]);
- v.tangent = p.normal;
- v.binormal = p.normal.cross(v.tangent).normalized() * p.d;
+ v.tangent = Vector3(tarr[i * 4 + 0], tarr[i * 4 + 1], tarr[i * 4 + 2]);
+ float d = tarr[i * 4 + 3];
+ v.binormal = v.normal.cross(v.tangent).normalized() * d;
}
if (lformat & RS::ARRAY_FORMAT_COLOR) {
v.color = carr[i];
diff --git a/scu_builders.py b/scu_builders.py
index 56effb393c..1a75f19b30 100644
--- a/scu_builders.py
+++ b/scu_builders.py
@@ -315,6 +315,8 @@ def generate_scu_files(max_includes_per_scu):
process_folder(["scene/gui"])
process_folder(["scene/main"])
process_folder(["scene/resources"])
+ process_folder(["scene/resources/2d"])
+ process_folder(["scene/resources/3d"])
process_folder(["servers"])
process_folder(["servers/rendering"])
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 1f362ffd21..9d3def1246 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -374,7 +374,7 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
if (new_surface.vertex_data.size()) {
// If we have an uncompressed surface that contains normals, but not tangents, we need to differentiate the array
- // from a compressed array in the shader. To do so, we allow the the normal to read 4 components out of the buffer
+ // from a compressed array in the shader. To do so, we allow the normal to read 4 components out of the buffer
// But only give it 2 components per normal. So essentially, each vertex reads the next normal in normal.zw.
// This allows us to avoid adding a shader permutation, and avoid passing dummy tangents. Since the stride is kept small
// this should still be a net win for bandwidth.
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp
index 2cfee25f91..e1709fdb00 100644
--- a/servers/rendering/rendering_device.cpp
+++ b/servers/rendering/rendering_device.cpp
@@ -3782,12 +3782,12 @@ void RenderingDevice::draw_list_draw(DrawListID p_list, bool p_use_indices, uint
#ifdef DEBUG_ENABLED
if (dl->state.sets[i].pipeline_expected_format != dl->state.sets[i].uniform_set_format) {
if (dl->state.sets[i].uniform_set_format == 0) {
- ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline");
+ ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline.");
} else if (uniform_set_owner.owns(dl->state.sets[i].uniform_set)) {
UniformSet *us = uniform_set_owner.get_or_null(dl->state.sets[i].uniform_set);
ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(dl->state.pipeline_shader));
} else {
- ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(dl->state.pipeline_shader));
+ ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(dl->state.pipeline_shader));
}
}
#endif
@@ -4173,12 +4173,12 @@ void RenderingDevice::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_g
#ifdef DEBUG_ENABLED
if (cl->state.sets[i].pipeline_expected_format != cl->state.sets[i].uniform_set_format) {
if (cl->state.sets[i].uniform_set_format == 0) {
- ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline");
+ ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline.");
} else if (uniform_set_owner.owns(cl->state.sets[i].uniform_set)) {
UniformSet *us = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set);
ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
} else {
- ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
+ ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
}
}
#endif
@@ -4271,7 +4271,7 @@ void RenderingDevice::compute_list_dispatch_indirect(ComputeListID p_list, RID p
UniformSet *us = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set);
ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
} else {
- ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
+ ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader));
}
}
#endif
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index 6e9b525f31..e5d8800366 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -340,7 +340,7 @@ void _get_axis_angle(const Vector3 &p_normal, const Vector4 &p_tangent, float &r
if (d < 0.0) {
r_angle = CLAMP((1.0 - r_angle / Math_PI) * 0.5, 0.0, 0.49999);
} else {
- r_angle = (r_angle / Math_PI) * 0.5 + 0.5;
+ r_angle = CLAMP((r_angle / Math_PI) * 0.5 + 0.5, 0.500008, 1.0);
}
}
@@ -566,7 +566,8 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint64_t p_format, uint
float angle;
Vector3 axis;
// Generate an arbitrary vector that is tangential to normal.
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(normal_src[i].normalized());
+ // This assumes that the normal is never (0,0,0).
+ Vector3 tan = Vector3(normal_src[i].z, -normal_src[i].x, normal_src[i].y).cross(normal_src[i].normalized()).normalized();
Vector4 tangent = Vector4(tan.x, tan.y, tan.z, 1.0);
_get_axis_angle(normal_src[i], tangent, angle, axis);
@@ -689,7 +690,8 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint64_t p_format, uint
// Set data for tangent.
for (int i = 0; i < p_vertex_array_len; i++) {
// Generate an arbitrary vector that is tangential to normal.
- Vector3 tan = Vector3(0.0, 1.0, 0.0).cross(normal_src[i].normalized());
+ // This assumes that the normal is never (0,0,0).
+ Vector3 tan = Vector3(normal_src[i].z, -normal_src[i].x, normal_src[i].y).cross(normal_src[i].normalized()).normalized();
Vector2 res = tan.octahedron_tangent_encode(1.0);
uint16_t vector[2] = {
(uint16_t)CLAMP(res.x * 65535, 0, 65535),
diff --git a/tests/scene/test_arraymesh.h b/tests/scene/test_arraymesh.h
index 1623b41300..67aa19c5d3 100644
--- a/tests/scene/test_arraymesh.h
+++ b/tests/scene/test_arraymesh.h
@@ -31,8 +31,8 @@
#ifndef TEST_ARRAYMESH_H
#define TEST_ARRAYMESH_H
+#include "scene/resources/3d/primitive_meshes.h"
#include "scene/resources/mesh.h"
-#include "scene/resources/primitive_meshes.h"
#include "tests/test_macros.h"
diff --git a/tests/scene/test_navigation_region_3d.h b/tests/scene/test_navigation_region_3d.h
index f7cf7c7912..372f6dc505 100644
--- a/tests/scene/test_navigation_region_3d.h
+++ b/tests/scene/test_navigation_region_3d.h
@@ -34,7 +34,7 @@
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/navigation_region_3d.h"
#include "scene/main/window.h"
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "tests/test_macros.h"
diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h
index 36b9b17b27..f105e1ac04 100644
--- a/tests/scene/test_primitives.h
+++ b/tests/scene/test_primitives.h
@@ -31,7 +31,7 @@
#ifndef TEST_PRIMITIVES_H
#define TEST_PRIMITIVES_H
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "tests/test_macros.h"
diff --git a/tests/scene/test_viewport.h b/tests/scene/test_viewport.h
index 1afae66ee0..e15b01ae9f 100644
--- a/tests/scene/test_viewport.h
+++ b/tests/scene/test_viewport.h
@@ -37,7 +37,7 @@
#include "scene/gui/subviewport_container.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
-#include "scene/resources/rectangle_shape_2d.h"
+#include "scene/resources/2d/rectangle_shape_2d.h"
#include "tests/test_macros.h"
diff --git a/tests/servers/test_navigation_server_3d.h b/tests/servers/test_navigation_server_3d.h
index 5b5c1faac8..b5547f2c94 100644
--- a/tests/servers/test_navigation_server_3d.h
+++ b/tests/servers/test_navigation_server_3d.h
@@ -32,7 +32,7 @@
#define TEST_NAVIGATION_SERVER_3D_H
#include "scene/3d/mesh_instance_3d.h"
-#include "scene/resources/primitive_meshes.h"
+#include "scene/resources/3d/primitive_meshes.h"
#include "servers/navigation_server_3d.h"
#include "tests/test_macros.h"
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 69a9d70756..4c276b3c00 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -724,7 +724,7 @@ with the provided patch.
## openxr
- Upstream: https://github.com/KhronosGroup/OpenXR-SDK
-- Version: 1.0.33 (dc1e23937fe45eabcce80f6588cf47449edb29d1, 2024)
+- Version: 1.0.34 (288d3a7ebc1ad959f62d51da75baa3d27438c499, 2024)
- License: Apache 2.0
Files extracted from upstream source:
diff --git a/thirdparty/openxr/include/openxr/openxr.h b/thirdparty/openxr/include/openxr/openxr.h
index 3e9d6599bb..c0c826b981 100644
--- a/thirdparty/openxr/include/openxr/openxr.h
+++ b/thirdparty/openxr/include/openxr/openxr.h
@@ -25,7 +25,7 @@ extern "C" {
((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL))
// OpenXR current version number.
-#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 33)
+#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 34)
#define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL)
#define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL)
@@ -549,11 +549,19 @@ typedef enum XrStructureType {
XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB = 1000238001,
XR_TYPE_SPACE_USER_CREATE_INFO_FB = 1000241001,
XR_TYPE_SYSTEM_HEADSET_ID_PROPERTIES_META = 1000245000,
+ XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_META = 1000254000,
+ XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_GET_INFO_META = 1000254001,
XR_TYPE_SYSTEM_PASSTHROUGH_COLOR_LUT_PROPERTIES_META = 1000266000,
XR_TYPE_PASSTHROUGH_COLOR_LUT_CREATE_INFO_META = 1000266001,
XR_TYPE_PASSTHROUGH_COLOR_LUT_UPDATE_INFO_META = 1000266002,
XR_TYPE_PASSTHROUGH_COLOR_MAP_LUT_META = 1000266100,
XR_TYPE_PASSTHROUGH_COLOR_MAP_INTERPOLATED_LUT_META = 1000266101,
+ XR_TYPE_SPACE_TRIANGLE_MESH_GET_INFO_META = 1000269001,
+ XR_TYPE_SPACE_TRIANGLE_MESH_META = 1000269002,
+ XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES2_FB = 1000287013,
+ XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB = 1000287014,
+ XR_TYPE_FACE_EXPRESSION_INFO2_FB = 1000287015,
+ XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB = 1000287016,
XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC = 1000317001,
XR_TYPE_PASSTHROUGH_COLOR_HTC = 1000317002,
XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC = 1000317003,
@@ -575,6 +583,8 @@ typedef enum XrStructureType {
XR_TYPE_PLANE_DETECTOR_LOCATION_EXT = 1000429005,
XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT = 1000429006,
XR_TYPE_SYSTEM_PLANE_DETECTION_PROPERTIES_EXT = 1000429007,
+ XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT = 1000470000,
+ XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT = 1000470001,
XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR,
XR_TYPE_SWAPCHAIN_IMAGE_VULKAN2_KHR = XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR,
XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN2_KHR = XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR,
@@ -672,6 +682,7 @@ typedef enum XrObjectType {
XR_OBJECT_TYPE_VIRTUAL_KEYBOARD_META = 1000219000,
XR_OBJECT_TYPE_SPACE_USER_FB = 1000241000,
XR_OBJECT_TYPE_PASSTHROUGH_COLOR_LUT_META = 1000266000,
+ XR_OBJECT_TYPE_FACE_TRACKER2_FB = 1000287012,
XR_OBJECT_TYPE_PASSTHROUGH_HTC = 1000317000,
XR_OBJECT_TYPE_PLANE_DETECTOR_EXT = 1000429000,
XR_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
@@ -3616,7 +3627,7 @@ typedef struct XrHandTrackingCapsulesStateFB {
#define XR_FB_spatial_entity 1
XR_DEFINE_ATOM(XrAsyncRequestIdFB)
#define XR_UUID_SIZE_EXT 16
-#define XR_FB_spatial_entity_SPEC_VERSION 2
+#define XR_FB_spatial_entity_SPEC_VERSION 3
#define XR_FB_SPATIAL_ENTITY_EXTENSION_NAME "XR_FB_spatial_entity"
typedef enum XrSpaceComponentTypeFB {
@@ -3628,6 +3639,7 @@ typedef enum XrSpaceComponentTypeFB {
XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB = 5,
XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB = 6,
XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB = 7,
+ XR_SPACE_COMPONENT_TYPE_TRIANGLE_MESH_META = 1000269000,
XR_SPACE_COMPONENT_TYPE_MAX_ENUM_FB = 0x7FFFFFFF
} XrSpaceComponentTypeFB;
// XrSystemSpatialEntityPropertiesFB extends XrSystemProperties
@@ -4332,6 +4344,11 @@ XRAPI_ATTR XrResult XRAPI_CALL xrSetViewOffsetVARJO(
#endif /* !XR_NO_PROTOTYPES */
+#define XR_VARJO_xr4_controller_interaction 1
+#define XR_VARJO_xr4_controller_interaction_SPEC_VERSION 1
+#define XR_VARJO_XR4_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_VARJO_xr4_controller_interaction"
+
+
#define XR_ML_ml2_controller_interaction 1
#define XR_ML_ml2_controller_interaction_SPEC_VERSION 1
#define XR_ML_ML2_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_ML_ml2_controller_interaction"
@@ -5151,13 +5168,14 @@ typedef struct XrHapticAmplitudeEnvelopeVibrationFB {
#define XR_FB_scene 1
-#define XR_FB_scene_SPEC_VERSION 3
+#define XR_FB_scene_SPEC_VERSION 4
#define XR_FB_SCENE_EXTENSION_NAME "XR_FB_scene"
typedef XrFlags64 XrSemanticLabelsSupportFlagsFB;
// Flag bits for XrSemanticLabelsSupportFlagsFB
static const XrSemanticLabelsSupportFlagsFB XR_SEMANTIC_LABELS_SUPPORT_MULTIPLE_SEMANTIC_LABELS_BIT_FB = 0x00000001;
static const XrSemanticLabelsSupportFlagsFB XR_SEMANTIC_LABELS_SUPPORT_ACCEPT_DESK_TO_TABLE_MIGRATION_BIT_FB = 0x00000002;
+static const XrSemanticLabelsSupportFlagsFB XR_SEMANTIC_LABELS_SUPPORT_ACCEPT_INVISIBLE_WALL_FACE_BIT_FB = 0x00000004;
typedef struct XrExtent3DfFB {
float width;
@@ -5612,6 +5630,7 @@ static const XrCompositionLayerSettingsFlagsFB XR_COMPOSITION_LAYER_SETTINGS_NOR
static const XrCompositionLayerSettingsFlagsFB XR_COMPOSITION_LAYER_SETTINGS_QUALITY_SUPER_SAMPLING_BIT_FB = 0x00000002;
static const XrCompositionLayerSettingsFlagsFB XR_COMPOSITION_LAYER_SETTINGS_NORMAL_SHARPENING_BIT_FB = 0x00000004;
static const XrCompositionLayerSettingsFlagsFB XR_COMPOSITION_LAYER_SETTINGS_QUALITY_SHARPENING_BIT_FB = 0x00000008;
+static const XrCompositionLayerSettingsFlagsFB XR_COMPOSITION_LAYER_SETTINGS_AUTO_LAYER_FILTER_BIT_META = 0x00000020;
// XrCompositionLayerSettingsFB extends XrCompositionLayerBaseHeader
typedef struct XrCompositionLayerSettingsFB {
@@ -6115,7 +6134,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpaceUserFB(
#define XR_META_headset_id 1
-#define XR_META_headset_id_SPEC_VERSION 1
+#define XR_META_headset_id_SPEC_VERSION 2
#define XR_META_HEADSET_ID_EXTENSION_NAME "XR_META_headset_id"
// XrSystemHeadsetIdPropertiesMETA extends XrSystemProperties
typedef struct XrSystemHeadsetIdPropertiesMETA {
@@ -6126,6 +6145,35 @@ typedef struct XrSystemHeadsetIdPropertiesMETA {
+#define XR_META_recommended_layer_resolution 1
+#define XR_META_recommended_layer_resolution_SPEC_VERSION 1
+#define XR_META_RECOMMENDED_LAYER_RESOLUTION_EXTENSION_NAME "XR_META_recommended_layer_resolution"
+typedef struct XrRecommendedLayerResolutionMETA {
+ XrStructureType type;
+ void* XR_MAY_ALIAS next;
+ XrExtent2Di recommendedImageDimensions;
+ XrBool32 isValid;
+} XrRecommendedLayerResolutionMETA;
+
+typedef struct XrRecommendedLayerResolutionGetInfoMETA {
+ XrStructureType type;
+ const void* XR_MAY_ALIAS next;
+ const XrCompositionLayerBaseHeader* layer;
+ XrTime predictedDisplayTime;
+} XrRecommendedLayerResolutionGetInfoMETA;
+
+typedef XrResult (XRAPI_PTR *PFN_xrGetRecommendedLayerResolutionMETA)(XrSession session, const XrRecommendedLayerResolutionGetInfoMETA* info, XrRecommendedLayerResolutionMETA* resolution);
+
+#ifndef XR_NO_PROTOTYPES
+#ifdef XR_EXTENSION_PROTOTYPES
+XRAPI_ATTR XrResult XRAPI_CALL xrGetRecommendedLayerResolutionMETA(
+ XrSession session,
+ const XrRecommendedLayerResolutionGetInfoMETA* info,
+ XrRecommendedLayerResolutionMETA* resolution);
+#endif /* XR_EXTENSION_PROTOTYPES */
+#endif /* !XR_NO_PROTOTYPES */
+
+
#define XR_META_passthrough_color_lut 1
XR_DEFINE_HANDLE(XrPassthroughColorLutMETA)
#define XR_META_passthrough_color_lut_SPEC_VERSION 1
@@ -6200,11 +6248,201 @@ XRAPI_ATTR XrResult XRAPI_CALL xrUpdatePassthroughColorLutMETA(
#endif /* !XR_NO_PROTOTYPES */
+#define XR_META_spatial_entity_mesh 1
+#define XR_META_spatial_entity_mesh_SPEC_VERSION 1
+#define XR_META_SPATIAL_ENTITY_MESH_EXTENSION_NAME "XR_META_spatial_entity_mesh"
+typedef struct XrSpaceTriangleMeshGetInfoMETA {
+ XrStructureType type;
+ const void* XR_MAY_ALIAS next;
+} XrSpaceTriangleMeshGetInfoMETA;
+
+typedef struct XrSpaceTriangleMeshMETA {
+ XrStructureType type;
+ void* XR_MAY_ALIAS next;
+ uint32_t vertexCapacityInput;
+ uint32_t vertexCountOutput;
+ XrVector3f* vertices;
+ uint32_t indexCapacityInput;
+ uint32_t indexCountOutput;
+ uint32_t* indices;
+} XrSpaceTriangleMeshMETA;
+
+typedef XrResult (XRAPI_PTR *PFN_xrGetSpaceTriangleMeshMETA)(XrSpace space, const XrSpaceTriangleMeshGetInfoMETA* getInfo, XrSpaceTriangleMeshMETA* triangleMeshOutput);
+
+#ifndef XR_NO_PROTOTYPES
+#ifdef XR_EXTENSION_PROTOTYPES
+XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceTriangleMeshMETA(
+ XrSpace space,
+ const XrSpaceTriangleMeshGetInfoMETA* getInfo,
+ XrSpaceTriangleMeshMETA* triangleMeshOutput);
+#endif /* XR_EXTENSION_PROTOTYPES */
+#endif /* !XR_NO_PROTOTYPES */
+
+
+#define XR_META_automatic_layer_filter 1
+#define XR_META_automatic_layer_filter_SPEC_VERSION 1
+#define XR_META_AUTOMATIC_LAYER_FILTER_EXTENSION_NAME "XR_META_automatic_layer_filter"
+
+
#define XR_META_touch_controller_plus 1
#define XR_META_touch_controller_plus_SPEC_VERSION 1
#define XR_META_TOUCH_CONTROLLER_PLUS_EXTENSION_NAME "XR_META_touch_controller_plus"
+#define XR_FB_face_tracking2 1
+XR_DEFINE_HANDLE(XrFaceTracker2FB)
+#define XR_FB_face_tracking2_SPEC_VERSION 1
+#define XR_FB_FACE_TRACKING2_EXTENSION_NAME "XR_FB_face_tracking2"
+
+typedef enum XrFaceExpression2FB {
+ XR_FACE_EXPRESSION2_BROW_LOWERER_L_FB = 0,
+ XR_FACE_EXPRESSION2_BROW_LOWERER_R_FB = 1,
+ XR_FACE_EXPRESSION2_CHEEK_PUFF_L_FB = 2,
+ XR_FACE_EXPRESSION2_CHEEK_PUFF_R_FB = 3,
+ XR_FACE_EXPRESSION2_CHEEK_RAISER_L_FB = 4,
+ XR_FACE_EXPRESSION2_CHEEK_RAISER_R_FB = 5,
+ XR_FACE_EXPRESSION2_CHEEK_SUCK_L_FB = 6,
+ XR_FACE_EXPRESSION2_CHEEK_SUCK_R_FB = 7,
+ XR_FACE_EXPRESSION2_CHIN_RAISER_B_FB = 8,
+ XR_FACE_EXPRESSION2_CHIN_RAISER_T_FB = 9,
+ XR_FACE_EXPRESSION2_DIMPLER_L_FB = 10,
+ XR_FACE_EXPRESSION2_DIMPLER_R_FB = 11,
+ XR_FACE_EXPRESSION2_EYES_CLOSED_L_FB = 12,
+ XR_FACE_EXPRESSION2_EYES_CLOSED_R_FB = 13,
+ XR_FACE_EXPRESSION2_EYES_LOOK_DOWN_L_FB = 14,
+ XR_FACE_EXPRESSION2_EYES_LOOK_DOWN_R_FB = 15,
+ XR_FACE_EXPRESSION2_EYES_LOOK_LEFT_L_FB = 16,
+ XR_FACE_EXPRESSION2_EYES_LOOK_LEFT_R_FB = 17,
+ XR_FACE_EXPRESSION2_EYES_LOOK_RIGHT_L_FB = 18,
+ XR_FACE_EXPRESSION2_EYES_LOOK_RIGHT_R_FB = 19,
+ XR_FACE_EXPRESSION2_EYES_LOOK_UP_L_FB = 20,
+ XR_FACE_EXPRESSION2_EYES_LOOK_UP_R_FB = 21,
+ XR_FACE_EXPRESSION2_INNER_BROW_RAISER_L_FB = 22,
+ XR_FACE_EXPRESSION2_INNER_BROW_RAISER_R_FB = 23,
+ XR_FACE_EXPRESSION2_JAW_DROP_FB = 24,
+ XR_FACE_EXPRESSION2_JAW_SIDEWAYS_LEFT_FB = 25,
+ XR_FACE_EXPRESSION2_JAW_SIDEWAYS_RIGHT_FB = 26,
+ XR_FACE_EXPRESSION2_JAW_THRUST_FB = 27,
+ XR_FACE_EXPRESSION2_LID_TIGHTENER_L_FB = 28,
+ XR_FACE_EXPRESSION2_LID_TIGHTENER_R_FB = 29,
+ XR_FACE_EXPRESSION2_LIP_CORNER_DEPRESSOR_L_FB = 30,
+ XR_FACE_EXPRESSION2_LIP_CORNER_DEPRESSOR_R_FB = 31,
+ XR_FACE_EXPRESSION2_LIP_CORNER_PULLER_L_FB = 32,
+ XR_FACE_EXPRESSION2_LIP_CORNER_PULLER_R_FB = 33,
+ XR_FACE_EXPRESSION2_LIP_FUNNELER_LB_FB = 34,
+ XR_FACE_EXPRESSION2_LIP_FUNNELER_LT_FB = 35,
+ XR_FACE_EXPRESSION2_LIP_FUNNELER_RB_FB = 36,
+ XR_FACE_EXPRESSION2_LIP_FUNNELER_RT_FB = 37,
+ XR_FACE_EXPRESSION2_LIP_PRESSOR_L_FB = 38,
+ XR_FACE_EXPRESSION2_LIP_PRESSOR_R_FB = 39,
+ XR_FACE_EXPRESSION2_LIP_PUCKER_L_FB = 40,
+ XR_FACE_EXPRESSION2_LIP_PUCKER_R_FB = 41,
+ XR_FACE_EXPRESSION2_LIP_STRETCHER_L_FB = 42,
+ XR_FACE_EXPRESSION2_LIP_STRETCHER_R_FB = 43,
+ XR_FACE_EXPRESSION2_LIP_SUCK_LB_FB = 44,
+ XR_FACE_EXPRESSION2_LIP_SUCK_LT_FB = 45,
+ XR_FACE_EXPRESSION2_LIP_SUCK_RB_FB = 46,
+ XR_FACE_EXPRESSION2_LIP_SUCK_RT_FB = 47,
+ XR_FACE_EXPRESSION2_LIP_TIGHTENER_L_FB = 48,
+ XR_FACE_EXPRESSION2_LIP_TIGHTENER_R_FB = 49,
+ XR_FACE_EXPRESSION2_LIPS_TOWARD_FB = 50,
+ XR_FACE_EXPRESSION2_LOWER_LIP_DEPRESSOR_L_FB = 51,
+ XR_FACE_EXPRESSION2_LOWER_LIP_DEPRESSOR_R_FB = 52,
+ XR_FACE_EXPRESSION2_MOUTH_LEFT_FB = 53,
+ XR_FACE_EXPRESSION2_MOUTH_RIGHT_FB = 54,
+ XR_FACE_EXPRESSION2_NOSE_WRINKLER_L_FB = 55,
+ XR_FACE_EXPRESSION2_NOSE_WRINKLER_R_FB = 56,
+ XR_FACE_EXPRESSION2_OUTER_BROW_RAISER_L_FB = 57,
+ XR_FACE_EXPRESSION2_OUTER_BROW_RAISER_R_FB = 58,
+ XR_FACE_EXPRESSION2_UPPER_LID_RAISER_L_FB = 59,
+ XR_FACE_EXPRESSION2_UPPER_LID_RAISER_R_FB = 60,
+ XR_FACE_EXPRESSION2_UPPER_LIP_RAISER_L_FB = 61,
+ XR_FACE_EXPRESSION2_UPPER_LIP_RAISER_R_FB = 62,
+ XR_FACE_EXPRESSION2_TONGUE_TIP_INTERDENTAL_FB = 63,
+ XR_FACE_EXPRESSION2_TONGUE_TIP_ALVEOLAR_FB = 64,
+ XR_FACE_EXPRESSION2_TONGUE_FRONT_DORSAL_PALATE_FB = 65,
+ XR_FACE_EXPRESSION2_TONGUE_MID_DORSAL_PALATE_FB = 66,
+ XR_FACE_EXPRESSION2_TONGUE_BACK_DORSAL_VELAR_FB = 67,
+ XR_FACE_EXPRESSION2_TONGUE_OUT_FB = 68,
+ XR_FACE_EXPRESSION2_TONGUE_RETREAT_FB = 69,
+ XR_FACE_EXPRESSION2_COUNT_FB = 70,
+ XR_FACE_EXPRESSION_2FB_MAX_ENUM_FB = 0x7FFFFFFF
+} XrFaceExpression2FB;
+
+typedef enum XrFaceExpressionSet2FB {
+ XR_FACE_EXPRESSION_SET2_DEFAULT_FB = 0,
+ XR_FACE_EXPRESSION_SET_2FB_MAX_ENUM_FB = 0x7FFFFFFF
+} XrFaceExpressionSet2FB;
+
+typedef enum XrFaceTrackingDataSource2FB {
+ XR_FACE_TRACKING_DATA_SOURCE2_VISUAL_FB = 0,
+ XR_FACE_TRACKING_DATA_SOURCE2_AUDIO_FB = 1,
+ XR_FACE_TRACKING_DATA_SOURCE_2FB_MAX_ENUM_FB = 0x7FFFFFFF
+} XrFaceTrackingDataSource2FB;
+
+typedef enum XrFaceConfidence2FB {
+ XR_FACE_CONFIDENCE2_LOWER_FACE_FB = 0,
+ XR_FACE_CONFIDENCE2_UPPER_FACE_FB = 1,
+ XR_FACE_CONFIDENCE2_COUNT_FB = 2,
+ XR_FACE_CONFIDENCE_2FB_MAX_ENUM_FB = 0x7FFFFFFF
+} XrFaceConfidence2FB;
+// XrSystemFaceTrackingProperties2FB extends XrSystemProperties
+typedef struct XrSystemFaceTrackingProperties2FB {
+ XrStructureType type;
+ void* XR_MAY_ALIAS next;
+ XrBool32 supportsVisualFaceTracking;
+ XrBool32 supportsAudioFaceTracking;
+} XrSystemFaceTrackingProperties2FB;
+
+typedef struct XrFaceTrackerCreateInfo2FB {
+ XrStructureType type;
+ const void* XR_MAY_ALIAS next;
+ XrFaceExpressionSet2FB faceExpressionSet;
+ uint32_t requestedDataSourceCount;
+ XrFaceTrackingDataSource2FB* requestedDataSources;
+} XrFaceTrackerCreateInfo2FB;
+
+typedef struct XrFaceExpressionInfo2FB {
+ XrStructureType type;
+ const void* XR_MAY_ALIAS next;
+ XrTime time;
+} XrFaceExpressionInfo2FB;
+
+typedef struct XrFaceExpressionWeights2FB {
+ XrStructureType type;
+ void* XR_MAY_ALIAS next;
+ uint32_t weightCount;
+ float* weights;
+ uint32_t confidenceCount;
+ float* confidences;
+ XrBool32 isValid;
+ XrBool32 isEyeFollowingBlendshapesValid;
+ XrFaceTrackingDataSource2FB dataSource;
+ XrTime time;
+} XrFaceExpressionWeights2FB;
+
+typedef XrResult (XRAPI_PTR *PFN_xrCreateFaceTracker2FB)(XrSession session, const XrFaceTrackerCreateInfo2FB* createInfo, XrFaceTracker2FB* faceTracker);
+typedef XrResult (XRAPI_PTR *PFN_xrDestroyFaceTracker2FB)(XrFaceTracker2FB faceTracker);
+typedef XrResult (XRAPI_PTR *PFN_xrGetFaceExpressionWeights2FB)(XrFaceTracker2FB faceTracker, const XrFaceExpressionInfo2FB* expressionInfo, XrFaceExpressionWeights2FB* expressionWeights);
+
+#ifndef XR_NO_PROTOTYPES
+#ifdef XR_EXTENSION_PROTOTYPES
+XRAPI_ATTR XrResult XRAPI_CALL xrCreateFaceTracker2FB(
+ XrSession session,
+ const XrFaceTrackerCreateInfo2FB* createInfo,
+ XrFaceTracker2FB* faceTracker);
+
+XRAPI_ATTR XrResult XRAPI_CALL xrDestroyFaceTracker2FB(
+ XrFaceTracker2FB faceTracker);
+
+XRAPI_ATTR XrResult XRAPI_CALL xrGetFaceExpressionWeights2FB(
+ XrFaceTracker2FB faceTracker,
+ const XrFaceExpressionInfo2FB* expressionInfo,
+ XrFaceExpressionWeights2FB* expressionWeights);
+#endif /* XR_EXTENSION_PROTOTYPES */
+#endif /* !XR_NO_PROTOTYPES */
+
+
#define XR_EXT_uuid 1
#define XR_EXT_uuid_SPEC_VERSION 1
#define XR_EXT_UUID_EXTENSION_NAME "XR_EXT_uuid"
@@ -6667,6 +6905,25 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetPlanePolygonBufferEXT(
#define XR_OPPO_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_OPPO_controller_interaction"
+#define XR_EXT_user_presence 1
+#define XR_EXT_user_presence_SPEC_VERSION 1
+#define XR_EXT_USER_PRESENCE_EXTENSION_NAME "XR_EXT_user_presence"
+typedef struct XrEventDataUserPresenceChangedEXT {
+ XrStructureType type;
+ const void* XR_MAY_ALIAS next;
+ XrSession session;
+ XrBool32 isUserPresent;
+} XrEventDataUserPresenceChangedEXT;
+
+// XrSystemUserPresencePropertiesEXT extends XrSystemProperties
+typedef struct XrSystemUserPresencePropertiesEXT {
+ XrStructureType type;
+ void* XR_MAY_ALIAS next;
+ XrBool32 supportsUserPresence;
+} XrSystemUserPresencePropertiesEXT;
+
+
+
#define XR_ML_user_calibration 1
#define XR_ML_user_calibration_SPEC_VERSION 1
#define XR_ML_USER_CALIBRATION_EXTENSION_NAME "XR_ML_user_calibration"
diff --git a/thirdparty/openxr/include/openxr/openxr_reflection.h b/thirdparty/openxr/include/openxr/openxr_reflection.h
index f6d66363bf..b449c7099b 100644
--- a/thirdparty/openxr/include/openxr/openxr_reflection.h
+++ b/thirdparty/openxr/include/openxr/openxr_reflection.h
@@ -444,11 +444,19 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB, 1000238001) \
_(XR_TYPE_SPACE_USER_CREATE_INFO_FB, 1000241001) \
_(XR_TYPE_SYSTEM_HEADSET_ID_PROPERTIES_META, 1000245000) \
+ _(XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_META, 1000254000) \
+ _(XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_GET_INFO_META, 1000254001) \
_(XR_TYPE_SYSTEM_PASSTHROUGH_COLOR_LUT_PROPERTIES_META, 1000266000) \
_(XR_TYPE_PASSTHROUGH_COLOR_LUT_CREATE_INFO_META, 1000266001) \
_(XR_TYPE_PASSTHROUGH_COLOR_LUT_UPDATE_INFO_META, 1000266002) \
_(XR_TYPE_PASSTHROUGH_COLOR_MAP_LUT_META, 1000266100) \
_(XR_TYPE_PASSTHROUGH_COLOR_MAP_INTERPOLATED_LUT_META, 1000266101) \
+ _(XR_TYPE_SPACE_TRIANGLE_MESH_GET_INFO_META, 1000269001) \
+ _(XR_TYPE_SPACE_TRIANGLE_MESH_META, 1000269002) \
+ _(XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES2_FB, 1000287013) \
+ _(XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB, 1000287014) \
+ _(XR_TYPE_FACE_EXPRESSION_INFO2_FB, 1000287015) \
+ _(XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB, 1000287016) \
_(XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC, 1000317001) \
_(XR_TYPE_PASSTHROUGH_COLOR_HTC, 1000317002) \
_(XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC, 1000317003) \
@@ -470,6 +478,8 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_PLANE_DETECTOR_LOCATION_EXT, 1000429005) \
_(XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT, 1000429006) \
_(XR_TYPE_SYSTEM_PLANE_DETECTION_PROPERTIES_EXT, 1000429007) \
+ _(XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT, 1000470000) \
+ _(XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT, 1000470001) \
_(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrFormFactor(_) \
@@ -555,6 +565,7 @@ XR_ENUM_STR(XrResult);
_(XR_OBJECT_TYPE_VIRTUAL_KEYBOARD_META, 1000219000) \
_(XR_OBJECT_TYPE_SPACE_USER_FB, 1000241000) \
_(XR_OBJECT_TYPE_PASSTHROUGH_COLOR_LUT_META, 1000266000) \
+ _(XR_OBJECT_TYPE_FACE_TRACKER2_FB, 1000287012) \
_(XR_OBJECT_TYPE_PASSTHROUGH_HTC, 1000317000) \
_(XR_OBJECT_TYPE_PLANE_DETECTOR_EXT, 1000429000) \
_(XR_OBJECT_TYPE_MAX_ENUM, 0x7FFFFFFF)
@@ -891,6 +902,7 @@ XR_ENUM_STR(XrResult);
_(XR_SPACE_COMPONENT_TYPE_SEMANTIC_LABELS_FB, 5) \
_(XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB, 6) \
_(XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB, 7) \
+ _(XR_SPACE_COMPONENT_TYPE_TRIANGLE_MESH_META, 1000269000) \
_(XR_SPACE_COMPONENT_TYPE_MAX_ENUM_FB, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrFoveationLevelFB(_) \
@@ -1209,6 +1221,95 @@ XR_ENUM_STR(XrResult);
_(XR_PASSTHROUGH_COLOR_LUT_CHANNELS_RGBA_META, 2) \
_(XR_PASSTHROUGH_COLOR_LUT_CHANNELS_MAX_ENUM_META, 0x7FFFFFFF)
+#define XR_LIST_ENUM_XrFaceExpression2FB(_) \
+ _(XR_FACE_EXPRESSION2_BROW_LOWERER_L_FB, 0) \
+ _(XR_FACE_EXPRESSION2_BROW_LOWERER_R_FB, 1) \
+ _(XR_FACE_EXPRESSION2_CHEEK_PUFF_L_FB, 2) \
+ _(XR_FACE_EXPRESSION2_CHEEK_PUFF_R_FB, 3) \
+ _(XR_FACE_EXPRESSION2_CHEEK_RAISER_L_FB, 4) \
+ _(XR_FACE_EXPRESSION2_CHEEK_RAISER_R_FB, 5) \
+ _(XR_FACE_EXPRESSION2_CHEEK_SUCK_L_FB, 6) \
+ _(XR_FACE_EXPRESSION2_CHEEK_SUCK_R_FB, 7) \
+ _(XR_FACE_EXPRESSION2_CHIN_RAISER_B_FB, 8) \
+ _(XR_FACE_EXPRESSION2_CHIN_RAISER_T_FB, 9) \
+ _(XR_FACE_EXPRESSION2_DIMPLER_L_FB, 10) \
+ _(XR_FACE_EXPRESSION2_DIMPLER_R_FB, 11) \
+ _(XR_FACE_EXPRESSION2_EYES_CLOSED_L_FB, 12) \
+ _(XR_FACE_EXPRESSION2_EYES_CLOSED_R_FB, 13) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_DOWN_L_FB, 14) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_DOWN_R_FB, 15) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_LEFT_L_FB, 16) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_LEFT_R_FB, 17) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_RIGHT_L_FB, 18) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_RIGHT_R_FB, 19) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_UP_L_FB, 20) \
+ _(XR_FACE_EXPRESSION2_EYES_LOOK_UP_R_FB, 21) \
+ _(XR_FACE_EXPRESSION2_INNER_BROW_RAISER_L_FB, 22) \
+ _(XR_FACE_EXPRESSION2_INNER_BROW_RAISER_R_FB, 23) \
+ _(XR_FACE_EXPRESSION2_JAW_DROP_FB, 24) \
+ _(XR_FACE_EXPRESSION2_JAW_SIDEWAYS_LEFT_FB, 25) \
+ _(XR_FACE_EXPRESSION2_JAW_SIDEWAYS_RIGHT_FB, 26) \
+ _(XR_FACE_EXPRESSION2_JAW_THRUST_FB, 27) \
+ _(XR_FACE_EXPRESSION2_LID_TIGHTENER_L_FB, 28) \
+ _(XR_FACE_EXPRESSION2_LID_TIGHTENER_R_FB, 29) \
+ _(XR_FACE_EXPRESSION2_LIP_CORNER_DEPRESSOR_L_FB, 30) \
+ _(XR_FACE_EXPRESSION2_LIP_CORNER_DEPRESSOR_R_FB, 31) \
+ _(XR_FACE_EXPRESSION2_LIP_CORNER_PULLER_L_FB, 32) \
+ _(XR_FACE_EXPRESSION2_LIP_CORNER_PULLER_R_FB, 33) \
+ _(XR_FACE_EXPRESSION2_LIP_FUNNELER_LB_FB, 34) \
+ _(XR_FACE_EXPRESSION2_LIP_FUNNELER_LT_FB, 35) \
+ _(XR_FACE_EXPRESSION2_LIP_FUNNELER_RB_FB, 36) \
+ _(XR_FACE_EXPRESSION2_LIP_FUNNELER_RT_FB, 37) \
+ _(XR_FACE_EXPRESSION2_LIP_PRESSOR_L_FB, 38) \
+ _(XR_FACE_EXPRESSION2_LIP_PRESSOR_R_FB, 39) \
+ _(XR_FACE_EXPRESSION2_LIP_PUCKER_L_FB, 40) \
+ _(XR_FACE_EXPRESSION2_LIP_PUCKER_R_FB, 41) \
+ _(XR_FACE_EXPRESSION2_LIP_STRETCHER_L_FB, 42) \
+ _(XR_FACE_EXPRESSION2_LIP_STRETCHER_R_FB, 43) \
+ _(XR_FACE_EXPRESSION2_LIP_SUCK_LB_FB, 44) \
+ _(XR_FACE_EXPRESSION2_LIP_SUCK_LT_FB, 45) \
+ _(XR_FACE_EXPRESSION2_LIP_SUCK_RB_FB, 46) \
+ _(XR_FACE_EXPRESSION2_LIP_SUCK_RT_FB, 47) \
+ _(XR_FACE_EXPRESSION2_LIP_TIGHTENER_L_FB, 48) \
+ _(XR_FACE_EXPRESSION2_LIP_TIGHTENER_R_FB, 49) \
+ _(XR_FACE_EXPRESSION2_LIPS_TOWARD_FB, 50) \
+ _(XR_FACE_EXPRESSION2_LOWER_LIP_DEPRESSOR_L_FB, 51) \
+ _(XR_FACE_EXPRESSION2_LOWER_LIP_DEPRESSOR_R_FB, 52) \
+ _(XR_FACE_EXPRESSION2_MOUTH_LEFT_FB, 53) \
+ _(XR_FACE_EXPRESSION2_MOUTH_RIGHT_FB, 54) \
+ _(XR_FACE_EXPRESSION2_NOSE_WRINKLER_L_FB, 55) \
+ _(XR_FACE_EXPRESSION2_NOSE_WRINKLER_R_FB, 56) \
+ _(XR_FACE_EXPRESSION2_OUTER_BROW_RAISER_L_FB, 57) \
+ _(XR_FACE_EXPRESSION2_OUTER_BROW_RAISER_R_FB, 58) \
+ _(XR_FACE_EXPRESSION2_UPPER_LID_RAISER_L_FB, 59) \
+ _(XR_FACE_EXPRESSION2_UPPER_LID_RAISER_R_FB, 60) \
+ _(XR_FACE_EXPRESSION2_UPPER_LIP_RAISER_L_FB, 61) \
+ _(XR_FACE_EXPRESSION2_UPPER_LIP_RAISER_R_FB, 62) \
+ _(XR_FACE_EXPRESSION2_TONGUE_TIP_INTERDENTAL_FB, 63) \
+ _(XR_FACE_EXPRESSION2_TONGUE_TIP_ALVEOLAR_FB, 64) \
+ _(XR_FACE_EXPRESSION2_TONGUE_FRONT_DORSAL_PALATE_FB, 65) \
+ _(XR_FACE_EXPRESSION2_TONGUE_MID_DORSAL_PALATE_FB, 66) \
+ _(XR_FACE_EXPRESSION2_TONGUE_BACK_DORSAL_VELAR_FB, 67) \
+ _(XR_FACE_EXPRESSION2_TONGUE_OUT_FB, 68) \
+ _(XR_FACE_EXPRESSION2_TONGUE_RETREAT_FB, 69) \
+ _(XR_FACE_EXPRESSION2_COUNT_FB, 70) \
+ _(XR_FACE_EXPRESSION_2FB_MAX_ENUM_FB, 0x7FFFFFFF)
+
+#define XR_LIST_ENUM_XrFaceExpressionSet2FB(_) \
+ _(XR_FACE_EXPRESSION_SET2_DEFAULT_FB, 0) \
+ _(XR_FACE_EXPRESSION_SET_2FB_MAX_ENUM_FB, 0x7FFFFFFF)
+
+#define XR_LIST_ENUM_XrFaceTrackingDataSource2FB(_) \
+ _(XR_FACE_TRACKING_DATA_SOURCE2_VISUAL_FB, 0) \
+ _(XR_FACE_TRACKING_DATA_SOURCE2_AUDIO_FB, 1) \
+ _(XR_FACE_TRACKING_DATA_SOURCE_2FB_MAX_ENUM_FB, 0x7FFFFFFF)
+
+#define XR_LIST_ENUM_XrFaceConfidence2FB(_) \
+ _(XR_FACE_CONFIDENCE2_LOWER_FACE_FB, 0) \
+ _(XR_FACE_CONFIDENCE2_UPPER_FACE_FB, 1) \
+ _(XR_FACE_CONFIDENCE2_COUNT_FB, 2) \
+ _(XR_FACE_CONFIDENCE_2FB_MAX_ENUM_FB, 0x7FFFFFFF)
+
#define XR_LIST_ENUM_XrTrackingOptimizationSettingsDomainQCOM(_) \
_(XR_TRACKING_OPTIMIZATION_SETTINGS_DOMAIN_ALL_QCOM, 1) \
_(XR_TRACKING_OPTIMIZATION_SETTINGS_DOMAIN_MAX_ENUM_QCOM, 0x7FFFFFFF)
@@ -1437,6 +1538,7 @@ XR_ENUM_STR(XrResult);
#define XR_LIST_BITS_XrSemanticLabelsSupportFlagsFB(_) \
_(XR_SEMANTIC_LABELS_SUPPORT_MULTIPLE_SEMANTIC_LABELS_BIT_FB, 0x00000001) \
_(XR_SEMANTIC_LABELS_SUPPORT_ACCEPT_DESK_TO_TABLE_MIGRATION_BIT_FB, 0x00000002) \
+ _(XR_SEMANTIC_LABELS_SUPPORT_ACCEPT_INVISIBLE_WALL_FACE_BIT_FB, 0x00000004) \
#define XR_LIST_BITS_XrDigitalLensControlFlagsALMALENCE(_) \
_(XR_DIGITAL_LENS_CONTROL_PROCESSING_DISABLE_BIT_ALMALENCE, 0x00000001) \
@@ -1451,6 +1553,7 @@ XR_ENUM_STR(XrResult);
_(XR_COMPOSITION_LAYER_SETTINGS_QUALITY_SUPER_SAMPLING_BIT_FB, 0x00000002) \
_(XR_COMPOSITION_LAYER_SETTINGS_NORMAL_SHARPENING_BIT_FB, 0x00000004) \
_(XR_COMPOSITION_LAYER_SETTINGS_QUALITY_SHARPENING_BIT_FB, 0x00000008) \
+ _(XR_COMPOSITION_LAYER_SETTINGS_AUTO_LAYER_FILTER_BIT_META, 0x00000020) \
#define XR_LIST_BITS_XrPassthroughPreferenceFlagsMETA(_) \
_(XR_PASSTHROUGH_PREFERENCE_DEFAULT_TO_ACTIVE_BIT_META, 0x00000001) \
@@ -4141,6 +4244,20 @@ XR_ENUM_STR(XrResult);
_(next) \
_(id) \
+/// Calls your macro with the name of each member of XrRecommendedLayerResolutionMETA, in order.
+#define XR_LIST_STRUCT_XrRecommendedLayerResolutionMETA(_) \
+ _(type) \
+ _(next) \
+ _(recommendedImageDimensions) \
+ _(isValid) \
+
+/// Calls your macro with the name of each member of XrRecommendedLayerResolutionGetInfoMETA, in order.
+#define XR_LIST_STRUCT_XrRecommendedLayerResolutionGetInfoMETA(_) \
+ _(type) \
+ _(next) \
+ _(layer) \
+ _(predictedDisplayTime) \
+
/// Calls your macro with the name of each member of XrPassthroughColorLutDataMETA, in order.
#define XR_LIST_STRUCT_XrPassthroughColorLutDataMETA(_) \
_(bufferSize) \
@@ -4181,6 +4298,56 @@ XR_ENUM_STR(XrResult);
_(next) \
_(maxColorLutResolution) \
+/// Calls your macro with the name of each member of XrSpaceTriangleMeshGetInfoMETA, in order.
+#define XR_LIST_STRUCT_XrSpaceTriangleMeshGetInfoMETA(_) \
+ _(type) \
+ _(next) \
+
+/// Calls your macro with the name of each member of XrSpaceTriangleMeshMETA, in order.
+#define XR_LIST_STRUCT_XrSpaceTriangleMeshMETA(_) \
+ _(type) \
+ _(next) \
+ _(vertexCapacityInput) \
+ _(vertexCountOutput) \
+ _(vertices) \
+ _(indexCapacityInput) \
+ _(indexCountOutput) \
+ _(indices) \
+
+/// Calls your macro with the name of each member of XrSystemFaceTrackingProperties2FB, in order.
+#define XR_LIST_STRUCT_XrSystemFaceTrackingProperties2FB(_) \
+ _(type) \
+ _(next) \
+ _(supportsVisualFaceTracking) \
+ _(supportsAudioFaceTracking) \
+
+/// Calls your macro with the name of each member of XrFaceTrackerCreateInfo2FB, in order.
+#define XR_LIST_STRUCT_XrFaceTrackerCreateInfo2FB(_) \
+ _(type) \
+ _(next) \
+ _(faceExpressionSet) \
+ _(requestedDataSourceCount) \
+ _(requestedDataSources) \
+
+/// Calls your macro with the name of each member of XrFaceExpressionInfo2FB, in order.
+#define XR_LIST_STRUCT_XrFaceExpressionInfo2FB(_) \
+ _(type) \
+ _(next) \
+ _(time) \
+
+/// Calls your macro with the name of each member of XrFaceExpressionWeights2FB, in order.
+#define XR_LIST_STRUCT_XrFaceExpressionWeights2FB(_) \
+ _(type) \
+ _(next) \
+ _(weightCount) \
+ _(weights) \
+ _(confidenceCount) \
+ _(confidences) \
+ _(isValid) \
+ _(isEyeFollowingBlendshapesValid) \
+ _(dataSource) \
+ _(time) \
+
/// Calls your macro with the name of each member of XrPassthroughCreateInfoHTC, in order.
#define XR_LIST_STRUCT_XrPassthroughCreateInfoHTC(_) \
_(type) \
@@ -4372,6 +4539,19 @@ XR_ENUM_STR(XrResult);
_(vertexCountOutput) \
_(vertices) \
+/// Calls your macro with the name of each member of XrEventDataUserPresenceChangedEXT, in order.
+#define XR_LIST_STRUCT_XrEventDataUserPresenceChangedEXT(_) \
+ _(type) \
+ _(next) \
+ _(session) \
+ _(isUserPresent) \
+
+/// Calls your macro with the name of each member of XrSystemUserPresencePropertiesEXT, in order.
+#define XR_LIST_STRUCT_XrSystemUserPresencePropertiesEXT(_) \
+ _(type) \
+ _(next) \
+ _(supportsUserPresence) \
+
/// Calls your macro with the name of each member of XrEventDataHeadsetFitChangedML, in order.
#define XR_LIST_STRUCT_XrEventDataHeadsetFitChangedML(_) \
_(type) \
@@ -4680,11 +4860,19 @@ XR_ENUM_STR(XrResult);
_(XrEventDataSpaceListSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB) \
_(XrSpaceUserCreateInfoFB, XR_TYPE_SPACE_USER_CREATE_INFO_FB) \
_(XrSystemHeadsetIdPropertiesMETA, XR_TYPE_SYSTEM_HEADSET_ID_PROPERTIES_META) \
+ _(XrRecommendedLayerResolutionMETA, XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_META) \
+ _(XrRecommendedLayerResolutionGetInfoMETA, XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_GET_INFO_META) \
_(XrPassthroughColorLutCreateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_CREATE_INFO_META) \
_(XrPassthroughColorLutUpdateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_UPDATE_INFO_META) \
_(XrPassthroughColorMapLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_LUT_META) \
_(XrPassthroughColorMapInterpolatedLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_INTERPOLATED_LUT_META) \
_(XrSystemPassthroughColorLutPropertiesMETA, XR_TYPE_SYSTEM_PASSTHROUGH_COLOR_LUT_PROPERTIES_META) \
+ _(XrSpaceTriangleMeshGetInfoMETA, XR_TYPE_SPACE_TRIANGLE_MESH_GET_INFO_META) \
+ _(XrSpaceTriangleMeshMETA, XR_TYPE_SPACE_TRIANGLE_MESH_META) \
+ _(XrSystemFaceTrackingProperties2FB, XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES2_FB) \
+ _(XrFaceTrackerCreateInfo2FB, XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB) \
+ _(XrFaceExpressionInfo2FB, XR_TYPE_FACE_EXPRESSION_INFO2_FB) \
+ _(XrFaceExpressionWeights2FB, XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB) \
_(XrPassthroughCreateInfoHTC, XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC) \
_(XrPassthroughColorHTC, XR_TYPE_PASSTHROUGH_COLOR_HTC) \
_(XrPassthroughMeshTransformInfoHTC, XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC) \
@@ -4706,6 +4894,8 @@ XR_ENUM_STR(XrResult);
_(XrPlaneDetectorLocationEXT, XR_TYPE_PLANE_DETECTOR_LOCATION_EXT) \
_(XrPlaneDetectorLocationsEXT, XR_TYPE_PLANE_DETECTOR_LOCATIONS_EXT) \
_(XrPlaneDetectorPolygonBufferEXT, XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT) \
+ _(XrEventDataUserPresenceChangedEXT, XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT) \
+ _(XrSystemUserPresencePropertiesEXT, XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT) \
_(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \
_(XrEventDataEyeCalibrationChangedML, XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML) \
_(XrUserCalibrationEnableEventsInfoML, XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML) \
@@ -4960,6 +5150,7 @@ XR_ENUM_STR(XrResult);
_(XR_VARJO_environment_depth_estimation, 124) \
_(XR_VARJO_marker_tracking, 125) \
_(XR_VARJO_view_offset, 126) \
+ _(XR_VARJO_xr4_controller_interaction, 130) \
_(XR_ML_ml2_controller_interaction, 135) \
_(XR_ML_frame_end_info, 136) \
_(XR_ML_global_dimmer, 137) \
@@ -5003,8 +5194,12 @@ XR_ENUM_STR(XrResult);
_(XR_FB_spatial_entity_storage_batch, 239) \
_(XR_FB_spatial_entity_user, 242) \
_(XR_META_headset_id, 246) \
+ _(XR_META_recommended_layer_resolution, 255) \
_(XR_META_passthrough_color_lut, 267) \
+ _(XR_META_spatial_entity_mesh, 270) \
+ _(XR_META_automatic_layer_filter, 272) \
_(XR_META_touch_controller_plus, 280) \
+ _(XR_FB_face_tracking2, 288) \
_(XR_EXT_uuid, 300) \
_(XR_EXT_hand_interaction, 303) \
_(XR_QCOM_tracking_optimization_settings, 307) \
@@ -5018,9 +5213,830 @@ XR_ENUM_STR(XrResult);
_(XR_EXT_hand_tracking_data_source, 429) \
_(XR_EXT_plane_detection, 430) \
_(XR_OPPO_controller_interaction, 454) \
+ _(XR_EXT_user_presence, 471) \
_(XR_ML_user_calibration, 473) \
_(XR_YVR_controller_interaction, 498) \
+
+/// For every function defined by XR_VERSION_1_0 in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_VERSION_1_0(_) \
+ _(GetInstanceProcAddr, VERSION_1_0) \
+ _(EnumerateApiLayerProperties, VERSION_1_0) \
+ _(EnumerateInstanceExtensionProperties, VERSION_1_0) \
+ _(CreateInstance, VERSION_1_0) \
+ _(DestroyInstance, VERSION_1_0) \
+ _(GetInstanceProperties, VERSION_1_0) \
+ _(PollEvent, VERSION_1_0) \
+ _(ResultToString, VERSION_1_0) \
+ _(StructureTypeToString, VERSION_1_0) \
+ _(GetSystem, VERSION_1_0) \
+ _(GetSystemProperties, VERSION_1_0) \
+ _(EnumerateEnvironmentBlendModes, VERSION_1_0) \
+ _(CreateSession, VERSION_1_0) \
+ _(DestroySession, VERSION_1_0) \
+ _(EnumerateReferenceSpaces, VERSION_1_0) \
+ _(CreateReferenceSpace, VERSION_1_0) \
+ _(GetReferenceSpaceBoundsRect, VERSION_1_0) \
+ _(CreateActionSpace, VERSION_1_0) \
+ _(LocateSpace, VERSION_1_0) \
+ _(DestroySpace, VERSION_1_0) \
+ _(EnumerateViewConfigurations, VERSION_1_0) \
+ _(GetViewConfigurationProperties, VERSION_1_0) \
+ _(EnumerateViewConfigurationViews, VERSION_1_0) \
+ _(EnumerateSwapchainFormats, VERSION_1_0) \
+ _(CreateSwapchain, VERSION_1_0) \
+ _(DestroySwapchain, VERSION_1_0) \
+ _(EnumerateSwapchainImages, VERSION_1_0) \
+ _(AcquireSwapchainImage, VERSION_1_0) \
+ _(WaitSwapchainImage, VERSION_1_0) \
+ _(ReleaseSwapchainImage, VERSION_1_0) \
+ _(BeginSession, VERSION_1_0) \
+ _(EndSession, VERSION_1_0) \
+ _(RequestExitSession, VERSION_1_0) \
+ _(WaitFrame, VERSION_1_0) \
+ _(BeginFrame, VERSION_1_0) \
+ _(EndFrame, VERSION_1_0) \
+ _(LocateViews, VERSION_1_0) \
+ _(StringToPath, VERSION_1_0) \
+ _(PathToString, VERSION_1_0) \
+ _(CreateActionSet, VERSION_1_0) \
+ _(DestroyActionSet, VERSION_1_0) \
+ _(CreateAction, VERSION_1_0) \
+ _(DestroyAction, VERSION_1_0) \
+ _(SuggestInteractionProfileBindings, VERSION_1_0) \
+ _(AttachSessionActionSets, VERSION_1_0) \
+ _(GetCurrentInteractionProfile, VERSION_1_0) \
+ _(GetActionStateBoolean, VERSION_1_0) \
+ _(GetActionStateFloat, VERSION_1_0) \
+ _(GetActionStateVector2f, VERSION_1_0) \
+ _(GetActionStatePose, VERSION_1_0) \
+ _(SyncActions, VERSION_1_0) \
+ _(EnumerateBoundSourcesForAction, VERSION_1_0) \
+ _(GetInputSourceLocalizedName, VERSION_1_0) \
+ _(ApplyHapticFeedback, VERSION_1_0) \
+ _(StopHapticFeedback, VERSION_1_0) \
+
+
+/// For every function defined by XR_LOADER_VERSION_1_0 in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_LOADER_VERSION_1_0(_) \
+ _(CreateApiLayerInstance, LOADER_VERSION_1_0) \
+ _(NegotiateLoaderRuntimeInterface, LOADER_VERSION_1_0) \
+ _(NegotiateLoaderApiLayerInterface, LOADER_VERSION_1_0) \
+
+
+/// For every function defined by XR_KHR_android_thread_settings in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_android_thread_settings(_) \
+ _(SetAndroidApplicationThreadKHR, KHR_android_thread_settings) \
+
+
+/// For every function defined by XR_KHR_android_surface_swapchain in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_android_surface_swapchain(_) \
+ _(CreateSwapchainAndroidSurfaceKHR, KHR_android_surface_swapchain) \
+
+
+/// For every function defined by XR_KHR_opengl_enable in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_opengl_enable(_) \
+ _(GetOpenGLGraphicsRequirementsKHR, KHR_opengl_enable) \
+
+
+/// For every function defined by XR_KHR_opengl_es_enable in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_opengl_es_enable(_) \
+ _(GetOpenGLESGraphicsRequirementsKHR, KHR_opengl_es_enable) \
+
+
+/// For every function defined by XR_KHR_vulkan_enable in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_vulkan_enable(_) \
+ _(GetVulkanInstanceExtensionsKHR, KHR_vulkan_enable) \
+ _(GetVulkanDeviceExtensionsKHR, KHR_vulkan_enable) \
+ _(GetVulkanGraphicsDeviceKHR, KHR_vulkan_enable) \
+ _(GetVulkanGraphicsRequirementsKHR, KHR_vulkan_enable) \
+
+
+/// For every function defined by XR_KHR_D3D11_enable in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_D3D11_enable(_) \
+ _(GetD3D11GraphicsRequirementsKHR, KHR_D3D11_enable) \
+
+
+/// For every function defined by XR_KHR_D3D12_enable in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_D3D12_enable(_) \
+ _(GetD3D12GraphicsRequirementsKHR, KHR_D3D12_enable) \
+
+
+/// For every function defined by XR_KHR_visibility_mask in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_visibility_mask(_) \
+ _(GetVisibilityMaskKHR, KHR_visibility_mask) \
+
+
+/// For every function defined by XR_KHR_win32_convert_performance_counter_time in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_win32_convert_performance_counter_time(_) \
+ _(ConvertWin32PerformanceCounterToTimeKHR, KHR_win32_convert_performance_counter_time) \
+ _(ConvertTimeToWin32PerformanceCounterKHR, KHR_win32_convert_performance_counter_time) \
+
+
+/// For every function defined by XR_KHR_convert_timespec_time in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_convert_timespec_time(_) \
+ _(ConvertTimespecTimeToTimeKHR, KHR_convert_timespec_time) \
+ _(ConvertTimeToTimespecTimeKHR, KHR_convert_timespec_time) \
+
+
+/// For every function defined by XR_KHR_loader_init in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_loader_init(_) \
+ _(InitializeLoaderKHR, KHR_loader_init) \
+
+
+/// For every function defined by XR_KHR_vulkan_enable2 in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_KHR_vulkan_enable2(_) \
+ _(CreateVulkanInstanceKHR, KHR_vulkan_enable2) \
+ _(CreateVulkanDeviceKHR, KHR_vulkan_enable2) \
+ _(GetVulkanGraphicsDevice2KHR, KHR_vulkan_enable2) \
+
+
+/// For every function defined by XR_EXT_performance_settings in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_performance_settings(_) \
+ _(PerfSettingsSetPerformanceLevelEXT, EXT_performance_settings) \
+
+
+/// For every function defined by XR_EXT_thermal_query in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_thermal_query(_) \
+ _(ThermalGetTemperatureTrendEXT, EXT_thermal_query) \
+
+
+/// For every function defined by XR_EXT_debug_utils in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_debug_utils(_) \
+ _(SetDebugUtilsObjectNameEXT, EXT_debug_utils) \
+ _(CreateDebugUtilsMessengerEXT, EXT_debug_utils) \
+ _(DestroyDebugUtilsMessengerEXT, EXT_debug_utils) \
+ _(SubmitDebugUtilsMessageEXT, EXT_debug_utils) \
+ _(SessionBeginDebugUtilsLabelRegionEXT, EXT_debug_utils) \
+ _(SessionEndDebugUtilsLabelRegionEXT, EXT_debug_utils) \
+ _(SessionInsertDebugUtilsLabelEXT, EXT_debug_utils) \
+
+
+/// For every function defined by XR_MSFT_spatial_anchor in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_spatial_anchor(_) \
+ _(CreateSpatialAnchorMSFT, MSFT_spatial_anchor) \
+ _(CreateSpatialAnchorSpaceMSFT, MSFT_spatial_anchor) \
+ _(DestroySpatialAnchorMSFT, MSFT_spatial_anchor) \
+
+
+/// For every function defined by XR_EXT_conformance_automation in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_conformance_automation(_) \
+ _(SetInputDeviceActiveEXT, EXT_conformance_automation) \
+ _(SetInputDeviceStateBoolEXT, EXT_conformance_automation) \
+ _(SetInputDeviceStateFloatEXT, EXT_conformance_automation) \
+ _(SetInputDeviceStateVector2fEXT, EXT_conformance_automation) \
+ _(SetInputDeviceLocationEXT, EXT_conformance_automation) \
+
+
+/// For every function defined by XR_MSFT_spatial_graph_bridge in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_spatial_graph_bridge(_) \
+ _(CreateSpatialGraphNodeSpaceMSFT, MSFT_spatial_graph_bridge) \
+ _(TryCreateSpatialGraphStaticNodeBindingMSFT, MSFT_spatial_graph_bridge) \
+ _(DestroySpatialGraphNodeBindingMSFT, MSFT_spatial_graph_bridge) \
+ _(GetSpatialGraphNodeBindingPropertiesMSFT, MSFT_spatial_graph_bridge) \
+
+
+/// For every function defined by XR_EXT_hand_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_hand_tracking(_) \
+ _(CreateHandTrackerEXT, EXT_hand_tracking) \
+ _(DestroyHandTrackerEXT, EXT_hand_tracking) \
+ _(LocateHandJointsEXT, EXT_hand_tracking) \
+
+
+/// For every function defined by XR_MSFT_hand_tracking_mesh in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_hand_tracking_mesh(_) \
+ _(CreateHandMeshSpaceMSFT, MSFT_hand_tracking_mesh) \
+ _(UpdateHandMeshMSFT, MSFT_hand_tracking_mesh) \
+
+
+/// For every function defined by XR_MSFT_controller_model in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_controller_model(_) \
+ _(GetControllerModelKeyMSFT, MSFT_controller_model) \
+ _(LoadControllerModelMSFT, MSFT_controller_model) \
+ _(GetControllerModelPropertiesMSFT, MSFT_controller_model) \
+ _(GetControllerModelStateMSFT, MSFT_controller_model) \
+
+
+/// For every function defined by XR_MSFT_perception_anchor_interop in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_perception_anchor_interop(_) \
+ _(CreateSpatialAnchorFromPerceptionAnchorMSFT, MSFT_perception_anchor_interop) \
+ _(TryGetPerceptionAnchorFromSpatialAnchorMSFT, MSFT_perception_anchor_interop) \
+
+
+/// For every function defined by XR_MSFT_composition_layer_reprojection in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_composition_layer_reprojection(_) \
+ _(EnumerateReprojectionModesMSFT, MSFT_composition_layer_reprojection) \
+
+
+/// For every function defined by XR_FB_swapchain_update_state in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_swapchain_update_state(_) \
+ _(UpdateSwapchainFB, FB_swapchain_update_state) \
+ _(GetSwapchainStateFB, FB_swapchain_update_state) \
+
+
+/// For every function defined by XR_FB_body_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_body_tracking(_) \
+ _(CreateBodyTrackerFB, FB_body_tracking) \
+ _(DestroyBodyTrackerFB, FB_body_tracking) \
+ _(LocateBodyJointsFB, FB_body_tracking) \
+ _(GetBodySkeletonFB, FB_body_tracking) \
+
+
+/// For every function defined by XR_MSFT_scene_understanding in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_scene_understanding(_) \
+ _(EnumerateSceneComputeFeaturesMSFT, MSFT_scene_understanding) \
+ _(CreateSceneObserverMSFT, MSFT_scene_understanding) \
+ _(DestroySceneObserverMSFT, MSFT_scene_understanding) \
+ _(CreateSceneMSFT, MSFT_scene_understanding) \
+ _(DestroySceneMSFT, MSFT_scene_understanding) \
+ _(ComputeNewSceneMSFT, MSFT_scene_understanding) \
+ _(GetSceneComputeStateMSFT, MSFT_scene_understanding) \
+ _(GetSceneComponentsMSFT, MSFT_scene_understanding) \
+ _(LocateSceneComponentsMSFT, MSFT_scene_understanding) \
+ _(GetSceneMeshBuffersMSFT, MSFT_scene_understanding) \
+
+
+/// For every function defined by XR_MSFT_scene_understanding_serialization in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_scene_understanding_serialization(_) \
+ _(DeserializeSceneMSFT, MSFT_scene_understanding_serialization) \
+ _(GetSerializedSceneFragmentDataMSFT, MSFT_scene_understanding_serialization) \
+
+
+/// For every function defined by XR_FB_display_refresh_rate in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_display_refresh_rate(_) \
+ _(EnumerateDisplayRefreshRatesFB, FB_display_refresh_rate) \
+ _(GetDisplayRefreshRateFB, FB_display_refresh_rate) \
+ _(RequestDisplayRefreshRateFB, FB_display_refresh_rate) \
+
+
+/// For every function defined by XR_HTCX_vive_tracker_interaction in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_HTCX_vive_tracker_interaction(_) \
+ _(EnumerateViveTrackerPathsHTCX, HTCX_vive_tracker_interaction) \
+
+
+/// For every function defined by XR_HTC_facial_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_HTC_facial_tracking(_) \
+ _(CreateFacialTrackerHTC, HTC_facial_tracking) \
+ _(DestroyFacialTrackerHTC, HTC_facial_tracking) \
+ _(GetFacialExpressionsHTC, HTC_facial_tracking) \
+
+
+/// For every function defined by XR_FB_color_space in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_color_space(_) \
+ _(EnumerateColorSpacesFB, FB_color_space) \
+ _(SetColorSpaceFB, FB_color_space) \
+
+
+/// For every function defined by XR_FB_hand_tracking_mesh in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_hand_tracking_mesh(_) \
+ _(GetHandMeshFB, FB_hand_tracking_mesh) \
+
+
+/// For every function defined by XR_FB_spatial_entity in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity(_) \
+ _(CreateSpatialAnchorFB, FB_spatial_entity) \
+ _(GetSpaceUuidFB, FB_spatial_entity) \
+ _(EnumerateSpaceSupportedComponentsFB, FB_spatial_entity) \
+ _(SetSpaceComponentStatusFB, FB_spatial_entity) \
+ _(GetSpaceComponentStatusFB, FB_spatial_entity) \
+
+
+/// For every function defined by XR_FB_foveation in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_foveation(_) \
+ _(CreateFoveationProfileFB, FB_foveation) \
+ _(DestroyFoveationProfileFB, FB_foveation) \
+
+
+/// For every function defined by XR_FB_keyboard_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_keyboard_tracking(_) \
+ _(QuerySystemTrackedKeyboardFB, FB_keyboard_tracking) \
+ _(CreateKeyboardSpaceFB, FB_keyboard_tracking) \
+
+
+/// For every function defined by XR_FB_triangle_mesh in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_triangle_mesh(_) \
+ _(CreateTriangleMeshFB, FB_triangle_mesh) \
+ _(DestroyTriangleMeshFB, FB_triangle_mesh) \
+ _(TriangleMeshGetVertexBufferFB, FB_triangle_mesh) \
+ _(TriangleMeshGetIndexBufferFB, FB_triangle_mesh) \
+ _(TriangleMeshBeginUpdateFB, FB_triangle_mesh) \
+ _(TriangleMeshEndUpdateFB, FB_triangle_mesh) \
+ _(TriangleMeshBeginVertexBufferUpdateFB, FB_triangle_mesh) \
+ _(TriangleMeshEndVertexBufferUpdateFB, FB_triangle_mesh) \
+
+
+/// For every function defined by XR_FB_passthrough in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_passthrough(_) \
+ _(CreatePassthroughFB, FB_passthrough) \
+ _(DestroyPassthroughFB, FB_passthrough) \
+ _(PassthroughStartFB, FB_passthrough) \
+ _(PassthroughPauseFB, FB_passthrough) \
+ _(CreatePassthroughLayerFB, FB_passthrough) \
+ _(DestroyPassthroughLayerFB, FB_passthrough) \
+ _(PassthroughLayerPauseFB, FB_passthrough) \
+ _(PassthroughLayerResumeFB, FB_passthrough) \
+ _(PassthroughLayerSetStyleFB, FB_passthrough) \
+ _(CreateGeometryInstanceFB, FB_passthrough) \
+ _(DestroyGeometryInstanceFB, FB_passthrough) \
+ _(GeometryInstanceSetTransformFB, FB_passthrough) \
+
+
+/// For every function defined by XR_FB_render_model in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_render_model(_) \
+ _(EnumerateRenderModelPathsFB, FB_render_model) \
+ _(GetRenderModelPropertiesFB, FB_render_model) \
+ _(LoadRenderModelFB, FB_render_model) \
+
+
+/// For every function defined by XR_VARJO_environment_depth_estimation in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_VARJO_environment_depth_estimation(_) \
+ _(SetEnvironmentDepthEstimationVARJO, VARJO_environment_depth_estimation) \
+
+
+/// For every function defined by XR_VARJO_marker_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_VARJO_marker_tracking(_) \
+ _(SetMarkerTrackingVARJO, VARJO_marker_tracking) \
+ _(SetMarkerTrackingTimeoutVARJO, VARJO_marker_tracking) \
+ _(SetMarkerTrackingPredictionVARJO, VARJO_marker_tracking) \
+ _(GetMarkerSizeVARJO, VARJO_marker_tracking) \
+ _(CreateMarkerSpaceVARJO, VARJO_marker_tracking) \
+
+
+/// For every function defined by XR_VARJO_view_offset in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_VARJO_view_offset(_) \
+ _(SetViewOffsetVARJO, VARJO_view_offset) \
+
+
+/// For every function defined by XR_ML_compat in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_ML_compat(_) \
+ _(CreateSpaceFromCoordinateFrameUIDML, ML_compat) \
+
+
+/// For every function defined by XR_ML_marker_understanding in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_ML_marker_understanding(_) \
+ _(CreateMarkerDetectorML, ML_marker_understanding) \
+ _(DestroyMarkerDetectorML, ML_marker_understanding) \
+ _(SnapshotMarkerDetectorML, ML_marker_understanding) \
+ _(GetMarkerDetectorStateML, ML_marker_understanding) \
+ _(GetMarkersML, ML_marker_understanding) \
+ _(GetMarkerReprojectionErrorML, ML_marker_understanding) \
+ _(GetMarkerLengthML, ML_marker_understanding) \
+ _(GetMarkerNumberML, ML_marker_understanding) \
+ _(GetMarkerStringML, ML_marker_understanding) \
+ _(CreateMarkerSpaceML, ML_marker_understanding) \
+
+
+/// For every function defined by XR_ML_localization_map in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_ML_localization_map(_) \
+ _(EnableLocalizationEventsML, ML_localization_map) \
+ _(QueryLocalizationMapsML, ML_localization_map) \
+ _(RequestMapLocalizationML, ML_localization_map) \
+ _(ImportLocalizationMapML, ML_localization_map) \
+ _(CreateExportedLocalizationMapML, ML_localization_map) \
+ _(DestroyExportedLocalizationMapML, ML_localization_map) \
+ _(GetExportedLocalizationMapDataML, ML_localization_map) \
+
+
+/// For every function defined by XR_MSFT_spatial_anchor_persistence in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_spatial_anchor_persistence(_) \
+ _(CreateSpatialAnchorStoreConnectionMSFT, MSFT_spatial_anchor_persistence) \
+ _(DestroySpatialAnchorStoreConnectionMSFT, MSFT_spatial_anchor_persistence) \
+ _(PersistSpatialAnchorMSFT, MSFT_spatial_anchor_persistence) \
+ _(EnumeratePersistedSpatialAnchorNamesMSFT, MSFT_spatial_anchor_persistence) \
+ _(CreateSpatialAnchorFromPersistedNameMSFT, MSFT_spatial_anchor_persistence) \
+ _(UnpersistSpatialAnchorMSFT, MSFT_spatial_anchor_persistence) \
+ _(ClearSpatialAnchorStoreMSFT, MSFT_spatial_anchor_persistence) \
+
+
+/// For every function defined by XR_MSFT_scene_marker in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MSFT_scene_marker(_) \
+ _(GetSceneMarkerRawDataMSFT, MSFT_scene_marker) \
+ _(GetSceneMarkerDecodedStringMSFT, MSFT_scene_marker) \
+
+
+/// For every function defined by XR_FB_spatial_entity_query in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_query(_) \
+ _(QuerySpacesFB, FB_spatial_entity_query) \
+ _(RetrieveSpaceQueryResultsFB, FB_spatial_entity_query) \
+
+
+/// For every function defined by XR_FB_spatial_entity_storage in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_storage(_) \
+ _(SaveSpaceFB, FB_spatial_entity_storage) \
+ _(EraseSpaceFB, FB_spatial_entity_storage) \
+
+
+/// For every function defined by XR_OCULUS_audio_device_guid in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_OCULUS_audio_device_guid(_) \
+ _(GetAudioOutputDeviceGuidOculus, OCULUS_audio_device_guid) \
+ _(GetAudioInputDeviceGuidOculus, OCULUS_audio_device_guid) \
+
+
+/// For every function defined by XR_FB_spatial_entity_sharing in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_sharing(_) \
+ _(ShareSpacesFB, FB_spatial_entity_sharing) \
+
+
+/// For every function defined by XR_FB_scene in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_scene(_) \
+ _(GetSpaceBoundingBox2DFB, FB_scene) \
+ _(GetSpaceBoundingBox3DFB, FB_scene) \
+ _(GetSpaceSemanticLabelsFB, FB_scene) \
+ _(GetSpaceBoundary2DFB, FB_scene) \
+ _(GetSpaceRoomLayoutFB, FB_scene) \
+
+
+/// For every function defined by XR_ALMALENCE_digital_lens_control in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_ALMALENCE_digital_lens_control(_) \
+ _(SetDigitalLensControlALMALENCE, ALMALENCE_digital_lens_control) \
+
+
+/// For every function defined by XR_FB_scene_capture in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_scene_capture(_) \
+ _(RequestSceneCaptureFB, FB_scene_capture) \
+
+
+/// For every function defined by XR_FB_spatial_entity_container in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_container(_) \
+ _(GetSpaceContainerFB, FB_spatial_entity_container) \
+
+
+/// For every function defined by XR_META_foveation_eye_tracked in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_foveation_eye_tracked(_) \
+ _(GetFoveationEyeTrackedStateMETA, META_foveation_eye_tracked) \
+
+
+/// For every function defined by XR_FB_face_tracking in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_face_tracking(_) \
+ _(CreateFaceTrackerFB, FB_face_tracking) \
+ _(DestroyFaceTrackerFB, FB_face_tracking) \
+ _(GetFaceExpressionWeightsFB, FB_face_tracking) \
+
+
+/// For every function defined by XR_FB_eye_tracking_social in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_eye_tracking_social(_) \
+ _(CreateEyeTrackerFB, FB_eye_tracking_social) \
+ _(DestroyEyeTrackerFB, FB_eye_tracking_social) \
+ _(GetEyeGazesFB, FB_eye_tracking_social) \
+
+
+/// For every function defined by XR_FB_passthrough_keyboard_hands in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_passthrough_keyboard_hands(_) \
+ _(PassthroughLayerSetKeyboardHandsIntensityFB, FB_passthrough_keyboard_hands) \
+
+
+/// For every function defined by XR_FB_haptic_pcm in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_haptic_pcm(_) \
+ _(GetDeviceSampleRateFB, FB_haptic_pcm) \
+
+
+/// For every function defined by XR_META_passthrough_preferences in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_passthrough_preferences(_) \
+ _(GetPassthroughPreferencesMETA, META_passthrough_preferences) \
+
+
+/// For every function defined by XR_META_virtual_keyboard in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_virtual_keyboard(_) \
+ _(CreateVirtualKeyboardMETA, META_virtual_keyboard) \
+ _(DestroyVirtualKeyboardMETA, META_virtual_keyboard) \
+ _(CreateVirtualKeyboardSpaceMETA, META_virtual_keyboard) \
+ _(SuggestVirtualKeyboardLocationMETA, META_virtual_keyboard) \
+ _(GetVirtualKeyboardScaleMETA, META_virtual_keyboard) \
+ _(SetVirtualKeyboardModelVisibilityMETA, META_virtual_keyboard) \
+ _(GetVirtualKeyboardModelAnimationStatesMETA, META_virtual_keyboard) \
+ _(GetVirtualKeyboardDirtyTexturesMETA, META_virtual_keyboard) \
+ _(GetVirtualKeyboardTextureDataMETA, META_virtual_keyboard) \
+ _(SendVirtualKeyboardInputMETA, META_virtual_keyboard) \
+ _(ChangeVirtualKeyboardTextContextMETA, META_virtual_keyboard) \
+
+
+/// For every function defined by XR_OCULUS_external_camera in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_OCULUS_external_camera(_) \
+ _(EnumerateExternalCamerasOCULUS, OCULUS_external_camera) \
+
+
+/// For every function defined by XR_META_performance_metrics in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_performance_metrics(_) \
+ _(EnumeratePerformanceMetricsCounterPathsMETA, META_performance_metrics) \
+ _(SetPerformanceMetricsStateMETA, META_performance_metrics) \
+ _(GetPerformanceMetricsStateMETA, META_performance_metrics) \
+ _(QueryPerformanceMetricsCounterMETA, META_performance_metrics) \
+
+
+/// For every function defined by XR_FB_spatial_entity_storage_batch in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_storage_batch(_) \
+ _(SaveSpaceListFB, FB_spatial_entity_storage_batch) \
+
+
+/// For every function defined by XR_FB_spatial_entity_user in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_spatial_entity_user(_) \
+ _(CreateSpaceUserFB, FB_spatial_entity_user) \
+ _(GetSpaceUserIdFB, FB_spatial_entity_user) \
+ _(DestroySpaceUserFB, FB_spatial_entity_user) \
+
+
+/// For every function defined by XR_META_recommended_layer_resolution in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_recommended_layer_resolution(_) \
+ _(GetRecommendedLayerResolutionMETA, META_recommended_layer_resolution) \
+
+
+/// For every function defined by XR_META_passthrough_color_lut in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_passthrough_color_lut(_) \
+ _(CreatePassthroughColorLutMETA, META_passthrough_color_lut) \
+ _(DestroyPassthroughColorLutMETA, META_passthrough_color_lut) \
+ _(UpdatePassthroughColorLutMETA, META_passthrough_color_lut) \
+
+
+/// For every function defined by XR_META_spatial_entity_mesh in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_META_spatial_entity_mesh(_) \
+ _(GetSpaceTriangleMeshMETA, META_spatial_entity_mesh) \
+
+
+/// For every function defined by XR_FB_face_tracking2 in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_FB_face_tracking2(_) \
+ _(CreateFaceTracker2FB, FB_face_tracking2) \
+ _(DestroyFaceTracker2FB, FB_face_tracking2) \
+ _(GetFaceExpressionWeights2FB, FB_face_tracking2) \
+
+
+/// For every function defined by XR_QCOM_tracking_optimization_settings in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_QCOM_tracking_optimization_settings(_) \
+ _(SetTrackingOptimizationSettingsHintQCOM, QCOM_tracking_optimization_settings) \
+
+
+/// For every function defined by XR_HTC_passthrough in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_HTC_passthrough(_) \
+ _(CreatePassthroughHTC, HTC_passthrough) \
+ _(DestroyPassthroughHTC, HTC_passthrough) \
+
+
+/// For every function defined by XR_HTC_foveation in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_HTC_foveation(_) \
+ _(ApplyFoveationHTC, HTC_foveation) \
+
+
+/// For every function defined by XR_HTC_anchor in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_HTC_anchor(_) \
+ _(CreateSpatialAnchorHTC, HTC_anchor) \
+ _(GetSpatialAnchorNameHTC, HTC_anchor) \
+
+
+/// For every function defined by XR_MNDX_force_feedback_curl in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_MNDX_force_feedback_curl(_) \
+ _(ApplyForceFeedbackCurlMNDX, MNDX_force_feedback_curl) \
+
+
+/// For every function defined by XR_EXT_plane_detection in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_EXT_plane_detection(_) \
+ _(CreatePlaneDetectorEXT, EXT_plane_detection) \
+ _(DestroyPlaneDetectorEXT, EXT_plane_detection) \
+ _(BeginPlaneDetectionEXT, EXT_plane_detection) \
+ _(GetPlaneDetectionStateEXT, EXT_plane_detection) \
+ _(GetPlaneDetectionsEXT, EXT_plane_detection) \
+ _(GetPlanePolygonBufferEXT, EXT_plane_detection) \
+
+
+/// For every function defined by XR_ML_user_calibration in this version of the spec,
+/// calls your macro with the function name and extension name.
+/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
+/// because it is easy to add back but impossible to remove with the preprocessor.
+#define XR_LIST_FUNCTIONS_XR_ML_user_calibration(_) \
+ _(EnableUserCalibrationEventsML, ML_user_calibration) \
+
+
+
+
#endif
diff --git a/thirdparty/openxr/include/openxr/openxr_reflection_structs.h b/thirdparty/openxr/include/openxr/openxr_reflection_structs.h
index bcc1333e29..f973539cbb 100644
--- a/thirdparty/openxr/include/openxr/openxr_reflection_structs.h
+++ b/thirdparty/openxr/include/openxr/openxr_reflection_structs.h
@@ -308,11 +308,19 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrEventDataSpaceListSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB) \
_avail(XrSpaceUserCreateInfoFB, XR_TYPE_SPACE_USER_CREATE_INFO_FB) \
_avail(XrSystemHeadsetIdPropertiesMETA, XR_TYPE_SYSTEM_HEADSET_ID_PROPERTIES_META) \
+ _avail(XrRecommendedLayerResolutionMETA, XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_META) \
+ _avail(XrRecommendedLayerResolutionGetInfoMETA, XR_TYPE_RECOMMENDED_LAYER_RESOLUTION_GET_INFO_META) \
_avail(XrPassthroughColorLutCreateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_CREATE_INFO_META) \
_avail(XrPassthroughColorLutUpdateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_UPDATE_INFO_META) \
_avail(XrPassthroughColorMapLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_LUT_META) \
_avail(XrPassthroughColorMapInterpolatedLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_INTERPOLATED_LUT_META) \
_avail(XrSystemPassthroughColorLutPropertiesMETA, XR_TYPE_SYSTEM_PASSTHROUGH_COLOR_LUT_PROPERTIES_META) \
+ _avail(XrSpaceTriangleMeshGetInfoMETA, XR_TYPE_SPACE_TRIANGLE_MESH_GET_INFO_META) \
+ _avail(XrSpaceTriangleMeshMETA, XR_TYPE_SPACE_TRIANGLE_MESH_META) \
+ _avail(XrSystemFaceTrackingProperties2FB, XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES2_FB) \
+ _avail(XrFaceTrackerCreateInfo2FB, XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB) \
+ _avail(XrFaceExpressionInfo2FB, XR_TYPE_FACE_EXPRESSION_INFO2_FB) \
+ _avail(XrFaceExpressionWeights2FB, XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB) \
_avail(XrPassthroughCreateInfoHTC, XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC) \
_avail(XrPassthroughColorHTC, XR_TYPE_PASSTHROUGH_COLOR_HTC) \
_avail(XrPassthroughMeshTransformInfoHTC, XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC) \
@@ -334,6 +342,8 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrPlaneDetectorLocationEXT, XR_TYPE_PLANE_DETECTOR_LOCATION_EXT) \
_avail(XrPlaneDetectorLocationsEXT, XR_TYPE_PLANE_DETECTOR_LOCATIONS_EXT) \
_avail(XrPlaneDetectorPolygonBufferEXT, XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT) \
+ _avail(XrEventDataUserPresenceChangedEXT, XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT) \
+ _avail(XrSystemUserPresencePropertiesEXT, XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT) \
_avail(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \
_avail(XrEventDataEyeCalibrationChangedML, XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML) \
_avail(XrUserCalibrationEnableEventsInfoML, XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML) \
diff --git a/thirdparty/openxr/src/common/platform_utils.hpp b/thirdparty/openxr/src/common/platform_utils.hpp
index c4d75bf259..35369a1477 100644
--- a/thirdparty/openxr/src/common/platform_utils.hpp
+++ b/thirdparty/openxr/src/common/platform_utils.hpp
@@ -323,6 +323,8 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* name) {
const std::string envValue = PlatformUtilsGetEnv(name);
// Do not allow high integrity processes to act on data that can be controlled by medium integrity processes.
+ // Specifically, medium integrity processes can set environment variables which could then
+ // be read by high integrity processes.
if (IsHighIntegrityLevel()) {
if (!envValue.empty()) {
LogPlatformUtilsError(std::string("!!! WARNING !!! Environment variable ") + name +
diff --git a/thirdparty/openxr/src/loader/api_layer_interface.cpp b/thirdparty/openxr/src/loader/api_layer_interface.cpp
index fb509de270..a93d45da37 100644
--- a/thirdparty/openxr/src/loader/api_layer_interface.cpp
+++ b/thirdparty/openxr/src/loader/api_layer_interface.cpp
@@ -72,10 +72,10 @@ XrResult ApiLayerInterface::GetApiLayerProperties(const std::string& openxr_comm
}
// Find any implicit layers which we may need to report information for.
- XrResult result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
+ XrResult result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
if (XR_SUCCEEDED(result)) {
// Find any explicit layers which we may need to report information for.
- result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_EXPLICIT_API_LAYER, manifest_files);
+ result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_EXPLICIT_API_LAYER, manifest_files);
}
if (XR_FAILED(result)) {
LoaderLogger::LogErrorMessage(openxr_command,
@@ -126,10 +126,10 @@ XrResult ApiLayerInterface::GetInstanceExtensionProperties(const std::string& op
// If a layer name is supplied, only use the information out of that one layer
if (nullptr != layer_name && 0 != strlen(layer_name)) {
- XrResult result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
+ XrResult result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
if (XR_SUCCEEDED(result)) {
// Find any explicit layers which we may need to report information for.
- result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_EXPLICIT_API_LAYER, manifest_files);
+ result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_EXPLICIT_API_LAYER, manifest_files);
if (XR_FAILED(result)) {
LoaderLogger::LogErrorMessage(
openxr_command,
@@ -155,7 +155,7 @@ XrResult ApiLayerInterface::GetInstanceExtensionProperties(const std::string& op
}
// Otherwise, we want to add only implicit API layers and explicit API layers enabled using the environment variables
} else {
- XrResult result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
+ XrResult result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_IMPLICIT_API_LAYER, manifest_files);
if (XR_SUCCEEDED(result)) {
// Find any environmentally enabled explicit layers. If they're present, treat them like implicit layers
// since we know that they're going to be enabled.
@@ -163,7 +163,8 @@ XrResult ApiLayerInterface::GetInstanceExtensionProperties(const std::string& op
AddEnvironmentApiLayers(env_enabled_layers);
if (!env_enabled_layers.empty()) {
std::vector<std::unique_ptr<ApiLayerManifestFile>> exp_layer_man_files = {};
- result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_EXPLICIT_API_LAYER, exp_layer_man_files);
+ result =
+ ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_EXPLICIT_API_LAYER, exp_layer_man_files);
if (XR_SUCCEEDED(result)) {
for (auto& exp_layer_man_file : exp_layer_man_files) {
for (std::string& enabled_layer : env_enabled_layers) {
@@ -197,8 +198,8 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin
std::vector<std::unique_ptr<ApiLayerManifestFile>> enabled_layer_manifest_files_in_init_order = {};
// Find any implicit layers.
- XrResult result =
- ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_IMPLICIT_API_LAYER, enabled_layer_manifest_files_in_init_order);
+ XrResult result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_IMPLICIT_API_LAYER,
+ enabled_layer_manifest_files_in_init_order);
for (const auto& enabled_layer_manifest_file : enabled_layer_manifest_files_in_init_order) {
layers_already_found.insert(enabled_layer_manifest_file->LayerName());
@@ -208,7 +209,8 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin
std::vector<std::unique_ptr<ApiLayerManifestFile>> explicit_layer_manifest_files = {};
if (XR_SUCCEEDED(result)) {
- result = ApiLayerManifestFile::FindManifestFiles(MANIFEST_TYPE_EXPLICIT_API_LAYER, explicit_layer_manifest_files);
+ result = ApiLayerManifestFile::FindManifestFiles(openxr_command, MANIFEST_TYPE_EXPLICIT_API_LAYER,
+ explicit_layer_manifest_files);
}
bool found_all_layers = true;
diff --git a/thirdparty/openxr/src/loader/loader_init_data.cpp b/thirdparty/openxr/src/loader/loader_init_data.cpp
index 11d3c4e77b..3ba6d26713 100644
--- a/thirdparty/openxr/src/loader/loader_init_data.cpp
+++ b/thirdparty/openxr/src/loader/loader_init_data.cpp
@@ -11,9 +11,9 @@
#ifdef XR_KHR_LOADER_INIT_SUPPORT
-#ifdef XR_USE_PLATFORM_ANDROID
// Check and copy the Android-specific init data.
XrResult LoaderInitData::initialize(const XrLoaderInitInfoBaseHeaderKHR* info) {
+#if defined(XR_USE_PLATFORM_ANDROID)
if (info->type != XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR) {
return XR_ERROR_VALIDATION_FAILURE;
}
@@ -40,11 +40,13 @@ XrResult LoaderInitData::initialize(const XrLoaderInitInfoBaseHeaderKHR* info) {
const auto applicationContext = context.call<jni::Object>("getApplicationContext()Landroid/content/Context;");
const auto applicationInfo = context.call<jni::Object>("getApplicationInfo()Landroid/content/pm/ApplicationInfo;");
_native_library_path = applicationInfo.get<std::string>("nativeLibraryDir");
+#else
+#error "Platform specific XR_KHR_loader_init structure is not defined for this platform."
+#endif // XR_USE_PLATFORM_ANDROID
_initialized = true;
return XR_SUCCESS;
}
-#endif // XR_USE_PLATFORM_ANDROID
XrResult InitializeLoaderInitData(const XrLoaderInitInfoBaseHeaderKHR* loaderInitInfo) {
return LoaderInitData::instance().initialize(loaderInitInfo);
diff --git a/thirdparty/openxr/src/loader/loader_init_data.hpp b/thirdparty/openxr/src/loader/loader_init_data.hpp
index fe6bc134d3..e3a27fc403 100644
--- a/thirdparty/openxr/src/loader/loader_init_data.hpp
+++ b/thirdparty/openxr/src/loader/loader_init_data.hpp
@@ -33,7 +33,7 @@ class LoaderInitData {
return obj;
}
-#ifdef XR_USE_PLATFORM_ANDROID
+#if defined(XR_USE_PLATFORM_ANDROID)
/*!
* Type alias for the platform-specific structure type.
*/
diff --git a/thirdparty/openxr/src/loader/manifest_file.cpp b/thirdparty/openxr/src/loader/manifest_file.cpp
index f9699ece40..4e3e5b4947 100644
--- a/thirdparty/openxr/src/loader/manifest_file.cpp
+++ b/thirdparty/openxr/src/loader/manifest_file.cpp
@@ -600,14 +600,8 @@ void RuntimeManifestFile::CreateIfValid(const Json::Value &root_node, const std:
// If the library_path variable has no directory symbol, it's just a file name and should be accessible on the
// global library path.
if (lib_path.find('\\') != std::string::npos || lib_path.find('/') != std::string::npos) {
- // If the library_path is an absolute path, just use that if it exists
- if (FileSysUtilsIsAbsolutePath(lib_path)) {
- if (!FileSysUtilsPathExists(lib_path)) {
- error_ss << filename << " library " << lib_path << " does not appear to exist";
- LoaderLogger::LogErrorMessage("", error_ss.str());
- return;
- }
- } else {
+ // If the library_path is an absolute path, just use that as-is.
+ if (!FileSysUtilsIsAbsolutePath(lib_path)) {
// Otherwise, treat the library path as a relative path based on the JSON file.
std::string canonical_path;
std::string combined_path;
@@ -618,8 +612,8 @@ void RuntimeManifestFile::CreateIfValid(const Json::Value &root_node, const std:
canonical_path = filename;
}
if (!FileSysUtilsGetParentPath(canonical_path, file_parent) ||
- !FileSysUtilsCombinePaths(file_parent, lib_path, combined_path) || !FileSysUtilsPathExists(combined_path)) {
- error_ss << filename << " library " << combined_path << " does not appear to exist";
+ !FileSysUtilsCombinePaths(file_parent, lib_path, combined_path)) {
+ error_ss << filename << " filesystem operations failed for path " << canonical_path;
LoaderLogger::LogErrorMessage("", error_ss.str());
return;
}
@@ -636,53 +630,58 @@ void RuntimeManifestFile::CreateIfValid(const Json::Value &root_node, const std:
}
// Find all manifest files in the appropriate search paths/registries for the given type.
-XrResult RuntimeManifestFile::FindManifestFiles(std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files) {
+XrResult RuntimeManifestFile::FindManifestFiles(const std::string &openxr_command,
+ std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files) {
XrResult result = XR_SUCCESS;
std::string filename = PlatformUtilsGetSecureEnv(OPENXR_RUNTIME_JSON_ENV_VAR);
if (!filename.empty()) {
LoaderLogger::LogInfoMessage(
- "", "RuntimeManifestFile::FindManifestFiles - using environment variable override runtime file " + filename);
+ openxr_command,
+ "RuntimeManifestFile::FindManifestFiles - using environment variable override runtime file " + filename);
} else {
#ifdef XR_OS_WINDOWS
std::vector<std::string> filenames;
ReadRuntimeDataFilesInRegistry("", "ActiveRuntime", filenames);
if (filenames.size() == 0) {
LoaderLogger::LogErrorMessage(
- "", "RuntimeManifestFile::FindManifestFiles - failed to find active runtime file in registry");
+ openxr_command, "RuntimeManifestFile::FindManifestFiles - failed to find active runtime file in registry");
return XR_ERROR_RUNTIME_UNAVAILABLE;
}
if (filenames.size() > 1) {
LoaderLogger::LogWarningMessage(
- "", "RuntimeManifestFile::FindManifestFiles - found too many default runtime files in registry");
+ openxr_command, "RuntimeManifestFile::FindManifestFiles - found too many default runtime files in registry");
}
filename = filenames[0];
- LoaderLogger::LogInfoMessage("",
+ LoaderLogger::LogInfoMessage(openxr_command,
"RuntimeManifestFile::FindManifestFiles - using registry-specified runtime file " + filename);
#elif defined(XR_OS_LINUX)
if (!FindXDGConfigFile("openxr/", XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), filename)) {
LoaderLogger::LogErrorMessage(
- "", "RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment");
+ openxr_command,
+ "RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment");
return XR_ERROR_RUNTIME_UNAVAILABLE;
}
-#else
+#else // !defined(XR_OS_WINDOWS) && !defined(XR_OS_LINUX)
-#if defined(XR_USE_PLATFORM_ANDROID)
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
Json::Value virtualManifest;
result = GetPlatformRuntimeVirtualManifest(virtualManifest);
if (XR_SUCCESS == result) {
RuntimeManifestFile::CreateIfValid(virtualManifest, "", manifest_files);
return result;
}
-#endif // defined(XR_USE_PLATFORM_ANDROID)
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
if (!PlatformGetGlobalRuntimeFileName(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), filename)) {
LoaderLogger::LogErrorMessage(
- "", "RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment");
+ openxr_command,
+ "RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment");
return XR_ERROR_RUNTIME_UNAVAILABLE;
}
result = XR_SUCCESS;
- LoaderLogger::LogInfoMessage("", "RuntimeManifestFile::FindManifestFiles - using global runtime file " + filename);
-#endif
+ LoaderLogger::LogInfoMessage(openxr_command,
+ "RuntimeManifestFile::FindManifestFiles - using global runtime file " + filename);
+#endif // !defined(XR_OS_WINDOWS) && !defined(XR_OS_LINUX)
}
RuntimeManifestFile::CreateIfValid(filename, manifest_files);
@@ -698,9 +697,17 @@ ApiLayerManifestFile::ApiLayerManifestFile(ManifestFileType type, const std::str
_description(description),
_implementation_version(implementation_version) {}
-#ifdef XR_USE_PLATFORM_ANDROID
-void ApiLayerManifestFile::AddManifestFilesAndroid(ManifestFileType type,
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
+void ApiLayerManifestFile::AddManifestFilesAndroid(const std::string &openxr_command, ManifestFileType type,
std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files) {
+ if (!LoaderInitData::instance().initialized()) {
+ // This will happen for applications that do not call xrInitializeLoaderKHR
+ LoaderLogger::LogWarningMessage(
+ openxr_command,
+ "ApiLayerManifestFile::AddManifestFilesAndroid unable to add manifest files LoaderInitData not initialized.");
+ return;
+ }
+
AAssetManager *assetManager = (AAssetManager *)Android_Get_Asset_Manager();
std::vector<std::string> filenames;
{
@@ -736,7 +743,7 @@ void ApiLayerManifestFile::AddManifestFilesAndroid(ManifestFileType type,
UniqueAsset asset{AAssetManager_open(assetManager, filename.c_str(), AASSET_MODE_BUFFER)};
if (!asset) {
LoaderLogger::LogWarningMessage(
- "", "ApiLayerManifestFile::AddManifestFilesAndroid unable to open asset " + filename + ", skipping");
+ openxr_command, "ApiLayerManifestFile::AddManifestFilesAndroid unable to open asset " + filename + ", skipping");
continue;
}
@@ -744,7 +751,7 @@ void ApiLayerManifestFile::AddManifestFilesAndroid(ManifestFileType type,
const char *buf = reinterpret_cast<const char *>(AAsset_getBuffer(asset.get()));
if (!buf) {
LoaderLogger::LogWarningMessage(
- "", "ApiLayerManifestFile::AddManifestFilesAndroid unable to access asset" + filename + ", skipping");
+ openxr_command, "ApiLayerManifestFile::AddManifestFilesAndroid unable to access asset" + filename + ", skipping");
continue;
}
@@ -754,7 +761,7 @@ void ApiLayerManifestFile::AddManifestFilesAndroid(ManifestFileType type,
&ApiLayerManifestFile::LocateLibraryInAssets, manifest_files);
}
}
-#endif // XR_USE_PLATFORM_ANDROID
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
void ApiLayerManifestFile::CreateIfValid(ManifestFileType type, const std::string &filename, std::istream &json_stream,
LibraryLocator locate_library,
@@ -898,7 +905,7 @@ bool ApiLayerManifestFile::LocateLibraryRelativeToJson(
return true;
}
-#ifdef XR_USE_PLATFORM_ANDROID
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
bool ApiLayerManifestFile::LocateLibraryInAssets(const std::string & /* json_filename */, const std::string &library_path,
std::string &out_combined_path) {
std::string combined_path;
@@ -910,7 +917,7 @@ bool ApiLayerManifestFile::LocateLibraryInAssets(const std::string & /* json_fil
out_combined_path = combined_path;
return true;
}
-#endif
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
void ApiLayerManifestFile::PopulateApiLayerProperties(XrApiLayerProperties &props) const {
props.layerVersion = _implementation_version;
@@ -926,7 +933,7 @@ void ApiLayerManifestFile::PopulateApiLayerProperties(XrApiLayerProperties &prop
}
// Find all layer manifest files in the appropriate search paths/registries for the given type.
-XrResult ApiLayerManifestFile::FindManifestFiles(ManifestFileType type,
+XrResult ApiLayerManifestFile::FindManifestFiles(const std::string &openxr_command, ManifestFileType type,
std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files) {
std::string relative_path;
std::string override_env_var;
@@ -953,7 +960,8 @@ XrResult ApiLayerManifestFile::FindManifestFiles(ManifestFileType type,
#endif
break;
default:
- LoaderLogger::LogErrorMessage("", "ApiLayerManifestFile::FindManifestFiles - unknown manifest file requested");
+ LoaderLogger::LogErrorMessage(openxr_command,
+ "ApiLayerManifestFile::FindManifestFiles - unknown manifest file requested");
return XR_ERROR_FILE_ACCESS_ERROR;
}
@@ -972,9 +980,9 @@ XrResult ApiLayerManifestFile::FindManifestFiles(ManifestFileType type,
ApiLayerManifestFile::CreateIfValid(type, cur_file, manifest_files);
}
-#ifdef XR_USE_PLATFORM_ANDROID
- ApiLayerManifestFile::AddManifestFilesAndroid(type, manifest_files);
-#endif // XR_USE_PLATFORM_ANDROID
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
+ ApiLayerManifestFile::AddManifestFilesAndroid(openxr_command, type, manifest_files);
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
return XR_SUCCESS;
}
diff --git a/thirdparty/openxr/src/loader/manifest_file.hpp b/thirdparty/openxr/src/loader/manifest_file.hpp
index 52fe3134b0..801614ad1e 100644
--- a/thirdparty/openxr/src/loader/manifest_file.hpp
+++ b/thirdparty/openxr/src/loader/manifest_file.hpp
@@ -71,7 +71,8 @@ class ManifestFile {
class RuntimeManifestFile : public ManifestFile {
public:
// Factory method
- static XrResult FindManifestFiles(std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files);
+ static XrResult FindManifestFiles(const std::string &openxr_command,
+ std::vector<std::unique_ptr<RuntimeManifestFile>> &manifest_files);
private:
RuntimeManifestFile(const std::string &filename, const std::string &library_path);
@@ -87,7 +88,8 @@ using LibraryLocator = bool (*)(const std::string &json_filename, const std::str
class ApiLayerManifestFile : public ManifestFile {
public:
// Factory method
- static XrResult FindManifestFiles(ManifestFileType type, std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files);
+ static XrResult FindManifestFiles(const std::string &openxr_command, ManifestFileType type,
+ std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files);
const std::string &LayerName() const { return _layer_name; }
void PopulateApiLayerProperties(XrApiLayerProperties &props) const;
@@ -104,11 +106,13 @@ class ApiLayerManifestFile : public ManifestFile {
/// @return false if we could not find the library.
static bool LocateLibraryRelativeToJson(const std::string &json_filename, const std::string &library_path,
std::string &out_combined_path);
-#ifdef XR_USE_PLATFORM_ANDROID
+
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
static bool LocateLibraryInAssets(const std::string &json_filename, const std::string &library_path,
std::string &out_combined_path);
- static void AddManifestFilesAndroid(ManifestFileType type, std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files);
-#endif
+ static void AddManifestFilesAndroid(const std::string &openxr_command, ManifestFileType type,
+ std::vector<std::unique_ptr<ApiLayerManifestFile>> &manifest_files);
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
JsonVersion _api_version;
std::string _layer_name;
diff --git a/thirdparty/openxr/src/loader/runtime_interface.cpp b/thirdparty/openxr/src/loader/runtime_interface.cpp
index 7812aca987..a0296c738c 100644
--- a/thirdparty/openxr/src/loader/runtime_interface.cpp
+++ b/thirdparty/openxr/src/loader/runtime_interface.cpp
@@ -34,7 +34,7 @@
#include <openxr/openxr_platform.h>
#endif // XR_USE_PLATFORM_ANDROID
-#ifdef XR_USE_PLATFORM_ANDROID
+#if defined(XR_KHR_LOADER_INIT_SUPPORT) && defined(XR_USE_PLATFORM_ANDROID)
XrResult GetPlatformRuntimeVirtualManifest(Json::Value& out_manifest) {
using wrap::android::content::Context;
auto& initData = LoaderInitData::instance();
@@ -52,7 +52,7 @@ XrResult GetPlatformRuntimeVirtualManifest(Json::Value& out_manifest) {
out_manifest = virtualManifest;
return XR_SUCCESS;
}
-#endif // XR_USE_PLATFORM_ANDROID
+#endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT)
XrResult RuntimeInterface::TryLoadingSingleRuntime(const std::string& openxr_command,
std::unique_ptr<RuntimeManifestFile>& manifest_file) {
@@ -227,7 +227,6 @@ XrResult RuntimeInterface::LoadRuntime(const std::string& openxr_command) {
return XR_SUCCESS;
}
#ifdef XR_KHR_LOADER_INIT_SUPPORT
-
if (!LoaderInitData::instance().initialized()) {
LoaderLogger::LogErrorMessage(
openxr_command, "RuntimeInterface::LoadRuntime cannot run because xrInitializeLoaderKHR was not successfully called.");
@@ -238,7 +237,7 @@ XrResult RuntimeInterface::LoadRuntime(const std::string& openxr_command) {
std::vector<std::unique_ptr<RuntimeManifestFile>> runtime_manifest_files = {};
// Find the available runtimes which we may need to report information for.
- XrResult last_error = RuntimeManifestFile::FindManifestFiles(runtime_manifest_files);
+ XrResult last_error = RuntimeManifestFile::FindManifestFiles(openxr_command, runtime_manifest_files);
if (XR_FAILED(last_error)) {
LoaderLogger::LogErrorMessage(openxr_command, "RuntimeInterface::LoadRuntimes - unknown error");
} else {