From 07bc4e2f96f8f47991339654ff4ab16acc19d44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 14:29:06 +0200 Subject: Style: Enforce separation line between function definitions I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027. --- core/array.cpp | 4 ++ core/bind/core_bind.cpp | 48 ++++++++++++++ core/callable.cpp | 10 +++ core/class_db.cpp | 4 ++ core/color.cpp | 1 + core/compressed_translation.cpp | 1 + core/crypto/crypto.cpp | 1 + core/debugger/script_debugger.cpp | 2 + core/dictionary.cpp | 4 ++ core/engine.cpp | 1 + core/image.cpp | 2 + core/input/input.cpp | 2 + core/input/input_event.cpp | 21 ++++++ core/io/config_file.cpp | 3 + core/io/file_access_compressed.cpp | 4 ++ core/io/file_access_encrypted.cpp | 4 ++ core/io/file_access_network.cpp | 3 + core/io/file_access_pack.cpp | 8 +++ core/io/multiplayer_api.cpp | 2 + core/io/packet_peer.cpp | 1 + core/io/packet_peer_udp.cpp | 1 + core/io/resource_format_binary.cpp | 2 + core/io/resource_loader.cpp | 2 + core/io/stream_peer.cpp | 24 +++++++ core/io/translation_loader_po.cpp | 1 + core/io/xml_parser.cpp | 8 +++ core/math/aabb.cpp | 5 ++ core/math/basis.cpp | 1 + core/math/camera_matrix.cpp | 1 + core/math/geometry.cpp | 1 + core/math/octree.h | 1 + core/math/transform.cpp | 2 + core/math/transform.h | 2 + core/math/transform_2d.cpp | 3 + core/math/transform_2d.h | 2 + core/math/vector2.cpp | 4 ++ core/math/vector2.h | 4 ++ core/math/vector3.cpp | 3 + core/math/vector3.h | 2 + core/math/vector3i.cpp | 2 + core/math/vector3i.h | 2 + core/message_queue.cpp | 1 + core/method_bind.cpp | 2 + core/node_path.cpp | 4 ++ core/object.cpp | 9 +++ core/os/dir_access.cpp | 1 + core/os/file_access.cpp | 4 ++ core/os/main_loop.cpp | 2 + core/os/os.cpp | 4 ++ core/packed_data_container.cpp | 2 + core/pool_allocator.cpp | 1 + core/project_settings.cpp | 2 + core/resource.cpp | 2 + core/script_language.cpp | 9 +++ core/string_name.cpp | 1 + core/translation.cpp | 2 + core/undo_redo.cpp | 4 ++ core/ustring.cpp | 12 ++++ core/variant.cpp | 33 ++++++++++ core/variant_op.cpp | 2 + core/variant_parser.cpp | 2 + drivers/gles2/rasterizer_canvas_gles2.cpp | 2 + drivers/gles2/rasterizer_scene_gles2.cpp | 4 ++ drivers/gles2/rasterizer_storage_gles2.cpp | 13 ++++ drivers/gles2/shaders/blend_shape.glsl | 1 + drivers/gles2/shaders/particles.glsl | 1 + drivers/gles2/shaders/scene.glsl | 2 + drivers/unix/os_unix.cpp | 1 + drivers/unix/thread_posix.cpp | 2 + drivers/vulkan/rendering_device_vulkan.cpp | 10 +++ drivers/vulkan/vulkan_context.cpp | 2 + drivers/windows/dir_access_windows.cpp | 4 ++ drivers/windows/file_access_windows.cpp | 4 ++ drivers/windows/thread_windows.cpp | 2 + drivers/xaudio2/audio_driver_xaudio2.cpp | 1 + editor/animation_bezier_editor.cpp | 2 + editor/animation_track_editor.cpp | 11 ++++ editor/animation_track_editor_plugins.cpp | 14 ++++ editor/array_property_edit.cpp | 1 + editor/audio_stream_preview.cpp | 2 + editor/create_dialog.cpp | 2 + editor/debugger/editor_debugger_node.cpp | 8 +++ editor/debugger/script_editor_debugger.cpp | 6 ++ editor/doc_data.cpp | 2 + editor/editor_atlas_packer.cpp | 1 + editor/editor_audio_buses.cpp | 2 + editor/editor_data.cpp | 12 ++++ editor/editor_export.cpp | 5 ++ editor/editor_feature_profile.cpp | 2 + editor/editor_file_dialog.cpp | 9 +++ editor/editor_file_system.cpp | 2 + editor/editor_folding.cpp | 2 + editor/editor_help.cpp | 1 + editor/editor_inspector.cpp | 12 ++++ editor/editor_node.cpp | 2 + editor/editor_plugin.cpp | 6 ++ editor/editor_properties.cpp | 24 +++++++ editor/editor_scale.cpp | 1 + editor/export_template_manager.cpp | 1 + editor/import/editor_import_collada.cpp | 2 + editor/import/editor_scene_importer_gltf.cpp | 2 + editor/import/resource_importer_bitmask.cpp | 3 + editor/import/resource_importer_csv.cpp | 2 + .../import/resource_importer_csv_translation.cpp | 2 + editor/import/resource_importer_image.cpp | 2 + .../import/resource_importer_layered_texture.cpp | 3 + editor/import/resource_importer_obj.cpp | 8 +++ editor/import/resource_importer_scene.cpp | 7 ++ editor/import/resource_importer_shader_file.cpp | 4 ++ editor/import/resource_importer_texture.cpp | 3 + editor/import/resource_importer_texture_atlas.cpp | 2 + editor/import/resource_importer_wav.cpp | 3 + editor/import_dock.cpp | 2 + editor/inspector_dock.cpp | 1 + editor/node_3d_editor_gizmos.cpp | 20 ++++++ editor/pane_drag.cpp | 1 + editor/plugins/animation_player_editor_plugin.cpp | 4 ++ editor/plugins/animation_state_machine_editor.cpp | 1 + editor/plugins/asset_library_editor_plugin.cpp | 4 ++ editor/plugins/canvas_item_editor_plugin.cpp | 2 + .../plugins/collision_polygon_3d_editor_plugin.cpp | 1 + editor/plugins/editor_preview_plugins.cpp | 3 + editor/plugins/gradient_editor_plugin.cpp | 1 + editor/plugins/item_list_editor_plugin.cpp | 1 + editor/plugins/material_editor_plugin.cpp | 12 ++++ editor/plugins/node_3d_editor_plugin.cpp | 8 +++ editor/plugins/path_2d_editor_plugin.cpp | 1 + editor/plugins/path_3d_editor_plugin.cpp | 2 + editor/plugins/root_motion_editor_plugin.cpp | 1 + editor/plugins/shader_editor_plugin.cpp | 1 + editor/plugins/sprite_frames_editor_plugin.cpp | 1 + editor/plugins/style_box_editor_plugin.cpp | 2 + editor/plugins/texture_editor_plugin.cpp | 1 + editor/plugins/texture_layered_editor_plugin.cpp | 1 + editor/plugins/tile_set_editor_plugin.cpp | 2 + editor/plugins/visual_shader_editor_plugin.cpp | 1 + editor/progress_dialog.cpp | 2 + editor/project_export.cpp | 1 + editor/project_settings_editor.cpp | 2 + editor/property_selector.cpp | 1 + editor/reparent_dialog.cpp | 1 + editor/run_settings_dialog.cpp | 1 + editor/scene_tree_editor.cpp | 4 ++ editor/script_create_dialog.cpp | 1 + editor/shader_globals_editor.cpp | 1 + main/tests/test_gdscript.cpp | 2 + main/tests/test_gui.cpp | 1 + main/tests/test_math.cpp | 1 + main/tests/test_oa_hash_map.cpp | 1 + main/tests/test_ordered_hash_map.cpp | 1 + main/tests/test_physics_2d.cpp | 1 + main/tests/test_physics_3d.cpp | 1 + main/tests/test_render.cpp | 1 + main/tests/test_shader_lang.cpp | 1 + main/tests/test_string.cpp | 1 + modules/assimp/editor_scene_importer_assimp.cpp | 1 + modules/bullet/rigid_body_bullet.cpp | 1 + modules/bullet/slider_joint_bullet.cpp | 1 + modules/csg/csg_gizmos.cpp | 4 ++ modules/csg/csg_shape.cpp | 4 ++ modules/enet/networked_multiplayer_enet.cpp | 2 + modules/gdnative/gdnative/string.cpp | 1 + modules/gdnative/nativescript/nativescript.cpp | 25 ++++++++ modules/gdscript/gdscript.cpp | 9 +++ modules/gdscript/gdscript_compiler.cpp | 2 + modules/gdscript/gdscript_editor.cpp | 5 ++ modules/gdscript/gdscript_function.cpp | 2 + modules/gdscript/gdscript_parser.cpp | 1 + modules/gdscript/gdscript_tokenizer.cpp | 7 ++ modules/glslang/register_types.cpp | 1 + modules/gridmap/grid_map.cpp | 2 + modules/lightmapper_rd/lightmapper_rd.cpp | 7 ++ modules/lightmapper_rd/lm_common_inc.glsl | 7 ++ modules/lightmapper_rd/lm_compute.glsl | 2 + modules/lightmapper_rd/lm_raster.glsl | 1 + modules/mbedtls/stream_peer_mbedtls.cpp | 2 + modules/mono/mono_gd/gd_mono.cpp | 1 + modules/mono/mono_gd/gd_mono_utils.h | 1 + modules/mono/mono_gd/support/android_support.cpp | 0 modules/mono/mono_gd/support/ios_support.mm | 0 modules/mono/utils/mono_reg_utils.cpp | 1 + modules/mono/utils/string_utils.cpp | 1 + modules/pvr/texture_loader_pvr.cpp | 2 + modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 + .../stb_vorbis/resource_importer_ogg_vorbis.cpp | 2 + modules/svg/image_loader_svg.cpp | 1 + modules/visual_script/visual_script.cpp | 41 ++++++++++++ .../visual_script/visual_script_builtin_funcs.cpp | 2 + modules/visual_script/visual_script_editor.cpp | 1 + modules/visual_script/visual_script_expression.cpp | 5 ++ .../visual_script/visual_script_flow_control.cpp | 18 ++++++ modules/visual_script/visual_script_func_nodes.cpp | 15 +++++ modules/visual_script/visual_script_nodes.cpp | 67 ++++++++++++++++++++ .../visual_script/visual_script_yield_nodes.cpp | 4 ++ modules/webm/video_stream_webm.cpp | 7 ++ modules/websocket/websocket_multiplayer_peer.cpp | 1 + platform/android/file_access_jandroid.cpp | 1 + platform/iphone/icloud.mm | 2 + platform/iphone/in_app_store.mm | 1 + platform/javascript/display_server_javascript.cpp | 2 + platform/linuxbsd/context_gl_x11.cpp | 1 + platform/linuxbsd/display_server_x11.cpp | 19 ++++++ platform/osx/display_server_osx.mm | 2 + platform/osx/joypad_osx.cpp | 1 + platform/server/os_server.cpp | 1 + platform/uwp/app.cpp | 1 + platform/uwp/os_uwp.cpp | 4 ++ platform/windows/display_server_windows.cpp | 28 ++++++++ platform/windows/joypad_windows.cpp | 1 + platform/windows/os_windows.cpp | 2 + scene/2d/animated_sprite_2d.cpp | 11 ++++ scene/2d/area_2d.cpp | 6 ++ scene/2d/audio_stream_player_2d.cpp | 6 ++ scene/2d/back_buffer_copy.cpp | 2 + scene/2d/camera_2d.cpp | 1 + scene/2d/canvas_modulate.cpp | 1 + scene/2d/collision_object_2d.cpp | 4 ++ scene/2d/collision_polygon_2d.cpp | 1 + scene/2d/cpu_particles_2d.cpp | 18 ++++++ scene/2d/gpu_particles_2d.cpp | 14 ++++ scene/2d/joints_2d.cpp | 1 + scene/2d/light_2d.cpp | 6 ++ scene/2d/navigation_region_2d.cpp | 3 + scene/2d/node_2d.cpp | 1 + scene/2d/physics_body_2d.cpp | 21 ++++++ scene/2d/polygon_2d.cpp | 16 +++++ scene/2d/ray_cast_2d.cpp | 3 + scene/2d/skeleton_2d.cpp | 3 + scene/2d/sprite_2d.cpp | 5 ++ scene/2d/tile_map.cpp | 4 ++ scene/2d/visibility_notifier_2d.cpp | 1 + scene/3d/area_3d.cpp | 15 +++++ scene/3d/audio_stream_player_3d.cpp | 10 +++ scene/3d/baked_lightmap.cpp | 10 +++ scene/3d/camera_3d.cpp | 7 ++ scene/3d/collision_object_3d.cpp | 4 ++ scene/3d/collision_polygon_3d.cpp | 1 + scene/3d/cpu_particles_3d.cpp | 21 ++++++ scene/3d/decal.cpp | 11 ++++ scene/3d/gi_probe.cpp | 6 ++ scene/3d/gpu_particles_3d.cpp | 16 +++++ scene/3d/immediate_geometry_3d.cpp | 1 + scene/3d/light_3d.cpp | 5 ++ scene/3d/listener_3d.cpp | 1 + scene/3d/mesh_instance_3d.cpp | 1 + scene/3d/node_3d.cpp | 3 + scene/3d/physics_body_3d.cpp | 22 +++++++ scene/3d/physics_joint_3d.cpp | 12 ++++ scene/3d/ray_cast_3d.cpp | 3 + scene/3d/reflection_probe.cpp | 7 ++ scene/3d/skeleton_3d.cpp | 8 +++ scene/3d/soft_body_3d.cpp | 1 + scene/3d/sprite_3d.cpp | 11 ++++ scene/3d/vehicle_body_3d.cpp | 11 ++++ scene/3d/velocity_tracker_3d.cpp | 2 + scene/3d/visibility_notifier_3d.cpp | 1 + scene/3d/visual_instance_3d.cpp | 2 + scene/3d/voxelizer.cpp | 4 ++ scene/animation/animation_blend_space_1d.cpp | 1 + scene/animation/animation_blend_space_2d.cpp | 12 ++++ scene/animation/animation_blend_tree.cpp | 25 ++++++++ scene/animation/animation_node_state_machine.cpp | 12 ++++ scene/animation/animation_player.cpp | 5 ++ scene/animation/animation_tree.cpp | 4 ++ scene/animation/root_motion_view.cpp | 1 + scene/audio/audio_stream_player.cpp | 5 ++ scene/debugger/scene_debugger.cpp | 11 ++++ scene/gui/button.cpp | 1 + scene/gui/color_picker.cpp | 1 + scene/gui/control.cpp | 17 +++++ scene/gui/dialogs.cpp | 3 + scene/gui/file_dialog.cpp | 6 ++ scene/gui/graph_edit.cpp | 2 + scene/gui/graph_node.cpp | 5 ++ scene/gui/item_list.cpp | 9 +++ scene/gui/label.cpp | 2 + scene/gui/line_edit.cpp | 2 + scene/gui/nine_patch_rect.cpp | 1 + scene/gui/option_button.cpp | 5 ++ scene/gui/panel.cpp | 1 + scene/gui/popup.cpp | 2 + scene/gui/popup_menu.cpp | 3 + scene/gui/range.cpp | 9 +++ scene/gui/rich_text_label.cpp | 1 + scene/gui/scroll_container.cpp | 2 + scene/gui/tab_container.cpp | 2 + scene/gui/tabs.cpp | 3 + scene/gui/text_edit.cpp | 7 ++ scene/gui/texture_button.cpp | 7 ++ scene/gui/tree.cpp | 11 ++++ scene/main/canvas_item.cpp | 8 +++ scene/main/http_request.cpp | 1 + scene/main/node.cpp | 5 ++ scene/main/resource_preloader.cpp | 2 + scene/main/scene_tree.cpp | 6 ++ scene/main/shader_globals_override.cpp | 1 + scene/main/timer.cpp | 3 + scene/main/viewport.cpp | 20 ++++++ scene/main/window.cpp | 29 +++++++++ scene/resources/animation.cpp | 17 +++++ scene/resources/audio_stream_sample.cpp | 8 +++ scene/resources/bit_map.cpp | 1 + scene/resources/curve.cpp | 12 ++++ scene/resources/dynamic_font.cpp | 5 ++ scene/resources/environment.cpp | 58 +++++++++++++++++ scene/resources/font.cpp | 3 + scene/resources/line_shape_2d.cpp | 2 + scene/resources/material.cpp | 26 ++++++++ scene/resources/mesh.cpp | 6 ++ scene/resources/mesh_data_tool.cpp | 17 +++++ scene/resources/mesh_library.cpp | 2 + scene/resources/multimesh.cpp | 5 ++ scene/resources/navigation_mesh.cpp | 3 + scene/resources/packed_scene.cpp | 12 ++++ scene/resources/particles_material.cpp | 7 ++ scene/resources/primitive_meshes.cpp | 1 + scene/resources/resource_format_text.cpp | 3 + scene/resources/segment_shape_2d.cpp | 3 + scene/resources/shader.cpp | 2 + scene/resources/shape_2d.cpp | 1 + scene/resources/skin.cpp | 1 + scene/resources/sky_material.cpp | 20 ++++++ scene/resources/style_box.cpp | 27 ++++++++ scene/resources/surface_tool.cpp | 5 ++ scene/resources/texture.cpp | 49 ++++++++++++++ scene/resources/theme.cpp | 4 ++ scene/resources/visual_shader.cpp | 10 +++ scene/resources/world_2d.cpp | 3 + scene/resources/world_3d.cpp | 1 + servers/audio/audio_filter_sw.cpp | 2 + servers/audio/audio_stream.cpp | 2 + servers/audio/effects/audio_effect_chorus.cpp | 8 +++ servers/audio/effects/audio_effect_compressor.cpp | 5 ++ servers/audio/effects/audio_effect_delay.cpp | 12 ++++ servers/audio/effects/audio_effect_distortion.cpp | 4 ++ servers/audio/effects/audio_effect_eq.cpp | 1 + servers/audio/effects/audio_effect_filter.cpp | 2 + servers/audio/effects/audio_effect_limiter.cpp | 3 + servers/audio/effects/audio_effect_phaser.cpp | 3 + servers/audio/effects/audio_effect_pitch_shift.cpp | 2 + servers/audio/effects/audio_effect_reverb.cpp | 12 ++++ .../effects/audio_effect_spectrum_analyzer.cpp | 1 + .../audio/effects/audio_effect_stereo_enhance.cpp | 2 + servers/audio/effects/audio_stream_generator.cpp | 6 ++ servers/audio/effects/eq.cpp | 2 + servers/audio/effects/reverb.cpp | 3 + servers/audio_server.cpp | 10 +++ servers/display_server.cpp | 28 ++++++++ servers/navigation_server_2d.cpp | 11 ++++ servers/physics_2d/area_2d_sw.cpp | 1 + servers/physics_2d/area_2d_sw.h | 2 + servers/physics_2d/body_2d_sw.cpp | 2 + servers/physics_2d/broad_phase_2d_basic.cpp | 6 ++ servers/physics_2d/broad_phase_2d_hash_grid.cpp | 5 ++ servers/physics_2d/physics_server_2d_sw.cpp | 14 ++++ servers/physics_2d/shape_2d_sw.cpp | 1 + servers/physics_2d/space_2d_sw.cpp | 4 ++ servers/physics_3d/area_3d_sw.cpp | 1 + servers/physics_3d/area_3d_sw.h | 2 + servers/physics_3d/body_3d_sw.cpp | 3 + servers/physics_3d/broad_phase_3d_basic.cpp | 6 ++ servers/physics_3d/broad_phase_octree.cpp | 4 ++ servers/physics_3d/collision_object_3d_sw.cpp | 1 + servers/physics_3d/gjk_epa.cpp | 2 + .../physics_3d/joints/generic_6dof_joint_3d_sw.cpp | 1 + servers/physics_3d/joints/hinge_joint_3d_sw.cpp | 3 + servers/physics_3d/physics_server_3d_sw.cpp | 14 ++++ servers/physics_3d/shape_3d_sw.cpp | 3 + servers/physics_3d/space_3d_sw.cpp | 5 ++ servers/physics_server_2d.cpp | 14 ++++ servers/physics_server_3d.cpp | 8 +++ servers/rendering/rasterizer.cpp | 1 + .../rasterizer_rd/light_cluster_builder.cpp | 2 + .../rasterizer_rd/rasterizer_canvas_rd.cpp | 7 ++ .../rasterizer_rd/rasterizer_scene_high_end_rd.cpp | 1 + .../rasterizer_rd/rasterizer_scene_rd.cpp | 19 ++++++ .../rasterizer_rd/rasterizer_storage_rd.cpp | 74 ++++++++++++++++++++++ .../rendering/rasterizer_rd/shader_compiler_rd.cpp | 1 + .../rendering/rasterizer_rd/shaders/bokeh_dof.glsl | 1 + .../rasterizer_rd/shaders/canvas_occlusion.glsl | 1 + .../rasterizer_rd/shaders/canvas_uniforms_inc.glsl | 5 ++ servers/rendering/rasterizer_rd/shaders/copy.glsl | 1 + .../rasterizer_rd/shaders/copy_to_fb.glsl | 1 + .../rasterizer_rd/shaders/cube_to_dp.glsl | 1 + .../rasterizer_rd/shaders/cubemap_downsampler.glsl | 6 ++ .../rasterizer_rd/shaders/cubemap_filter.glsl | 2 + .../rasterizer_rd/shaders/cubemap_roughness.glsl | 1 + .../rendering/rasterizer_rd/shaders/giprobe.glsl | 6 ++ .../rasterizer_rd/shaders/giprobe_debug.glsl | 2 + .../rasterizer_rd/shaders/giprobe_sdf.glsl | 4 ++ .../rasterizer_rd/shaders/giprobe_write.glsl | 5 ++ .../rasterizer_rd/shaders/luminance_reduce.glsl | 1 + .../rasterizer_rd/shaders/roughness_limiter.glsl | 1 + .../rasterizer_rd/shaders/scene_high_end_inc.glsl | 13 ++++ .../shaders/screen_space_reflection.glsl | 1 + .../shaders/screen_space_reflection_filter.glsl | 1 + .../shaders/screen_space_reflection_scale.glsl | 1 + servers/rendering/rasterizer_rd/shaders/sky.glsl | 4 ++ servers/rendering/rasterizer_rd/shaders/ssao.glsl | 1 + .../rendering/rasterizer_rd/shaders/ssao_blur.glsl | 1 + .../rasterizer_rd/shaders/ssao_minify.glsl | 1 + .../shaders/subsurface_scattering.glsl | 1 + .../rendering/rasterizer_rd/shaders/tonemap.glsl | 1 + servers/rendering/rendering_device.cpp | 1 + servers/rendering/rendering_server_canvas.cpp | 35 ++++++++++ servers/rendering/rendering_server_raster.cpp | 6 ++ servers/rendering/rendering_server_scene.cpp | 12 ++++ servers/rendering/rendering_server_viewport.cpp | 7 ++ servers/rendering/shader_language.cpp | 1 + 409 files changed, 2286 insertions(+) mode change 100755 => 100644 modules/mono/mono_gd/support/android_support.cpp mode change 100755 => 100644 modules/mono/mono_gd/support/ios_support.mm diff --git a/core/array.cpp b/core/array.cpp index 75efe8f8ff..1a8a833404 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -83,9 +83,11 @@ const Variant &Array::operator[](int p_idx) const { int Array::size() const { return _p->array.size(); } + bool Array::empty() const { return _p->array.empty(); } + void Array::clear() { _p->array.clear(); } @@ -151,6 +153,7 @@ void Array::_assign(const Array &p_array) { void Array::operator=(const Array &p_array) { _assign(p_array); } + void Array::push_back(const Variant &p_value) { ERR_FAIL_COND(!_p->typed.validate(p_value, "push_back")); _p->array.push_back(p_value); @@ -509,6 +512,7 @@ Array::Array() { _p = memnew(ArrayPrivate); _p->refcount.init(); } + Array::~Array() { _unref(); } diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index a5809d6678..7c7ef4e03c 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -69,6 +69,7 @@ _ResourceLoader *_ResourceLoader::singleton = nullptr; Error _ResourceLoader::load_threaded_request(const String &p_path, const String &p_type_hint, bool p_use_sub_threads) { return ResourceLoader::load_threaded_request(p_path, p_type_hint, p_use_sub_threads); } + _ResourceLoader::ThreadLoadStatus _ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) { float progress = 0; ResourceLoader::ThreadLoadStatus tls = ResourceLoader::load_threaded_get_status(p_path, &progress); @@ -76,6 +77,7 @@ _ResourceLoader::ThreadLoadStatus _ResourceLoader::load_threaded_get_status(cons r_progress[0] = progress; return (ThreadLoadStatus)tls; } + RES _ResourceLoader::load_threaded_get(const String &p_path) { Error error; RES res = ResourceLoader::load_threaded_get(p_path, &error); @@ -198,6 +200,7 @@ void _OS::set_use_file_access_save_and_swap(bool p_enable) { void _OS::set_low_processor_usage_mode(bool p_enabled) { OS::get_singleton()->set_low_processor_usage_mode(p_enabled); } + bool _OS::is_in_low_processor_usage_mode() const { return OS::get_singleton()->is_in_low_processor_usage_mode(); } @@ -252,6 +255,7 @@ int _OS::get_process_id() const { bool _OS::has_environment(const String &p_var) const { return OS::get_singleton()->has_environment(p_var); } + String _OS::get_environment(const String &p_var) const { return OS::get_singleton()->get_environment(p_var); } @@ -259,6 +263,7 @@ String _OS::get_environment(const String &p_var) const { String _OS::get_name() const { return OS::get_singleton()->get_name(); } + Vector _OS::get_cmdline_args() { List cmdline = OS::get_singleton()->get_cmdline_args(); Vector cmdlinev; @@ -811,6 +816,7 @@ Vector _Geometry::build_box_planes(const Vector3 &p_extents) { Vector _Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) { return Geometry::build_cylinder_planes(p_radius, p_height, p_sides, p_axis); } + Vector _Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { return Geometry::build_capsule_planes(p_radius, p_height, p_sides, p_lats, p_axis); } @@ -860,22 +866,27 @@ Vector _Geometry::get_closest_points_between_segments(const Vector3 &p1 r.set(1, r2); return r; } + Vector2 _Geometry::get_closest_point_to_segment_2d(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) { Vector2 s[2] = { p_a, p_b }; return Geometry::get_closest_point_to_segment_2d(p_point, s); } + Vector3 _Geometry::get_closest_point_to_segment(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) { Vector3 s[2] = { p_a, p_b }; return Geometry::get_closest_point_to_segment(p_point, s); } + Vector2 _Geometry::get_closest_point_to_segment_uncapped_2d(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) { Vector2 s[2] = { p_a, p_b }; return Geometry::get_closest_point_to_segment_uncapped_2d(p_point, s); } + Vector3 _Geometry::get_closest_point_to_segment_uncapped(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) { Vector3 s[2] = { p_a, p_b }; return Geometry::get_closest_point_to_segment_uncapped(p_point, s); } + Variant _Geometry::ray_intersects_triangle(const Vector3 &p_from, const Vector3 &p_dir, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2) { Vector3 res; if (Geometry::ray_intersects_triangle(p_from, p_dir, p_v0, p_v1, p_v2, &res)) @@ -883,6 +894,7 @@ Variant _Geometry::ray_intersects_triangle(const Vector3 &p_from, const Vector3 else return Variant(); } + Variant _Geometry::segment_intersects_triangle(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2) { Vector3 res; if (Geometry::segment_intersects_triangle(p_from, p_to, p_v0, p_v1, p_v2, &res)) @@ -906,6 +918,7 @@ Vector _Geometry::segment_intersects_sphere(const Vector3 &p_from, cons r.set(1, norm); return r; } + Vector _Geometry::segment_intersects_cylinder(const Vector3 &p_from, const Vector3 &p_to, float p_height, float p_radius) { Vector r; Vector3 res, norm; @@ -917,6 +930,7 @@ Vector _Geometry::segment_intersects_cylinder(const Vector3 &p_from, co r.set(1, norm); return r; } + Vector _Geometry::segment_intersects_convex(const Vector3 &p_from, const Vector3 &p_to, const Vector &p_planes) { Vector r; Vector3 res, norm; @@ -1198,9 +1212,11 @@ void _File::close() { memdelete(f); f = nullptr; } + bool _File::is_open() const { return f != nullptr; } + String _File::get_path() const { ERR_FAIL_COND_V_MSG(!f, "", "File must be opened before use."); return f->get_path(); @@ -1215,10 +1231,12 @@ void _File::seek(int64_t p_position) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); f->seek(p_position); } + void _File::seek_end(int64_t p_position) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); f->seek_end(p_position); } + int64_t _File::get_position() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_position(); @@ -1238,14 +1256,17 @@ uint8_t _File::get_8() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_8(); } + uint16_t _File::get_16() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_16(); } + uint32_t _File::get_32() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_32(); } + uint64_t _File::get_64() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_64(); @@ -1255,10 +1276,12 @@ float _File::get_float() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_float(); } + double _File::get_double() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_double(); } + real_t _File::get_real() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); return f->get_real(); @@ -1332,6 +1355,7 @@ void _File::set_endian_swap(bool p_swap) { if (f) f->set_endian_swap(p_swap); } + bool _File::get_endian_swap() { return eswap; } @@ -1347,16 +1371,19 @@ void _File::store_8(uint8_t p_dest) { f->store_8(p_dest); } + void _File::store_16(uint16_t p_dest) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); f->store_16(p_dest); } + void _File::store_32(uint32_t p_dest) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); f->store_32(p_dest); } + void _File::store_64(uint64_t p_dest) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); @@ -1368,11 +1395,13 @@ void _File::store_float(float p_dest) { f->store_float(p_dest); } + void _File::store_double(double p_dest) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); f->store_double(p_dest); } + void _File::store_real(real_t p_real) { ERR_FAIL_COND_MSG(!f, "File must be opened before use."); @@ -1562,6 +1591,7 @@ String _Directory::get_next() { } return next; } + bool _Directory::current_is_dir() const { ERR_FAIL_COND_V_MSG(!d, false, "Directory must be opened before use."); return d->current_is_dir(); @@ -1576,10 +1606,12 @@ int _Directory::get_drive_count() { ERR_FAIL_COND_V_MSG(!d, 0, "Directory must be opened before use."); return d->get_drive_count(); } + String _Directory::get_drive(int p_drive) { ERR_FAIL_COND_V_MSG(!d, "", "Directory must be opened before use."); return d->get_drive(p_drive); } + int _Directory::get_current_drive() { ERR_FAIL_COND_V_MSG(!d, 0, "Directory must be opened before use."); return d->get_current_drive(); @@ -1589,10 +1621,12 @@ Error _Directory::change_dir(String p_dir) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); return d->change_dir(p_dir); } + String _Directory::get_current_dir() { ERR_FAIL_COND_V_MSG(!d, "", "Directory must be opened before use."); return d->get_current_dir(); } + Error _Directory::make_dir(String p_dir) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); if (!p_dir.is_rel_path()) { @@ -1603,6 +1637,7 @@ Error _Directory::make_dir(String p_dir) { } return d->make_dir(p_dir); } + Error _Directory::make_dir_recursive(String p_dir) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); if (!p_dir.is_rel_path()) { @@ -1646,6 +1681,7 @@ Error _Directory::copy(String p_from, String p_to) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); return d->copy(p_from, p_to); } + Error _Directory::rename(String p_from, String p_to) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); if (!p_from.is_rel_path()) { @@ -1657,6 +1693,7 @@ Error _Directory::rename(String p_from, String p_to) { return d->rename(p_from, p_to); } + Error _Directory::remove(String p_name) { ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use."); if (!p_name.is_rel_path()) { @@ -1915,6 +1952,7 @@ String _Thread::get_id() const { bool _Thread::is_active() const { return active; } + Variant _Thread::wait_to_finish() { ERR_FAIL_COND_V_MSG(!thread, Variant(), "Thread must exist to wait for its completion."); ERR_FAIL_COND_V_MSG(!active, Variant(), "Thread must be active to wait for its completion."); @@ -1961,6 +1999,7 @@ PackedStringArray _ClassDB::get_class_list() const { return ret; } + PackedStringArray _ClassDB::get_inheriters_from_class(const StringName &p_class) const { List classes; ClassDB::get_inheriters_from_class(p_class, &classes); @@ -1974,18 +2013,23 @@ PackedStringArray _ClassDB::get_inheriters_from_class(const StringName &p_class) return ret; } + StringName _ClassDB::get_parent_class(const StringName &p_class) const { return ClassDB::get_parent_class(p_class); } + bool _ClassDB::class_exists(const StringName &p_class) const { return ClassDB::class_exists(p_class); } + bool _ClassDB::is_parent_class(const StringName &p_class, const StringName &p_inherits) const { return ClassDB::is_parent_class(p_class, p_inherits); } + bool _ClassDB::can_instance(const StringName &p_class) const { return ClassDB::can_instance(p_class); } + Variant _ClassDB::instance(const StringName &p_class) const { Object *obj = ClassDB::instance(p_class); if (!obj) @@ -2002,6 +2046,7 @@ Variant _ClassDB::instance(const StringName &p_class) const { bool _ClassDB::has_signal(StringName p_class, StringName p_signal) const { return ClassDB::has_signal(p_class, p_signal); } + Dictionary _ClassDB::get_signal(StringName p_class, StringName p_signal) const { MethodInfo signal; if (ClassDB::get_signal(p_class, p_signal, &signal)) { @@ -2010,6 +2055,7 @@ Dictionary _ClassDB::get_signal(StringName p_class, StringName p_signal) const { return Dictionary(); } } + Array _ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const { List signals; ClassDB::get_signal_list(p_class, &signals, p_no_inheritance); @@ -2098,6 +2144,7 @@ int _ClassDB::get_integer_constant(const StringName &p_class, const StringName & ERR_FAIL_COND_V(!found, 0); return c; } + StringName _ClassDB::get_category(const StringName &p_node) const { return ClassDB::get_category(p_node); } @@ -2141,6 +2188,7 @@ void _ClassDB::_bind_methods() { void _Engine::set_iterations_per_second(int p_ips) { Engine::get_singleton()->set_iterations_per_second(p_ips); } + int _Engine::get_iterations_per_second() const { return Engine::get_singleton()->get_iterations_per_second(); } diff --git a/core/callable.cpp b/core/callable.cpp index dc2d034cc6..b7bdc715f8 100644 --- a/core/callable.cpp +++ b/core/callable.cpp @@ -72,6 +72,7 @@ ObjectID Callable::get_object_id() const { return ObjectID(object); } } + StringName Callable::get_method() const { ERR_FAIL_COND_V_MSG(is_custom(), StringName(), vformat("Can't get method on CallableCustom \"%s\".", operator String())); @@ -117,9 +118,11 @@ bool Callable::operator==(const Callable &p_callable) const { return false; } } + bool Callable::operator!=(const Callable &p_callable) const { return !(*this == p_callable); } + bool Callable::operator<(const Callable &p_callable) const { bool custom_a = is_custom(); bool custom_b = p_callable.is_custom(); @@ -222,6 +225,7 @@ Callable::Callable(ObjectID p_object, const StringName &p_method) { object = p_object; method = p_method; } + Callable::Callable(CallableCustom *p_custom) { if (p_custom->referenced) { object = 0; @@ -231,6 +235,7 @@ Callable::Callable(CallableCustom *p_custom) { object = 0; //ensure object is all zero, since pointer may be 32 bits custom = p_custom; } + Callable::Callable(const Callable &p_callable) { if (p_callable.is_custom()) { if (!p_callable.custom->ref_count.ref()) { @@ -262,9 +267,11 @@ CallableCustom::CallableCustom() { Object *Signal::get_object() const { return ObjectDB::get_instance(object); } + ObjectID Signal::get_object_id() const { return object; } + StringName Signal::get_name() const { return name; } @@ -307,17 +314,20 @@ Error Signal::emit(const Variant **p_arguments, int p_argcount) const { return obj->emit_signal(name, p_arguments, p_argcount); } + Error Signal::connect(const Callable &p_callable, const Vector &p_binds, uint32_t p_flags) { Object *object = get_object(); ERR_FAIL_COND_V(!object, ERR_UNCONFIGURED); return object->connect(name, p_callable, p_binds, p_flags); } + void Signal::disconnect(const Callable &p_callable) { Object *object = get_object(); ERR_FAIL_COND(!object); object->disconnect(name, p_callable); } + bool Signal::is_connected(const Callable &p_callable) const { Object *object = get_object(); ERR_FAIL_COND_V(!object, false); diff --git a/core/class_db.cpp b/core/class_db.cpp index 79e145248c..0a187416f4 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -255,6 +255,7 @@ bool ClassDB::is_parent_class(const StringName &p_class, const StringName &p_inh return false; } + void ClassDB::get_class_list(List *p_classes) { OBJTYPE_RLOCK; @@ -505,6 +506,7 @@ Object *ClassDB::instance(const StringName &p_class) { #endif return ti->creation_func(); } + bool ClassDB::can_instance(const StringName &p_class) { OBJTYPE_RLOCK; @@ -934,6 +936,7 @@ void ClassDB::get_property_list(StringName p_class, List *p_list, check = check->inherits_ptr; } } + bool ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid) { ClassInfo *type = classes.getptr(p_object->get_class_name()); ClassInfo *check = type; @@ -978,6 +981,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const return false; } + bool ClassDB::get_property(Object *p_object, const StringName &p_property, Variant &r_value) { ClassInfo *type = classes.getptr(p_object->get_class_name()); ClassInfo *check = type; diff --git a/core/color.cpp b/core/color.cpp index 328b2e3568..4bee14f3ba 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -213,6 +213,7 @@ void Color::invert() { g = 1.0 - g; b = 1.0 - b; } + void Color::contrast() { r = Math::fmod(r + 0.5, 1.0); g = Math::fmod(g + 0.5, 1.0); diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index 89e738e596..dd46e23505 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -269,6 +269,7 @@ void PHashTranslation::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "strings")); p_list->push_back(PropertyInfo(Variant::OBJECT, "load_from", PROPERTY_HINT_RESOURCE_TYPE, "Translation", PROPERTY_USAGE_EDITOR)); } + void PHashTranslation::_bind_methods() { ClassDB::bind_method(D_METHOD("generate", "from"), &PHashTranslation::generate); } diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp index 60db329e64..ed27d2ebc3 100644 --- a/core/crypto/crypto.cpp +++ b/core/crypto/crypto.cpp @@ -154,6 +154,7 @@ void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource, p_extensions->push_back("key"); } } + bool ResourceFormatSaverCrypto::recognize(const RES &p_resource) const { return Object::cast_to(*p_resource) || Object::cast_to(*p_resource); } diff --git a/core/debugger/script_debugger.cpp b/core/debugger/script_debugger.cpp index 9dd669f816..179745b11e 100644 --- a/core/debugger/script_debugger.cpp +++ b/core/debugger/script_debugger.cpp @@ -62,11 +62,13 @@ void ScriptDebugger::remove_breakpoint(int p_line, const StringName &p_source) { if (breakpoints[p_line].size() == 0) breakpoints.erase(p_line); } + bool ScriptDebugger::is_breakpoint(int p_line, const StringName &p_source) const { if (!breakpoints.has(p_line)) return false; return breakpoints[p_line].has(p_source); } + bool ScriptDebugger::is_breakpoint_line(int p_line) const { return breakpoints.has(p_line); } diff --git a/core/dictionary.cpp b/core/dictionary.cpp index bc8e795da7..0ef26cfc62 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -79,6 +79,7 @@ Variant &Dictionary::operator[](const Variant &p_key) { const Variant &Dictionary::operator[](const Variant &p_key) const { return _p->variant_map[p_key]; } + const Variant *Dictionary::getptr(const Variant &p_key) const { OrderedHashMap::ConstElement E = ((const OrderedHashMap *)&_p->variant_map)->find(p_key); @@ -115,6 +116,7 @@ Variant Dictionary::get(const Variant &p_key, const Variant &p_default) const { int Dictionary::size() const { return _p->variant_map.size(); } + bool Dictionary::empty() const { return !_p->variant_map.size(); } @@ -170,6 +172,7 @@ void Dictionary::_unref() const { } _p = nullptr; } + uint32_t Dictionary::hash() const { uint32_t h = hash_djb2_one_32(Variant::DICTIONARY); @@ -254,6 +257,7 @@ Dictionary::Dictionary() { _p = memnew(DictionaryPrivate); _p->refcount.init(); } + Dictionary::~Dictionary() { _unref(); } diff --git a/core/engine.cpp b/core/engine.cpp index bd86535a70..25eac27921 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -40,6 +40,7 @@ void Engine::set_iterations_per_second(int p_ips) { ERR_FAIL_COND_MSG(p_ips <= 0, "Engine iterations per second must be greater than 0."); ips = p_ips; } + int Engine::get_iterations_per_second() const { return ips; } diff --git a/core/image.cpp b/core/image.cpp index 4cbecbf44f..3fff93ed91 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -2283,6 +2283,7 @@ Error Image::decompress() { Error Image::compress(CompressMode p_mode, CompressSource p_source, float p_lossy_quality) { return compress_from_channels(p_mode, detect_used_channels(p_source), p_lossy_quality); } + Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels, float p_lossy_quality) { switch (p_mode) { case COMPRESS_S3TC: { @@ -3359,6 +3360,7 @@ void Image::convert_rg_to_ra_rgba8() { w[i + 2] = 0; } } + void Image::convert_ra_rgba8_to_rg() { ERR_FAIL_COND(format != FORMAT_RGBA8); ERR_FAIL_COND(!data.size()); diff --git a/core/input/input.cpp b/core/input/input.cpp index a9921f791a..e81dfcf30f 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -672,6 +672,7 @@ void Input::set_mouse_position(const Point2 &p_posf) { Point2 Input::get_mouse_position() const { return mouse_pos; } + Point2 Input::get_last_mouse_speed() const { return mouse_speed_track.speed; } @@ -812,6 +813,7 @@ void Input::accumulate_input_event(const Ref &p_event) { accumulated_events.push_back(p_event); } + void Input::flush_accumulated_events() { while (accumulated_events.front()) { parse_input_event(accumulated_events.front()->get()); diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 094ed0bc56..497ce79038 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -131,6 +131,7 @@ void InputEventFromWindow::_bind_methods() { void InputEventFromWindow::set_window_id(int64_t p_id) { window_id = p_id; } + int64_t InputEventFromWindow::get_window_id() const { return window_id; } @@ -148,6 +149,7 @@ bool InputEventWithModifiers::get_shift() const { void InputEventWithModifiers::set_alt(bool p_enabled) { alt = p_enabled; } + bool InputEventWithModifiers::get_alt() const { return alt; } @@ -155,6 +157,7 @@ bool InputEventWithModifiers::get_alt() const { void InputEventWithModifiers::set_control(bool p_enabled) { control = p_enabled; } + bool InputEventWithModifiers::get_control() const { return control; } @@ -162,6 +165,7 @@ bool InputEventWithModifiers::get_control() const { void InputEventWithModifiers::set_metakey(bool p_enabled) { meta = p_enabled; } + bool InputEventWithModifiers::get_metakey() const { return meta; } @@ -169,6 +173,7 @@ bool InputEventWithModifiers::get_metakey() const { void InputEventWithModifiers::set_command(bool p_enabled) { command = p_enabled; } + bool InputEventWithModifiers::get_command() const { return command; } @@ -359,6 +364,7 @@ void InputEventKey::_bind_methods() { void InputEventMouse::set_button_mask(int p_mask) { button_mask = p_mask; } + int InputEventMouse::get_button_mask() const { return button_mask; } @@ -366,6 +372,7 @@ int InputEventMouse::get_button_mask() const { void InputEventMouse::set_position(const Vector2 &p_pos) { pos = p_pos; } + Vector2 InputEventMouse::get_position() const { return pos; } @@ -373,6 +380,7 @@ Vector2 InputEventMouse::get_position() const { void InputEventMouse::set_global_position(const Vector2 &p_global_pos) { global_pos = p_global_pos; } + Vector2 InputEventMouse::get_global_position() const { return global_pos; } @@ -405,6 +413,7 @@ float InputEventMouseButton::get_factor() const { void InputEventMouseButton::set_button_index(int p_index) { button_index = p_index; } + int InputEventMouseButton::get_button_index() const { return button_index; } @@ -412,6 +421,7 @@ int InputEventMouseButton::get_button_index() const { void InputEventMouseButton::set_pressed(bool p_pressed) { pressed = p_pressed; } + bool InputEventMouseButton::is_pressed() const { return pressed; } @@ -419,6 +429,7 @@ bool InputEventMouseButton::is_pressed() const { void InputEventMouseButton::set_doubleclick(bool p_doubleclick) { doubleclick = p_doubleclick; } + bool InputEventMouseButton::is_doubleclick() const { return doubleclick; } @@ -739,6 +750,7 @@ int InputEventJoypadButton::get_button_index() const { void InputEventJoypadButton::set_pressed(bool p_pressed) { pressed = p_pressed; } + bool InputEventJoypadButton::is_pressed() const { return pressed; } @@ -746,6 +758,7 @@ bool InputEventJoypadButton::is_pressed() const { void InputEventJoypadButton::set_pressure(float p_pressure) { pressure = p_pressure; } + float InputEventJoypadButton::get_pressure() const { return pressure; } @@ -798,6 +811,7 @@ void InputEventJoypadButton::_bind_methods() { void InputEventScreenTouch::set_index(int p_index) { index = p_index; } + int InputEventScreenTouch::get_index() const { return index; } @@ -805,6 +819,7 @@ int InputEventScreenTouch::get_index() const { void InputEventScreenTouch::set_position(const Vector2 &p_pos) { pos = p_pos; } + Vector2 InputEventScreenTouch::get_position() const { return pos; } @@ -812,6 +827,7 @@ Vector2 InputEventScreenTouch::get_position() const { void InputEventScreenTouch::set_pressed(bool p_pressed) { pressed = p_pressed; } + bool InputEventScreenTouch::is_pressed() const { return pressed; } @@ -860,6 +876,7 @@ int InputEventScreenDrag::get_index() const { void InputEventScreenDrag::set_position(const Vector2 &p_pos) { pos = p_pos; } + Vector2 InputEventScreenDrag::get_position() const { return pos; } @@ -867,6 +884,7 @@ Vector2 InputEventScreenDrag::get_position() const { void InputEventScreenDrag::set_relative(const Vector2 &p_relative) { relative = p_relative; } + Vector2 InputEventScreenDrag::get_relative() const { return relative; } @@ -874,6 +892,7 @@ Vector2 InputEventScreenDrag::get_relative() const { void InputEventScreenDrag::set_speed(const Vector2 &p_speed) { speed = p_speed; } + Vector2 InputEventScreenDrag::get_speed() const { return speed; } @@ -922,6 +941,7 @@ void InputEventScreenDrag::_bind_methods() { void InputEventAction::set_action(const StringName &p_action) { action = p_action; } + StringName InputEventAction::get_action() const { return action; } @@ -929,6 +949,7 @@ StringName InputEventAction::get_action() const { void InputEventAction::set_pressed(bool p_pressed) { pressed = p_pressed; } + bool InputEventAction::is_pressed() const { return pressed; } diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 902d3cde9f..334c8f143e 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -78,6 +78,7 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V values[p_section][p_key] = p_value; } } + Variant ConfigFile::get_value(const String &p_section, const String &p_key, Variant p_default) const { if (!values.has(p_section) || !values[p_section].has(p_key)) { ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, Variant(), @@ -91,6 +92,7 @@ Variant ConfigFile::get_value(const String &p_section, const String &p_key, Vari bool ConfigFile::has_section(const String &p_section) const { return values.has(p_section); } + bool ConfigFile::has_section_key(const String &p_section, const String &p_key) const { if (!values.has(p_section)) return false; @@ -102,6 +104,7 @@ void ConfigFile::get_sections(List *r_sections) const { r_sections->push_back(E.key()); } } + void ConfigFile::get_section_keys(const String &p_section, List *r_keys) const { ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot get keys from nonexistent section \"%s\".", p_section)); diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index cbb9786af4..422100010c 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -132,6 +132,7 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) { return OK; } + void FileAccessCompressed::close() { if (!f) return; @@ -221,6 +222,7 @@ void FileAccessCompressed::seek_end(int64_t p_position) { seek(read_total + p_position); } } + size_t FileAccessCompressed::get_position() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); if (writing) { @@ -229,6 +231,7 @@ size_t FileAccessCompressed::get_position() const { return read_block * block_size + read_pos; } } + size_t FileAccessCompressed::get_len() const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); if (writing) { @@ -277,6 +280,7 @@ uint8_t FileAccessCompressed::get_8() const { return ret; } + int FileAccessCompressed::get_buffer(uint8_t *p_dst, int p_length) const { ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use."); ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode."); diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index aaf21ad143..ceda6c5eb2 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -113,6 +113,7 @@ Error FileAccessEncrypted::open_and_parse_password(FileAccess *p_base, const Str Error FileAccessEncrypted::_open(const String &p_path, int p_mode_flags) { return OK; } + void FileAccessEncrypted::close() { if (!file) return; @@ -189,9 +190,11 @@ void FileAccessEncrypted::seek(size_t p_position) { void FileAccessEncrypted::seek_end(int64_t p_position) { seek(data.size() + p_position); } + size_t FileAccessEncrypted::get_position() const { return pos; } + size_t FileAccessEncrypted::get_len() const { return data.size(); } @@ -211,6 +214,7 @@ uint8_t FileAccessEncrypted::get_8() const { pos++; return b; } + int FileAccessEncrypted::get_buffer(uint8_t *p_dst, int p_length) const { ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode."); diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 690a2bb269..4b7f99e5b0 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -300,6 +300,7 @@ void FileAccessNetwork::close() { opened = false; nc->unlock_mutex(); } + bool FileAccessNetwork::is_open() const { return opened; } @@ -318,10 +319,12 @@ void FileAccessNetwork::seek(size_t p_position) { void FileAccessNetwork::seek_end(int64_t p_position) { seek(total_size + p_position); } + size_t FileAccessNetwork::get_position() const { ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use."); return pos; } + size_t FileAccessNetwork::get_len() const { ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use."); return total_size; diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 4fd4d117af..bb65a1afbc 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -224,12 +224,15 @@ void FileAccessPack::seek(size_t p_position) { f->seek(pf.offset + p_position); pos = p_position; } + void FileAccessPack::seek_end(int64_t p_position) { seek(pf.size + p_position); } + size_t FileAccessPack::get_position() const { return pos; } + size_t FileAccessPack::get_len() const { return pf.size; } @@ -343,12 +346,15 @@ String DirAccessPack::get_next() { return String(); } } + bool DirAccessPack::current_is_dir() const { return cdir; } + bool DirAccessPack::current_is_hidden() const { return false; } + void DirAccessPack::list_dir_end() { list_dirs.clear(); list_files.clear(); @@ -357,6 +363,7 @@ void DirAccessPack::list_dir_end() { int DirAccessPack::get_drive_count() { return 0; } + String DirAccessPack::get_drive(int p_drive) { return ""; } @@ -440,6 +447,7 @@ Error DirAccessPack::make_dir(String p_dir) { Error DirAccessPack::rename(String p_from, String p_to) { return ERR_UNAVAILABLE; } + Error DirAccessPack::remove(String p_name) { return ERR_UNAVAILABLE; } diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index b819725155..a2f65660f2 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -179,6 +179,7 @@ void _profile_node_data(const String &p_what, ObjectID p_id) { EngineDebugger::profiler_add_frame_data("multiplayer", values); } } + void _profile_bandwidth_data(const String &p_inout, int p_size) { if (EngineDebugger::is_profiling("multiplayer")) { Array values; @@ -668,6 +669,7 @@ Error MultiplayerAPI::_encode_and_compress_variant(const Variant &p_variant, uin return OK; } + Error MultiplayerAPI::_decode_and_decompress_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len) { const uint8_t *buf = p_buffer; int len = p_len; diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 34fb5510b9..fe1c9a2eb1 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -117,6 +117,7 @@ Variant PacketPeer::_bnd_get_var(bool p_allow_objects) { Error PacketPeer::_put_packet(const Vector &p_buffer) { return put_packet_buffer(p_buffer); } + Vector PacketPeer::_get_packet() { Vector raw; last_get_error = get_packet_buffer(raw); diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 0640d56c47..e36de8c228 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -291,6 +291,7 @@ Error PacketPeerUDP::_poll() { return OK; } + bool PacketPeerUDP::is_listening() const { return _sock.is_valid() && _sock->is_open(); } diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 77fe331929..230925c29b 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -607,6 +607,7 @@ void ResourceLoaderBinary::set_local_path(const String &p_local_path) { Ref ResourceLoaderBinary::get_resource() { return resource; } + Error ResourceLoaderBinary::load() { if (error != OK) return error; @@ -996,6 +997,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String p_extensions->push_back(ext); } } + void ResourceFormatLoaderBinary::get_recognized_extensions(List *p_extensions) const { List extensions; ClassDB::get_resource_base_extensions(&extensions); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 361f40cbc6..8490cb5627 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -260,6 +260,7 @@ void ResourceLoader::_thread_load_function(void *p_userdata) { thread_load_mutex->unlock(); } + Error ResourceLoader::load_threaded_request(const String &p_path, const String &p_type_hint, bool p_use_sub_threads, const String &p_source_resource) { String local_path; if (p_path.is_rel_path()) @@ -412,6 +413,7 @@ ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const return status; } + RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) { String local_path; if (p_path.is_rel_path()) diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 2e63adcae9..e6175e78da 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -122,6 +122,7 @@ void StreamPeer::put_u8(uint8_t p_val) { void StreamPeer::put_8(int8_t p_val) { put_data((const uint8_t *)&p_val, 1); } + void StreamPeer::put_u16(uint16_t p_val) { if (big_endian) { p_val = BSWAP16(p_val); @@ -130,6 +131,7 @@ void StreamPeer::put_u16(uint16_t p_val) { encode_uint16(p_val, buf); put_data(buf, 2); } + void StreamPeer::put_16(int16_t p_val) { if (big_endian) { p_val = BSWAP16(p_val); @@ -138,6 +140,7 @@ void StreamPeer::put_16(int16_t p_val) { encode_uint16(p_val, buf); put_data(buf, 2); } + void StreamPeer::put_u32(uint32_t p_val) { if (big_endian) { p_val = BSWAP32(p_val); @@ -146,6 +149,7 @@ void StreamPeer::put_u32(uint32_t p_val) { encode_uint32(p_val, buf); put_data(buf, 4); } + void StreamPeer::put_32(int32_t p_val) { if (big_endian) { p_val = BSWAP32(p_val); @@ -154,6 +158,7 @@ void StreamPeer::put_32(int32_t p_val) { encode_uint32(p_val, buf); put_data(buf, 4); } + void StreamPeer::put_u64(uint64_t p_val) { if (big_endian) { p_val = BSWAP64(p_val); @@ -162,6 +167,7 @@ void StreamPeer::put_u64(uint64_t p_val) { encode_uint64(p_val, buf); put_data(buf, 8); } + void StreamPeer::put_64(int64_t p_val) { if (big_endian) { p_val = BSWAP64(p_val); @@ -170,6 +176,7 @@ void StreamPeer::put_64(int64_t p_val) { encode_uint64(p_val, buf); put_data(buf, 8); } + void StreamPeer::put_float(float p_val) { uint8_t buf[4]; @@ -181,6 +188,7 @@ void StreamPeer::put_float(float p_val) { put_data(buf, 4); } + void StreamPeer::put_double(double p_val) { uint8_t buf[8]; encode_double(p_val, buf); @@ -190,16 +198,19 @@ void StreamPeer::put_double(double p_val) { } put_data(buf, 8); } + void StreamPeer::put_string(const String &p_string) { CharString cs = p_string.ascii(); put_u32(cs.length()); put_data((const uint8_t *)cs.get_data(), cs.length()); } + void StreamPeer::put_utf8_string(const String &p_string) { CharString cs = p_string.utf8(); put_u32(cs.length()); put_data((const uint8_t *)cs.get_data(), cs.length()); } + void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) { int len = 0; Vector buf; @@ -215,11 +226,13 @@ uint8_t StreamPeer::get_u8() { get_data(buf, 1); return buf[0]; } + int8_t StreamPeer::get_8() { uint8_t buf[1]; get_data(buf, 1); return buf[0]; } + uint16_t StreamPeer::get_u16() { uint8_t buf[2]; get_data(buf, 2); @@ -229,6 +242,7 @@ uint16_t StreamPeer::get_u16() { } return r; } + int16_t StreamPeer::get_16() { uint8_t buf[2]; get_data(buf, 2); @@ -238,6 +252,7 @@ int16_t StreamPeer::get_16() { } return r; } + uint32_t StreamPeer::get_u32() { uint8_t buf[4]; get_data(buf, 4); @@ -247,6 +262,7 @@ uint32_t StreamPeer::get_u32() { } return r; } + int32_t StreamPeer::get_32() { uint8_t buf[4]; get_data(buf, 4); @@ -256,6 +272,7 @@ int32_t StreamPeer::get_32() { } return r; } + uint64_t StreamPeer::get_u64() { uint8_t buf[8]; get_data(buf, 8); @@ -265,6 +282,7 @@ uint64_t StreamPeer::get_u64() { } return r; } + int64_t StreamPeer::get_64() { uint8_t buf[8]; get_data(buf, 8); @@ -274,6 +292,7 @@ int64_t StreamPeer::get_64() { } return r; } + float StreamPeer::get_float() { uint8_t buf[4]; get_data(buf, 4); @@ -297,6 +316,7 @@ double StreamPeer::get_double() { return decode_double(buf); } + String StreamPeer::get_string(int p_bytes) { if (p_bytes < 0) p_bytes = get_u32(); @@ -310,6 +330,7 @@ String StreamPeer::get_string(int p_bytes) { buf.write[p_bytes] = 0; return buf.ptr(); } + String StreamPeer::get_utf8_string(int p_bytes) { if (p_bytes < 0) p_bytes = get_u32(); @@ -325,6 +346,7 @@ String StreamPeer::get_utf8_string(int p_bytes) { ret.parse_utf8((const char *)buf.ptr(), buf.size()); return ret; } + Variant StreamPeer::get_var(bool p_allow_objects) { int len = get_32(); Vector var; @@ -382,6 +404,7 @@ void StreamPeer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "big_endian"), "set_big_endian", "is_big_endian_enabled"); } + //////////////////////////////// void StreamPeerBuffer::_bind_methods() { @@ -455,6 +478,7 @@ void StreamPeerBuffer::seek(int p_pos) { ERR_FAIL_COND(p_pos > data.size()); pointer = p_pos; } + int StreamPeerBuffer::get_size() const { return data.size(); } diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index b47e634a5a..5e109699f5 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -190,6 +190,7 @@ void TranslationLoaderPO::get_recognized_extensions(List *p_extensions) p_extensions->push_back("po"); //p_extensions->push_back("mo"); //mo in the future... } + bool TranslationLoaderPO::handles_type(const String &p_type) const { return (p_type == "Translation"); } diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 2926f4c92a..d575e75f0c 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -390,6 +390,7 @@ Error XMLParser::read() { XMLParser::NodeType XMLParser::get_node_type() { return node_type; } + String XMLParser::get_node_data() const { ERR_FAIL_COND_V(node_type != NODE_TEXT, ""); return node_name; @@ -399,17 +400,21 @@ String XMLParser::get_node_name() const { ERR_FAIL_COND_V(node_type == NODE_TEXT, ""); return node_name; } + int XMLParser::get_attribute_count() const { return attributes.size(); } + String XMLParser::get_attribute_name(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, attributes.size(), ""); return attributes[p_idx].name; } + String XMLParser::get_attribute_value(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, attributes.size(), ""); return attributes[p_idx].value; } + bool XMLParser::has_attribute(const String &p_name) const { for (int i = 0; i < attributes.size(); i++) { if (attributes[i].name == p_name) @@ -418,6 +423,7 @@ bool XMLParser::has_attribute(const String &p_name) const { return false; } + String XMLParser::get_attribute_value(const String &p_name) const { int idx = -1; for (int i = 0; i < attributes.size(); i++) { @@ -445,6 +451,7 @@ String XMLParser::get_attribute_value_safe(const String &p_name) const { return ""; return attributes[idx].value; } + bool XMLParser::is_empty() const { return node_empty; } @@ -526,6 +533,7 @@ XMLParser::XMLParser() { special_characters.push_back("\"quot;"); special_characters.push_back("'apos;"); } + XMLParser::~XMLParser() { if (data) memdelete_arr(data); diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index 588ee84f58..d9cb928944 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -39,6 +39,7 @@ real_t AABB::get_area() const { bool AABB::operator==(const AABB &p_rval) const { return ((position == p_rval.position) && (size == p_rval.size)); } + bool AABB::operator!=(const AABB &p_rval) const { return ((position != p_rval.position) || (size != p_rval.size)); } @@ -238,6 +239,7 @@ Vector3 AABB::get_longest_axis() const { return axis; } + int AABB::get_longest_axis_index() const { int axis = 0; real_t max_size = size.x; @@ -269,6 +271,7 @@ Vector3 AABB::get_shortest_axis() const { return axis; } + int AABB::get_shortest_axis_index() const { int axis = 0; real_t max_size = size.x; @@ -290,11 +293,13 @@ AABB AABB::merge(const AABB &p_with) const { aabb.merge_with(p_with); return aabb; } + AABB AABB::expand(const Vector3 &p_vector) const { AABB aabb = *this; aabb.expand_to(p_vector); return aabb; } + AABB AABB::grow(real_t p_by) const { AABB aabb = *this; aabb.grow_by(p_by); diff --git a/core/math/basis.cpp b/core/math/basis.cpp index e6bf6110f7..9981b673ed 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -327,6 +327,7 @@ void Basis::rotate_local(const Vector3 &p_axis, real_t p_phi) { // M -> (M.R.Minv).M = M.R. *this = rotated_local(p_axis, p_phi); } + Basis Basis::rotated_local(const Vector3 &p_axis, real_t p_phi) const { return (*this) * Basis(p_axis, p_phi); } diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 4b147bd987..c7a3918fe5 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -238,6 +238,7 @@ real_t CameraMatrix::get_z_far() const { return new_plane.d; } + real_t CameraMatrix::get_z_near() const { const real_t *matrix = (const real_t *)this->matrix; Plane new_plane = Plane(matrix[3] + matrix[2], diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 3085997225..f1676ec152 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -51,6 +51,7 @@ bool Geometry::is_point_in_polygon(const Vector2 &p_point, const Vector } return false; } + */ void Geometry::MeshData::optimize_vertices() { diff --git a/core/math/octree.h b/core/math/octree.h index 0782a39804..067103112d 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -1218,6 +1218,7 @@ void Octree::set_pair_callback(PairCallback p_callback, void * pair_callback = p_callback; pair_callback_userdata = p_userdata; } + template void Octree::set_unpair_callback(UnpairCallback p_callback, void *p_userdata) { unpair_callback = p_callback; diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 0f62c8b2c0..0274dd18af 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -145,6 +145,7 @@ void Transform::scale_basis(const Vector3 &p_scale) { void Transform::translate(real_t p_tx, real_t p_ty, real_t p_tz) { translate(Vector3(p_tx, p_ty, p_tz)); } + void Transform::translate(const Vector3 &p_translation) { for (int i = 0; i < 3; i++) { origin[i] += basis[i].dot(p_translation); @@ -174,6 +175,7 @@ bool Transform::is_equal_approx(const Transform &p_transform) const { bool Transform::operator==(const Transform &p_transform) const { return (basis == p_transform.basis && origin == p_transform.origin); } + bool Transform::operator!=(const Transform &p_transform) const { return (basis != p_transform.basis || origin != p_transform.origin); } diff --git a/core/math/transform.h b/core/math/transform.h index 7f7e9ce833..71847d36ac 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -117,6 +117,7 @@ _FORCE_INLINE_ Vector3 Transform::xform(const Vector3 &p_vector) const { basis[1].dot(p_vector) + origin.y, basis[2].dot(p_vector) + origin.z); } + _FORCE_INLINE_ Vector3 Transform::xform_inv(const Vector3 &p_vector) const { Vector3 v = p_vector - origin; @@ -138,6 +139,7 @@ _FORCE_INLINE_ Plane Transform::xform(const Plane &p_plane) const { return Plane(normal, d); } + _FORCE_INLINE_ Plane Transform::xform_inv(const Plane &p_plane) const { Vector3 point = p_plane.normal * p_plane.d; Vector3 point_dir = point + p_plane.normal; diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp index f82d1d99c4..eecfc862f5 100644 --- a/core/math/transform_2d.cpp +++ b/core/math/transform_2d.cpp @@ -123,15 +123,18 @@ void Transform2D::scale(const Size2 &p_scale) { scale_basis(p_scale); elements[2] *= p_scale; } + void Transform2D::scale_basis(const Size2 &p_scale) { elements[0][0] *= p_scale.x; elements[0][1] *= p_scale.y; elements[1][0] *= p_scale.x; elements[1][1] *= p_scale.y; } + void Transform2D::translate(real_t p_tx, real_t p_ty) { translate(Vector2(p_tx, p_ty)); } + void Transform2D::translate(const Vector2 &p_translation) { elements[2] += basis_xform(p_translation); } diff --git a/core/math/transform_2d.h b/core/math/transform_2d.h index 66958257d7..46e97abaa7 100644 --- a/core/math/transform_2d.h +++ b/core/math/transform_2d.h @@ -153,6 +153,7 @@ Vector2 Transform2D::xform(const Vector2 &p_vec) const { tdoty(p_vec)) + elements[2]; } + Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const { Vector2 v = p_vec - elements[2]; @@ -160,6 +161,7 @@ Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const { elements[0].dot(v), elements[1].dot(v)); } + Rect2 Transform2D::xform(const Rect2 &p_rect) const { Vector2 x = elements[0] * p_rect.size.x; Vector2 y = elements[1] * p_rect.size.y; diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index d06f64b40b..7f264ce119 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -192,13 +192,16 @@ bool Vector2::is_equal_approx(const Vector2 &p_v) const { Vector2i Vector2i::operator+(const Vector2i &p_v) const { return Vector2i(x + p_v.x, y + p_v.y); } + void Vector2i::operator+=(const Vector2i &p_v) { x += p_v.x; y += p_v.y; } + Vector2i Vector2i::operator-(const Vector2i &p_v) const { return Vector2i(x - p_v.x, y - p_v.y); } + void Vector2i::operator-=(const Vector2i &p_v) { x -= p_v.x; y -= p_v.y; @@ -236,6 +239,7 @@ Vector2i Vector2i::operator-() const { bool Vector2i::operator==(const Vector2i &p_vec2) const { return x == p_vec2.x && y == p_vec2.y; } + bool Vector2i::operator!=(const Vector2i &p_vec2) const { return x != p_vec2.x || y != p_vec2.y; } diff --git a/core/math/vector2.h b/core/math/vector2.h index 5aa40d45f7..e5774f1d55 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -157,13 +157,16 @@ _FORCE_INLINE_ Vector2 operator*(real_t p_scalar, const Vector2 &p_vec) { _FORCE_INLINE_ Vector2 Vector2::operator+(const Vector2 &p_v) const { return Vector2(x + p_v.x, y + p_v.y); } + _FORCE_INLINE_ void Vector2::operator+=(const Vector2 &p_v) { x += p_v.x; y += p_v.y; } + _FORCE_INLINE_ Vector2 Vector2::operator-(const Vector2 &p_v) const { return Vector2(x - p_v.x, y - p_v.y); } + _FORCE_INLINE_ void Vector2::operator-=(const Vector2 &p_v) { x -= p_v.x; y -= p_v.y; @@ -201,6 +204,7 @@ _FORCE_INLINE_ Vector2 Vector2::operator-() const { _FORCE_INLINE_ bool Vector2::operator==(const Vector2 &p_vec2) const { return x == p_vec2.x && y == p_vec2.y; } + _FORCE_INLINE_ bool Vector2::operator!=(const Vector2 &p_vec2) const { return x != p_vec2.x || y != p_vec2.y; } diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 8acbe31f35..4a9b251406 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -46,6 +46,7 @@ void Vector3::set_axis(int p_axis, real_t p_value) { ERR_FAIL_INDEX(p_axis, 3); coord[p_axis] = p_value; } + real_t Vector3::get_axis(int p_axis) const { ERR_FAIL_INDEX_V(p_axis, 3, 0); return operator[](p_axis); @@ -54,6 +55,7 @@ real_t Vector3::get_axis(int p_axis) const { int Vector3::min_axis() const { return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2); } + int Vector3::max_axis() const { return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0); } @@ -63,6 +65,7 @@ void Vector3::snap(Vector3 p_val) { y = Math::stepify(y, p_val.y); z = Math::stepify(z, p_val.z); } + Vector3 Vector3::snapped(Vector3 p_val) const { Vector3 v = *this; v.snap(p_val); diff --git a/core/math/vector3.h b/core/math/vector3.h index 5fc412628f..3e35a5bba2 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -256,6 +256,7 @@ Vector3 &Vector3::operator-=(const Vector3 &p_v) { z -= p_v.z; return *this; } + Vector3 Vector3::operator-(const Vector3 &p_v) const { return Vector3(x - p_v.x, y - p_v.y, z - p_v.z); } @@ -266,6 +267,7 @@ Vector3 &Vector3::operator*=(const Vector3 &p_v) { z *= p_v.z; return *this; } + Vector3 Vector3::operator*(const Vector3 &p_v) const { return Vector3(x * p_v.x, y * p_v.y, z * p_v.z); } diff --git a/core/math/vector3i.cpp b/core/math/vector3i.cpp index e621d5493a..718a1553a0 100644 --- a/core/math/vector3i.cpp +++ b/core/math/vector3i.cpp @@ -34,6 +34,7 @@ void Vector3i::set_axis(int p_axis, int32_t p_value) { ERR_FAIL_INDEX(p_axis, 3); coord[p_axis] = p_value; } + int32_t Vector3i::get_axis(int p_axis) const { ERR_FAIL_INDEX_V(p_axis, 3, 0); return operator[](p_axis); @@ -42,6 +43,7 @@ int32_t Vector3i::get_axis(int p_axis) const { int Vector3i::min_axis() const { return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2); } + int Vector3i::max_axis() const { return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0); } diff --git a/core/math/vector3i.h b/core/math/vector3i.h index 5ecd3228b2..524f45b452 100644 --- a/core/math/vector3i.h +++ b/core/math/vector3i.h @@ -132,6 +132,7 @@ Vector3i &Vector3i::operator-=(const Vector3i &p_v) { z -= p_v.z; return *this; } + Vector3i Vector3i::operator-(const Vector3i &p_v) const { return Vector3i(x - p_v.x, y - p_v.y, z - p_v.z); } @@ -142,6 +143,7 @@ Vector3i &Vector3i::operator*=(const Vector3i &p_v) { z *= p_v.z; return *this; } + Vector3i Vector3i::operator*(const Vector3i &p_v) const { return Vector3i(x * p_v.x, y * p_v.y, z * p_v.z); } diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 4de4c48578..36914de0ba 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -118,6 +118,7 @@ Error MessageQueue::push_call(Object *p_object, const StringName &p_method, VARI Error MessageQueue::push_notification(Object *p_object, int p_notification) { return push_notification(p_object->get_instance_id(), p_notification); } + Error MessageQueue::push_set(Object *p_object, const StringName &p_prop, const Variant &p_value) { return push_set(p_object->get_instance_id(), p_prop, p_value); } diff --git a/core/method_bind.cpp b/core/method_bind.cpp index 610111a3e8..a88e6e21b0 100644 --- a/core/method_bind.cpp +++ b/core/method_bind.cpp @@ -59,6 +59,7 @@ void MethodBind::_set_returns(bool p_returns) { StringName MethodBind::get_name() const { return name; } + void MethodBind::set_name(const StringName &p_name) { name = p_name; } @@ -67,6 +68,7 @@ void MethodBind::set_name(const StringName &p_name) { void MethodBind::set_argument_names(const Vector &p_names) { arg_names = p_names; } + Vector MethodBind::get_argument_names() const { return arg_names; } diff --git a/core/node_path.cpp b/core/node_path.cpp index 0e4f2eeaf0..fd28815704 100644 --- a/core/node_path.cpp +++ b/core/node_path.cpp @@ -62,12 +62,14 @@ bool NodePath::is_absolute() const { return data->absolute; } + int NodePath::get_name_count() const { if (!data) return 0; return data->path.size(); } + StringName NodePath::get_name(int p_idx) const { ERR_FAIL_COND_V(!data, StringName()); ERR_FAIL_INDEX_V(p_idx, data->path.size(), StringName()); @@ -80,6 +82,7 @@ int NodePath::get_subname_count() const { return data->subpath.size(); } + StringName NodePath::get_subname(int p_idx) const { ERR_FAIL_COND_V(!data, StringName()); ERR_FAIL_INDEX_V(p_idx, data->subpath.size(), StringName()); @@ -133,6 +136,7 @@ bool NodePath::operator==(const NodePath &p_path) const { return true; } + bool NodePath::operator!=(const NodePath &p_path) const { return (!(*this == p_path)); } diff --git a/core/object.cpp b/core/object.cpp index 50bf7d4d28..64b519f1b9 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -160,11 +160,13 @@ MethodInfo::MethodInfo(const String &p_name) : name(p_name), flags(METHOD_FLAG_NORMAL) { } + MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) : name(p_name), flags(METHOD_FLAG_NORMAL) { arguments.push_back(p_param1); } + MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : name(p_name), flags(METHOD_FLAG_NORMAL) { @@ -209,12 +211,14 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) : flags(METHOD_FLAG_NORMAL) { return_val.type = ret; } + MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) : name(p_name), flags(METHOD_FLAG_NORMAL) { return_val.type = ret; arguments.push_back(p_param1); } + MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) : name(p_name), flags(METHOD_FLAG_NORMAL) { @@ -320,6 +324,7 @@ bool Object::Connection::operator<(const Connection &p_conn) const { return signal < p_conn.signal; } } + Object::Connection::Connection(const Variant &p_variant) { Dictionary d = p_variant; if (d.has("signal")) @@ -349,6 +354,7 @@ void Object::_postinitialize() { void Object::get_valid_parents_static(List *p_parents) { } + void Object::_get_valid_parents_static(List *p_parents) { } @@ -739,6 +745,7 @@ Variant Object::getvar(const Variant &p_key, bool *r_valid) const { *r_valid = false; return Variant(); } + void Object::setvar(const Variant &p_key, const Variant &p_value, bool *r_valid) { if (r_valid) *r_valid = false; @@ -997,6 +1004,7 @@ Vector Object::_get_meta_list_bind() const { return _metaret; } + void Object::get_meta_list(List *p_list) const { List keys; metadata.get_key_list(&keys); @@ -1318,6 +1326,7 @@ void Object::get_signals_connected_to_this(List *p_connections) cons Error Object::connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector &p_binds, uint32_t p_flags) { return connect(p_signal, Callable(p_to_object, p_to_method), p_binds, p_flags); } + Error Object::connect(const StringName &p_signal, const Callable &p_callable, const Vector &p_binds, uint32_t p_flags) { ERR_FAIL_COND_V(p_callable.is_null(), ERR_INVALID_PARAMETER); diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 520968c9a9..5763c74862 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -45,6 +45,7 @@ String DirAccess::_get_root_path() const { return ""; } } + String DirAccess::_get_root_string() const { switch (_access_type) { case ACCESS_RESOURCES: diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index f31842bcae..8b13e53812 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -170,6 +170,7 @@ uint16_t FileAccess::get_16() const { return res; } + uint32_t FileAccess::get_32() const { uint32_t res; uint16_t a, b; @@ -187,6 +188,7 @@ uint32_t FileAccess::get_32() const { return res; } + uint64_t FileAccess::get_64() const { uint64_t res; uint32_t a, b; @@ -394,6 +396,7 @@ void FileAccess::store_16(uint16_t p_dest) { store_8(a); store_8(b); } + void FileAccess::store_32(uint32_t p_dest) { uint16_t a, b; @@ -407,6 +410,7 @@ void FileAccess::store_32(uint32_t p_dest) { store_16(a); store_16(b); } + void FileAccess::store_64(uint64_t p_dest) { uint32_t a, b; diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 7c00af8d1f..1ce49b544b 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -65,12 +65,14 @@ void MainLoop::init() { if (get_script_instance()) get_script_instance()->call("_initialize"); } + bool MainLoop::iteration(float p_time) { if (get_script_instance()) return get_script_instance()->call("_iteration", p_time); return false; } + bool MainLoop::idle(float p_time) { if (get_script_instance()) return get_script_instance()->call("_idle", p_time); diff --git a/core/os/os.cpp b/core/os/os.cpp index 02d1dfe895..4414b582bd 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -82,15 +82,18 @@ String OS::get_iso_date_time(bool local) const { uint64_t OS::get_splash_tick_msec() const { return _msec_splash; } + uint64_t OS::get_unix_time() const { return 0; }; uint64_t OS::get_system_time_secs() const { return 0; } + uint64_t OS::get_system_time_msecs() const { return 0; } + void OS::debug_break(){ // something @@ -224,6 +227,7 @@ bool OS::is_no_window_mode_enabled() const { int OS::get_exit_code() const { return _exit_code; } + void OS::set_exit_code(int p_code) { _exit_code = p_code; } diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index b8f83f96a5..cbaf7e883b 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -329,6 +329,7 @@ Variant PackedDataContainer::_iter_init(const Array &p_iter) { Variant PackedDataContainer::_iter_next(const Array &p_iter) { return _iter_next_ofs(p_iter, 0); } + Variant PackedDataContainer::_iter_get(const Variant &p_iter) { return _iter_get_ofs(p_iter, 0); } @@ -354,6 +355,7 @@ Variant PackedDataContainerRef::_iter_init(const Array &p_iter) { Variant PackedDataContainerRef::_iter_next(const Array &p_iter) { return from->_iter_next_ofs(p_iter, offset); } + Variant PackedDataContainerRef::_iter_get(const Variant &p_iter) { return from->_iter_get_ofs(p_iter, offset); } diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 20b5edd412..63fd1d7bd1 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -491,6 +491,7 @@ void *PoolAllocator::get(ID p_mem) { return ptr; } + void PoolAllocator::unlock(ID p_mem) { if (!needs_locking) return; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 42440c8085..fee9423a5e 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -114,6 +114,7 @@ void ProjectSettings::set_initial_value(const String &p_name, const Variant &p_v ERR_FAIL_COND_MSG(!props.has(p_name), "Request for nonexistent project setting: " + p_name + "."); props[p_name].initial = p_value; } + void ProjectSettings::set_restart_if_changed(const String &p_name, bool p_restart) { ERR_FAIL_COND_MSG(!props.has(p_name), "Request for nonexistent project setting: " + p_name + "."); props[p_name].restart_if_changed = p_restart; @@ -181,6 +182,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { return true; } + bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const { _THREAD_SAFE_METHOD_ diff --git a/core/resource.cpp b/core/resource.cpp index 0d8a223b78..7d0e29d664 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -105,6 +105,7 @@ void Resource::set_name(const String &p_name) { name = p_name; _change_notify("resource_name"); } + String Resource::get_name() const { return name; } @@ -444,6 +445,7 @@ bool ResourceCache::has(const String &p_path) { return b; } + Resource *ResourceCache::get(const String &p_path) { lock->read_lock(); diff --git a/core/script_language.cpp b/core/script_language.cpp index d7287d9532..6e5363e916 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -215,16 +215,20 @@ void ScriptServer::add_global_class(const StringName &p_class, const StringName g.base = p_base; global_classes[p_class] = g; } + void ScriptServer::remove_global_class(const StringName &p_class) { global_classes.erase(p_class); } + bool ScriptServer::is_global_class(const StringName &p_class) { return global_classes.has(p_class); } + StringName ScriptServer::get_global_class_language(const StringName &p_class) { ERR_FAIL_COND_V(!global_classes.has(p_class), StringName()); return global_classes[p_class].language; } + String ScriptServer::get_global_class_path(const String &p_class) { ERR_FAIL_COND_V(!global_classes.has(p_class), String()); return global_classes[p_class].path; @@ -234,6 +238,7 @@ StringName ScriptServer::get_global_class_base(const String &p_class) { ERR_FAIL_COND_V(!global_classes.has(p_class), String()); return global_classes[p_class].base; } + StringName ScriptServer::get_global_class_native_base(const String &p_class) { ERR_FAIL_COND_V(!global_classes.has(p_class), String()); String base = global_classes[p_class].base; @@ -242,6 +247,7 @@ StringName ScriptServer::get_global_class_native_base(const String &p_class) { } return base; } + void ScriptServer::get_global_class_list(List *r_global_classes) { const StringName *K = nullptr; List classes; @@ -253,6 +259,7 @@ void ScriptServer::get_global_class_list(List *r_global_classes) { r_global_classes->push_back(E->get()); } } + void ScriptServer::save_global_classes() { List gc; get_global_class_list(&gc); @@ -366,6 +373,7 @@ bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_v } return false; } + bool PlaceHolderScriptInstance::get(const StringName &p_name, Variant &r_ret) const { if (values.has(p_name)) { r_ret = values[p_name]; @@ -431,6 +439,7 @@ void PlaceHolderScriptInstance::get_method_list(List *p_list) const script->get_script_method_list(p_list); } } + bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const { if (script->is_placeholder_fallback_enabled()) return false; diff --git a/core/string_name.cpp b/core/string_name.cpp index 5e6d56e516..7f2da6151e 100644 --- a/core/string_name.cpp +++ b/core/string_name.cpp @@ -334,6 +334,7 @@ StringName StringName::search(const CharType *p_name) { return StringName(); //does not exist } + StringName StringName::search(const String &p_name) { ERR_FAIL_COND_V(p_name == "", StringName()); diff --git a/core/translation.cpp b/core/translation.cpp index a33cd48b88..2eaccc6c4e 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -851,6 +851,7 @@ void Translation::set_locale(const String &p_locale) { void Translation::add_message(const StringName &p_src_text, const StringName &p_xlated_text) { translation_map[p_src_text] = p_xlated_text; } + StringName Translation::get_message(const StringName &p_src_text) const { const Map::Element *E = translation_map.find(p_src_text); if (!E) @@ -1011,6 +1012,7 @@ Vector TranslationServer::get_all_locale_names() { void TranslationServer::add_translation(const Ref &p_translation) { translations.insert(p_translation); } + void TranslationServer::remove_translation(const Ref &p_translation) { translations.erase(p_translation); } diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index da7c0ac248..d1a71a6b64 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -136,6 +136,7 @@ void UndoRedo::add_undo_method(Object *p_object, const StringName &p_method, VAR } actions.write[current_action + 1].undo_ops.push_back(undo_op); } + void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, const Variant &p_value) { ERR_FAIL_COND(p_object == nullptr); ERR_FAIL_COND(action_level <= 0); @@ -150,6 +151,7 @@ void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, c do_op.args[0] = p_value; actions.write[current_action + 1].do_ops.push_back(do_op); } + void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property, const Variant &p_value) { ERR_FAIL_COND(p_object == nullptr); ERR_FAIL_COND(action_level <= 0); @@ -169,6 +171,7 @@ void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property, undo_op.args[0] = p_value; actions.write[current_action + 1].undo_ops.push_back(undo_op); } + void UndoRedo::add_do_reference(Object *p_object) { ERR_FAIL_COND(p_object == nullptr); ERR_FAIL_COND(action_level <= 0); @@ -181,6 +184,7 @@ void UndoRedo::add_do_reference(Object *p_object) { do_op.type = Operation::TYPE_REFERENCE; actions.write[current_action + 1].do_ops.push_back(do_op); } + void UndoRedo::add_undo_reference(Object *p_object) { ERR_FAIL_COND(p_object == nullptr); ERR_FAIL_COND(action_level <= 0); diff --git a/core/ustring.cpp b/core/ustring.cpp index 249a61f3f9..a1a2280066 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -247,6 +247,7 @@ String String::operator+(CharType p_chr) const { res+=p_chr; return res; } + */ String &String::operator+=(const String &p_str) { if (empty()) { @@ -607,6 +608,7 @@ String String::get_with_code_lines() const { } return ret; } + int String::get_slice_count(String p_splitter) const { if (empty()) return 0; @@ -959,6 +961,7 @@ String String::chr(CharType p_char) { CharType c[2] = { p_char, 0 }; return String(c); } + String String::num(double p_num, int p_decimals) { #ifndef NO_USE_STDLIB @@ -1522,6 +1525,7 @@ String::String(CharType p_char) { shared=nullptr; copy_from(p_char); } + */ String::String(const char *p_str) { @@ -2073,6 +2077,7 @@ String operator+(const char *p_chr, const String &p_str) { tmp += p_str; return tmp; } + String operator+(CharType p_chr, const String &p_str) { return (String::chr(p_chr) + p_str); } @@ -2217,6 +2222,7 @@ String String::insert(int p_at_pos, const String &p_string) const { return pre + p_string + post; } + String String::substr(int p_from, int p_chars) const { if (p_chars == -1) p_chars = length() - p_from; @@ -2467,6 +2473,7 @@ int String::rfind(const String &p_str, int p_from) const { return -1; } + int String::rfindn(const String &p_str, int p_from) const { // establish a limit int limit = length() - p_str.length(); @@ -2540,6 +2547,7 @@ bool String::begins_with(const String &p_string) const { // only if i == l the p_string matches the beginning return i == l; } + bool String::begins_with(const char *p_string) const { int l = length(); if (l == 0 || !p_string) @@ -2846,6 +2854,7 @@ String String::replace_first(const String &p_key, const String &p_with) const { return *this; } + String String::replacen(const String &p_key, const String &p_with) const { String new_string; int search_from = 0; @@ -3110,6 +3119,7 @@ String String::humanize_size(uint64_t p_size) { return String::num(p_size / divisor).pad_decimals(digits) + " " + prefixes[prefix_idx]; } + bool String::is_abs_path() const { if (length() > 1) return (operator[](0) == '/' || operator[](0) == '\\' || find(":/") != -1 || find(":\\") != -1); @@ -3742,6 +3752,7 @@ String String::percent_encode() const { return encoded; } + String String::percent_decode() const { CharString pe; @@ -3824,6 +3835,7 @@ String String::rpad(int min_length, const String &character) const { return s; } + // Left-pad with a character. String String::lpad(int min_length, const String &character) const { String s = *this; diff --git a/core/variant.cpp b/core/variant.cpp index b2bb7fe309..1098d031e5 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1374,6 +1374,7 @@ Variant::operator signed int() const { } } } + Variant::operator unsigned int() const { switch (type) { case NIL: @@ -1517,6 +1518,7 @@ Variant::operator signed short() const { } } } + Variant::operator unsigned short() const { switch (type) { case NIL: @@ -1534,6 +1536,7 @@ Variant::operator unsigned short() const { } } } + Variant::operator signed char() const { switch (type) { case NIL: @@ -1551,6 +1554,7 @@ Variant::operator signed char() const { } } } + Variant::operator unsigned char() const { switch (type) { case NIL: @@ -1590,6 +1594,7 @@ Variant::operator float() const { } } } + Variant::operator double() const { switch (type) { case NIL: @@ -1935,6 +1940,7 @@ Variant::operator Plane() const { else return Plane(); } + Variant::operator ::AABB() const { if (type == AABB) return *_data._aabb; @@ -2077,6 +2083,7 @@ Variant::operator Node *() const { else return nullptr; } + Variant::operator Control *() const { if (type == OBJECT) return Object::cast_to(_get_obj().obj); @@ -2169,12 +2176,14 @@ Variant::operator Vector() const { else return _convert_array_from_variant>(*this); } + Variant::operator Vector() const { if (type == PACKED_INT32_ARRAY) return static_cast *>(_data.packed_array)->array; else return _convert_array_from_variant>(*this); } + Variant::operator Vector() const { if (type == PACKED_INT64_ARRAY) return static_cast *>(_data.packed_array)->array; @@ -2202,12 +2211,14 @@ Variant::operator Vector() const { else return _convert_array_from_variant>(*this); } + Variant::operator Vector() const { if (type == PACKED_VECTOR3_ARRAY) return static_cast *>(_data.packed_array)->array; else return _convert_array_from_variant>(*this); } + Variant::operator Vector() const { if (type == PACKED_VECTOR2_ARRAY) return static_cast *>(_data.packed_array)->array; @@ -2280,6 +2291,7 @@ Variant::operator Vector() const { return variants; } + Variant::operator Vector() const { Vector from = operator Vector(); Vector to; @@ -2294,6 +2306,7 @@ Variant::operator Vector() const { Variant::operator Margin() const { return (Margin) operator int(); } + Variant::operator Orientation() const { return (Orientation) operator int(); } @@ -2326,6 +2339,7 @@ Variant::Variant(signed int p_int) { type = INT; _data._int = p_int; } + Variant::Variant(unsigned int p_int) { type = INT; _data._int = p_int; @@ -2337,6 +2351,7 @@ Variant::Variant(signed long p_int) { type = INT; _data._int = p_int; } + Variant::Variant(unsigned long p_int) { type = INT; _data._int = p_int; @@ -2357,22 +2372,27 @@ Variant::Variant(signed short p_short) { type = INT; _data._int = p_short; } + Variant::Variant(unsigned short p_short) { type = INT; _data._int = p_short; } + Variant::Variant(signed char p_char) { type = INT; _data._int = p_char; } + Variant::Variant(unsigned char p_char) { type = INT; _data._int = p_char; } + Variant::Variant(float p_float) { type = FLOAT; _data._float = p_float; } + Variant::Variant(double p_double) { type = FLOAT; _data._float = p_double; @@ -2387,6 +2407,7 @@ Variant::Variant(const StringName &p_string) { type = STRING_NAME; memnew_placement(_data._mem, StringName(p_string)); } + Variant::Variant(const String &p_string) { type = STRING; memnew_placement(_data._mem, String(p_string)); @@ -2401,10 +2422,12 @@ Variant::Variant(const CharType *p_wstring) { type = STRING; memnew_placement(_data._mem, String(p_wstring)); } + Variant::Variant(const Vector3 &p_vector3) { type = VECTOR3; memnew_placement(_data._mem, Vector3(p_vector3)); } + Variant::Variant(const Vector3i &p_vector3i) { type = VECTOR3I; memnew_placement(_data._mem, Vector3i(p_vector3i)); @@ -2434,6 +2457,7 @@ Variant::Variant(const Plane &p_plane) { type = PLANE; memnew_placement(_data._mem, Plane(p_plane)); } + Variant::Variant(const ::AABB &p_aabb) { type = AABB; _data._aabb = memnew(::AABB(p_aabb)); @@ -2448,6 +2472,7 @@ Variant::Variant(const Quat &p_quat) { type = QUAT; memnew_placement(_data._mem, Quat(p_quat)); } + Variant::Variant(const Transform &p_transform) { type = TRANSFORM; _data._transform = memnew(Transform(p_transform)); @@ -2457,6 +2482,7 @@ Variant::Variant(const Transform2D &p_transform) { type = TRANSFORM2D; _data._transform2d = memnew(Transform2D(p_transform)); } + Variant::Variant(const Color &p_color) { type = COLOR; memnew_placement(_data._mem, Color(p_color)); @@ -2499,6 +2525,7 @@ Variant::Variant(const Callable &p_callable) { type = CALLABLE; memnew_placement(_data._mem, Callable(p_callable)); } + Variant::Variant(const Signal &p_callable) { type = SIGNAL; memnew_placement(_data._mem, Signal(p_callable)); @@ -2543,6 +2570,7 @@ Variant::Variant(const Vector &p_byte_array) { _data.packed_array = PackedArrayRef::create(p_byte_array); } + Variant::Variant(const Vector &p_int32_array) { type = PACKED_INT32_ARRAY; _data.packed_array = PackedArrayRef::create(p_int32_array); @@ -2567,6 +2595,7 @@ Variant::Variant(const Vector &p_string_array) { type = PACKED_STRING_ARRAY; _data.packed_array = PackedArrayRef::create(p_string_array); } + Variant::Variant(const Vector &p_vector3_array) { type = PACKED_VECTOR3_ARRAY; _data.packed_array = PackedArrayRef::create(p_vector3_array); @@ -2576,6 +2605,7 @@ Variant::Variant(const Vector &p_vector2_array) { type = PACKED_VECTOR2_ARRAY; _data.packed_array = PackedArrayRef::create(p_vector2_array); } + Variant::Variant(const Vector &p_color_array) { type = PACKED_COLOR_ARRAY; _data.packed_array = PackedArrayRef::create(p_color_array); @@ -3275,12 +3305,14 @@ Vector varray(const Variant &p_arg1) { v.push_back(p_arg1); return v; } + Vector varray(const Variant &p_arg1, const Variant &p_arg2) { Vector v; v.push_back(p_arg1); v.push_back(p_arg2); return v; } + Vector varray(const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3) { Vector v; v.push_back(p_arg1); @@ -3288,6 +3320,7 @@ Vector varray(const Variant &p_arg1, const Variant &p_arg2, const Varia v.push_back(p_arg3); return v; } + Vector varray(const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4) { Vector v; v.push_back(p_arg1); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index b7678d8f43..1d75d52db0 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -115,6 +115,7 @@ TYPE(PREFIX, OP, PACKED_VECTOR3_ARRAY), \ TYPE(PREFIX, OP, PACKED_COLOR_ARRAY), \ } + /* clang-format on */ #define CASES(PREFIX) static const void *switch_table_##PREFIX[25][Variant::VARIANT_MAX] = { \ @@ -3536,6 +3537,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { valid = false; return false; } + bool Variant::iter_next(Variant &r_iter, bool &valid) const { valid = true; switch (type) { diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 0184de46ee..3a38720a27 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -42,6 +42,7 @@ CharType VariantParser::StreamFile::get_char() { bool VariantParser::StreamFile::is_utf8() const { return true; } + bool VariantParser::StreamFile::is_eof() const { return f->eof_reached(); } @@ -62,6 +63,7 @@ CharType VariantParser::StreamString::get_char() { bool VariantParser::StreamString::is_utf8() const { return false; } + bool VariantParser::StreamString::is_eof() const { return pos > s.length(); } diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index b6e36d87a5..c92eb4cd11 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -1887,6 +1887,7 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } + void RasterizerCanvasGLES2::reset_canvas() { glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); @@ -1918,6 +1919,7 @@ void RasterizerCanvasGLES2::_bind_quad_buffer() { glEnableVertexAttribArray(RS::ARRAY_VERTEX); glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 0, nullptr); } + void RasterizerCanvasGLES2::draw_generic_textured_rect(const Rect2 &p_rect, const Rect2 &p_src) { state.canvas_shader.set_uniform(CanvasShaderGLES2::DST_RECT, Color(p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y)); state.canvas_shader.set_uniform(CanvasShaderGLES2::SRC_RECT, Color(p_src.position.x, p_src.position.y, p_src.size.x, p_src.size.y)); diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 02e9d7d504..c66506f182 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -460,6 +460,7 @@ int RasterizerSceneGLES2::get_directional_light_shadow_size(RID p_light_intance) return shadow_size; } + ////////////////////////////////////////////////////// RID RasterizerSceneGLES2::reflection_atlas_create() { @@ -840,6 +841,7 @@ void RasterizerSceneGLES2::environment_set_fog_height(RID p_env, bool p_enable, env->fog_height_max = p_max_height; env->fog_height_curve = p_height_curve; } + bool RasterizerSceneGLES2::is_environment(RID p_env) { return environment_owner.owns(p_env); } @@ -917,6 +919,7 @@ RID RasterizerSceneGLES2::gi_probe_instance_create() { void RasterizerSceneGLES2::gi_probe_instance_set_light_data(RID p_probe, RID p_base, RID p_data) { } + void RasterizerSceneGLES2::gi_probe_instance_set_transform_to_data(RID p_probe, const Transform &p_xform) { } @@ -965,6 +968,7 @@ void RasterizerSceneGLES2::_add_geometry(RasterizerStorageGLES2::Geometry *p_geo _add_geometry_with_material(p_geometry, p_instance, p_owner, material, p_depth_pass, p_shadow_pass); } } + void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES2::GeometryOwner *p_owner, RasterizerStorageGLES2::Material *p_material, bool p_depth_pass, bool p_shadow_pass) { bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture || p_material->shader->spatial.uses_depth_texture; bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES2::Shader::Spatial::BLEND_MODE_MIX; diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 0636676ffa..6eef04b87f 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -2617,6 +2617,7 @@ Vector> RasterizerStorageGLES2::mesh_surface_get_blend_shapes(RI return mesh->surfaces[p_surface]->blend_shape_data; } + Vector RasterizerStorageGLES2::mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const { const Mesh *mesh = mesh_owner.getornull(p_mesh); ERR_FAIL_COND_V(!mesh, Vector()); @@ -2782,6 +2783,7 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const { return aabb; } + void RasterizerStorageGLES2::mesh_clear(RID p_mesh) { Mesh *mesh = mesh_owner.getornull(p_mesh); ERR_FAIL_COND(!mesh); @@ -3560,6 +3562,7 @@ Transform RasterizerStorageGLES2::skeleton_bone_get_transform(RID p_skeleton, in return ret; } + void RasterizerStorageGLES2::skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) { Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); ERR_FAIL_COND(!skeleton); @@ -3987,6 +3990,7 @@ void RasterizerStorageGLES2::reflection_probe_set_max_distance(RID p_probe, floa reflection_probe->max_distance = p_distance; reflection_probe->instance_change_notify(true, false); } + void RasterizerStorageGLES2::reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents) { ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND(!reflection_probe); @@ -3994,6 +3998,7 @@ void RasterizerStorageGLES2::reflection_probe_set_extents(RID p_probe, const Vec reflection_probe->extents = p_extents; reflection_probe->instance_change_notify(true, false); } + void RasterizerStorageGLES2::reflection_probe_set_origin_offset(RID p_probe, const Vector3 &p_offset) { ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND(!reflection_probe); @@ -4009,6 +4014,7 @@ void RasterizerStorageGLES2::reflection_probe_set_as_interior(RID p_probe, bool reflection_probe->interior = p_enable; reflection_probe->instance_change_notify(true, false); } + void RasterizerStorageGLES2::reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable) { ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND(!reflection_probe); @@ -4023,6 +4029,7 @@ void RasterizerStorageGLES2::reflection_probe_set_enable_shadows(RID p_probe, bo reflection_probe->enable_shadows = p_enable; reflection_probe->instance_change_notify(true, false); } + void RasterizerStorageGLES2::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) { ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND(!reflection_probe); @@ -4048,6 +4055,7 @@ AABB RasterizerStorageGLES2::reflection_probe_get_aabb(RID p_probe) const { return aabb; } + RS::ReflectionProbeUpdateMode RasterizerStorageGLES2::reflection_probe_get_update_mode(RID p_probe) const { const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND_V(!reflection_probe, RS::REFLECTION_PROBE_UPDATE_ALWAYS); @@ -4068,6 +4076,7 @@ Vector3 RasterizerStorageGLES2::reflection_probe_get_extents(RID p_probe) const return reflection_probe->extents; } + Vector3 RasterizerStorageGLES2::reflection_probe_get_origin_offset(RID p_probe) const { const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); ERR_FAIL_COND_V(!reflection_probe, Vector3()); @@ -4160,6 +4169,7 @@ void RasterizerStorageGLES2::gi_probe_set_compress(RID p_probe, bool p_enable) { bool RasterizerStorageGLES2::gi_probe_is_compressed(RID p_probe) const { return false; } + float RasterizerStorageGLES2::gi_probe_get_energy(RID p_probe) const { return 0; } @@ -4204,11 +4214,13 @@ void RasterizerStorageGLES2::lightmap_capture_set_bounds(RID p_capture, const AA capture->bounds = p_bounds; capture->instance_change_notify(true, false); } + AABB RasterizerStorageGLES2::lightmap_capture_get_bounds(RID p_capture) const { const LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture); ERR_FAIL_COND_V(!capture, AABB()); return capture->bounds; } + void RasterizerStorageGLES2::lightmap_capture_set_octree(RID p_capture, const Vector &p_octree) { LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture); ERR_FAIL_COND(!capture); @@ -4223,6 +4235,7 @@ void RasterizerStorageGLES2::lightmap_capture_set_octree(RID p_capture, const Ve } capture->instance_change_notify(true, false); } + Vector RasterizerStorageGLES2::lightmap_capture_get_octree(RID p_capture) const { const LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture); ERR_FAIL_COND_V(!capture, Vector()); diff --git a/drivers/gles2/shaders/blend_shape.glsl b/drivers/gles2/shaders/blend_shape.glsl index 7a0a7ebe99..e229da6f18 100644 --- a/drivers/gles2/shaders/blend_shape.glsl +++ b/drivers/gles2/shaders/blend_shape.glsl @@ -190,4 +190,5 @@ void main() { void main() { } + /* clang-format on */ diff --git a/drivers/gles2/shaders/particles.glsl b/drivers/gles2/shaders/particles.glsl index 1575db701f..d762dade2f 100644 --- a/drivers/gles2/shaders/particles.glsl +++ b/drivers/gles2/shaders/particles.glsl @@ -257,4 +257,5 @@ FRAGMENT_SHADER_CODE } } + /* clang-format on */ diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index d658ccd5cd..0311dc4742 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -1065,6 +1065,7 @@ float G_GGX_2cos(float cos_theta_m, float alpha) { // float sin2 = (1.0 - cos2); // return 1.0 / (cos_theta_m + sqrt(cos2 + alpha * alpha * sin2)); } + */ // This approximates G_GGX_2cos(cos_theta_l, alpha) * G_GGX_2cos(cos_theta_v, alpha) @@ -1087,6 +1088,7 @@ float G_GGX_anisotropic_2cos(float cos_theta_m, float alpha_x, float alpha_y, fl float s_y = alpha_y * sin_phi; return 1.0 / max(cos_theta_m + sqrt(cos2 + (s_x * s_x + s_y * s_y) * sin2), 0.001); } + */ // This approximates G_GGX_anisotropic_2cos(cos_theta_l, ...) * G_GGX_anisotropic_2cos(cos_theta_v, ...) diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 920d594ea1..3ba667b2f7 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -244,6 +244,7 @@ void OS_Unix::delay_usec(uint32_t p_usec) const { while (nanosleep(&rem, &rem) == EINTR) { } } + uint64_t OS_Unix::get_ticks_usec() const { #if defined(__APPLE__) uint64_t longtime = mach_absolute_time() * _clock_scale; diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index dda1edc3c3..16897883e8 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -87,6 +87,7 @@ Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_ return tr; } + Thread::ID ThreadPosix::get_thread_id_func_posix() { void *value = pthread_getspecific(thread_id_key); @@ -97,6 +98,7 @@ Thread::ID ThreadPosix::get_thread_id_func_posix() { pthread_setspecific(thread_id_key, (void *)memnew(ID(new_id))); return new_id; } + void ThreadPosix::wait_to_finish_func_posix(Thread *p_thread) { ThreadPosix *tp = static_cast(p_thread); ERR_FAIL_COND(!tp); diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index f8b0eafcd0..ea99594810 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -2699,6 +2699,7 @@ Error RenderingDeviceVulkan::texture_copy(RID p_from_texture, RID p_to_texture, return OK; } + Error RenderingDeviceVulkan::texture_resolve_multisample(RID p_from_texture, RID p_to_texture, bool p_sync_with_draw) { _THREAD_SAFE_METHOD_ @@ -5323,12 +5324,14 @@ int RenderingDeviceVulkan::screen_get_width(DisplayServer::WindowID p_screen) co ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen"); return context->window_get_width(p_screen); } + int RenderingDeviceVulkan::screen_get_height(DisplayServer::WindowID p_screen) const { _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen"); return context->window_get_height(p_screen); } + RenderingDevice::FramebufferFormatID RenderingDeviceVulkan::screen_get_framebuffer_format() const { _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V_MSG(local_device.is_valid(), INVALID_ID, "Local devices have no screen"); @@ -5978,6 +5981,7 @@ void RenderingDeviceVulkan::draw_list_bind_vertex_array(DrawListID p_list, RID p dl->validation.vertex_array_size = vertex_array->vertex_count; vkCmdBindVertexBuffers(dl->command_buffer, 0, vertex_array->buffers.size(), vertex_array->buffers.ptr(), vertex_array->offsets.ptr()); } + void RenderingDeviceVulkan::draw_list_bind_index_array(DrawListID p_list, RID p_index_array) { DrawList *dl = _get_draw_list_ptr(p_list); ERR_FAIL_COND(!dl); @@ -6164,6 +6168,7 @@ void RenderingDeviceVulkan::draw_list_enable_scissor(DrawListID p_list, const Re vkCmdSetScissor(dl->command_buffer, 0, 1, &scissor); } + void RenderingDeviceVulkan::draw_list_disable_scissor(DrawListID p_list) { DrawList *dl = _get_draw_list_ptr(p_list); ERR_FAIL_COND(!dl); @@ -6302,6 +6307,7 @@ void RenderingDeviceVulkan::compute_list_bind_compute_pipeline(ComputeListID p_l cl->validation.pipeline_push_constant_size = pipeline->push_constant_size; #endif } + void RenderingDeviceVulkan::compute_list_bind_uniform_set(ComputeListID p_list, RID p_uniform_set, uint32_t p_index) { ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); ERR_FAIL_COND(!compute_list); @@ -6424,6 +6430,7 @@ void RenderingDeviceVulkan::compute_list_set_push_constant(ComputeListID p_list, cl->validation.pipeline_push_constant_suppplied = true; #endif } + void RenderingDeviceVulkan::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_groups, uint32_t p_y_groups, uint32_t p_z_groups) { ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); ERR_FAIL_COND(!compute_list); @@ -6646,6 +6653,7 @@ void RenderingDeviceVulkan::_free_internal(RID p_id) { ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id())); } } + void RenderingDeviceVulkan::free(RID p_id) { _THREAD_SAFE_METHOD_ @@ -7163,10 +7171,12 @@ uint64_t RenderingDeviceVulkan::get_captured_timestamp_gpu_time(uint32_t p_index return l; } + uint64_t RenderingDeviceVulkan::get_captured_timestamp_cpu_time(uint32_t p_index) const { ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0); return frames[frame].timestamp_cpu_result_values[p_index]; } + String RenderingDeviceVulkan::get_captured_timestamp_name(uint32_t p_index) const { ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, String()); return frames[frame].timestamp_result_names[p_index]; diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 875ace32a5..a8a29aaeea 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1459,9 +1459,11 @@ VkDevice VulkanContext::get_device() { VkPhysicalDevice VulkanContext::get_physical_device() { return gpu; } + int VulkanContext::get_swapchain_image_count() const { return swapchainImageCount; } + uint32_t VulkanContext::get_graphics_queue() const { return graphics_queue_family_index; } diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 52ba8527ab..d0f06ae4c4 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -101,9 +101,11 @@ void DirAccessWindows::list_dir_end() { p->h = INVALID_HANDLE_VALUE; } } + int DirAccessWindows::get_drive_count() { return drive_count; } + String DirAccessWindows::get_drive(int p_drive) { if (p_drive < 0 || p_drive >= drive_count) return ""; @@ -298,6 +300,7 @@ Error DirAccessWindows::remove(String p_path) { else return ::_wunlink(p_path.c_str()) == 0 ? OK : FAILED; } + /* FileType DirAccessWindows::get_file_type(const String& p_file) const { @@ -325,6 +328,7 @@ FileType DirAccessWindows::get_file_type(const String& p_file) const { return (attr&FILE_ATTRIBUTE_DIRECTORY)?FILE_TYPE_ } + */ size_t DirAccessWindows::get_space_left() { uint64_t bytes = 0; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index b74e89e2dc..50366d0b2d 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -188,6 +188,7 @@ String FileAccessWindows::get_path_absolute() const { bool FileAccessWindows::is_open() const { return (f != nullptr); } + void FileAccessWindows::seek(size_t p_position) { ERR_FAIL_COND(!f); last_error = OK; @@ -195,12 +196,14 @@ void FileAccessWindows::seek(size_t p_position) { check_errors(); prev_op = 0; } + void FileAccessWindows::seek_end(int64_t p_position) { ERR_FAIL_COND(!f); if (fseek(f, p_position, SEEK_END)) check_errors(); prev_op = 0; } + size_t FileAccessWindows::get_position() const { size_t aux_position = 0; aux_position = ftell(f); @@ -209,6 +212,7 @@ size_t FileAccessWindows::get_position() const { }; return aux_position; } + size_t FileAccessWindows::get_len() const { ERR_FAIL_COND_V(!f, 0); diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp index adc3a9a019..ca7d936fac 100644 --- a/drivers/windows/thread_windows.cpp +++ b/drivers/windows/thread_windows.cpp @@ -66,9 +66,11 @@ Thread *ThreadWindows::create_func_windows(ThreadCreateCallback p_callback, void return tr; } + Thread::ID ThreadWindows::get_thread_id_func_windows() { return (ID)GetCurrentThreadId(); //must implement } + void ThreadWindows::wait_to_finish_func_windows(Thread *p_thread) { ThreadWindows *tp = static_cast(p_thread); ERR_FAIL_COND(!tp); diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index 9ff1030165..df7d2488fd 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -150,6 +150,7 @@ void AudioDriverXAudio2::lock() { return; mutex.lock(); } + void AudioDriverXAudio2::unlock() { if (!thread) return; diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 893a3f62b1..dededfb617 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -509,6 +509,7 @@ void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { timeline = p_timeline; timeline->connect("zoom_changed", callable_mp(this, &AnimationBezierTrackEdit::_zoom_changed)); } + void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; connect_compat("clear_selection", editor, "_clear_selection", varray(false)); @@ -541,6 +542,7 @@ void AnimationBezierTrackEdit::update_play_position() { void AnimationBezierTrackEdit::set_root(Node *p_root) { root = p_root; } + void AnimationBezierTrackEdit::_zoom_changed() { update(); } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 92879fb193..0808946b16 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1684,6 +1684,7 @@ void AnimationTimelineEdit::set_use_fps(bool p_use_fps) { update_values(); update(); } + bool AnimationTimelineEdit::is_using_fps() const { return use_fps; } @@ -2066,6 +2067,7 @@ int AnimationTrackEdit::get_key_height() const { return type_icon->get_height(); } + Rect2 AnimationTrackEdit::get_key_rect(int p_index, float p_pixels_sec) { if (!animation.is_valid()) return Rect2(); @@ -2262,6 +2264,7 @@ void AnimationTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { timeline->connect("zoom_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed)); timeline->connect("name_limit_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed)); } + void AnimationTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; } @@ -2761,6 +2764,7 @@ bool AnimationTrackEdit::can_drop_data(const Point2 &p_point, const Variant &p_d return true; } + void AnimationTrackEdit::drop_data(const Point2 &p_point, const Variant &p_data) { Dictionary d = p_data; if (!d.has("type")) { @@ -2844,6 +2848,7 @@ void AnimationTrackEdit::cancel_drop() { update(); } } + void AnimationTrackEdit::set_in_group(bool p_enable) { in_group = p_enable; update(); @@ -3135,6 +3140,7 @@ void AnimationTrackEditor::update_keying() { bool AnimationTrackEditor::has_keying() const { return keying; } + Dictionary AnimationTrackEditor::get_state() const { Dictionary state; state["fps_mode"] = timeline->is_using_fps(); @@ -3143,6 +3149,7 @@ Dictionary AnimationTrackEditor::get_state() const { state["v_scroll"] = scroll->get_v_scrollbar()->get_value(); return state; } + void AnimationTrackEditor::set_state(const Dictionary &p_state) { if (p_state.has("fps_mode")) { bool fps_mode = p_state["fps_mode"]; @@ -4076,6 +4083,7 @@ void AnimationTrackEditor::_update_step_spinbox() { step->set_block_signals(false); } + void AnimationTrackEditor::_animation_update() { timeline->update(); timeline->update_values(); @@ -4752,6 +4760,7 @@ void AnimationTrackEditor::_move_selection_commit() { _update_key_edit(); } + void AnimationTrackEditor::_move_selection_cancel() { moving_selection = false; for (int i = 0; i < track_edits.size(); i++) { @@ -4762,6 +4771,7 @@ void AnimationTrackEditor::_move_selection_cancel() { bool AnimationTrackEditor::is_moving_selection() const { return moving_selection; } + float AnimationTrackEditor::get_moving_selection_offset() const { return moving_selection_offset; } @@ -4953,6 +4963,7 @@ void AnimationTrackEditor::_anim_duplicate_keys(bool transpose) { _update_key_edit(); } } + void AnimationTrackEditor::_edit_menu_pressed(int p_option) { last_menu_track_opt = p_option; switch (p_option) { diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 424c3db15f..ed64fb2415 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -44,6 +44,7 @@ int AnimationTrackEditBool::get_key_height() const { Ref checked = get_theme_icon("checked", "CheckBox"); return checked->get_height(); } + Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) { Ref checked = get_theme_icon("checked", "CheckBox"); return Rect2(-checked->get_width() / 2, 0, checked->get_width(), get_size().height); @@ -52,6 +53,7 @@ Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) { bool AnimationTrackEditBool::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { bool checked = get_animation()->track_get_key_value(get_track(), p_index); Ref icon = get_theme_icon(checked ? "checked" : "unchecked", "CheckBox"); @@ -78,6 +80,7 @@ int AnimationTrackEditColor::get_key_height() const { Ref font = get_theme_font("font", "Label"); return font->get_height() * 0.8; } + Rect2 AnimationTrackEditColor::get_key_rect(int p_index, float p_pixels_sec) { Ref font = get_theme_font("font", "Label"); int fh = font->get_height() * 0.8; @@ -177,6 +180,7 @@ int AnimationTrackEditAudio::get_key_height() const { Ref font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } + Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) { Object *object = ObjectDB::get_instance(id); @@ -214,6 +218,7 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) { bool AnimationTrackEditAudio::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { Object *object = ObjectDB::get_instance(id); @@ -329,6 +334,7 @@ int AnimationTrackEditSpriteFrame::get_key_height() const { Ref font = get_theme_font("font", "Label"); return int(font->get_height() * 2); } + Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_sec) { Object *object = ObjectDB::get_instance(id); @@ -402,6 +408,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se bool AnimationTrackEditSpriteFrame::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { Object *object = ObjectDB::get_instance(id); @@ -525,6 +532,7 @@ int AnimationTrackEditSubAnim::get_key_height() const { Ref font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } + Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) { Object *object = ObjectDB::get_instance(id); @@ -558,6 +566,7 @@ Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) { bool AnimationTrackEditSubAnim::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { Object *object = ObjectDB::get_instance(id); @@ -750,6 +759,7 @@ int AnimationTrackEditTypeAudio::get_key_height() const { Ref font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } + Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec) { Ref stream = get_animation()->audio_track_get_key_stream(get_track(), p_index); @@ -783,6 +793,7 @@ Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec) bool AnimationTrackEditTypeAudio::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { Ref stream = get_animation()->audio_track_get_key_stream(get_track(), p_index); @@ -928,6 +939,7 @@ bool AnimationTrackEditTypeAudio::can_drop_data(const Point2 &p_point, const Var return AnimationTrackEdit::can_drop_data(p_point, p_data); } + void AnimationTrackEditTypeAudio::drop_data(const Point2 &p_point, const Variant &p_data) { if (p_point.x > get_timeline()->get_name_limit() && p_point.x < get_size().width - get_timeline()->get_buttons_width()) { Ref stream; @@ -1076,6 +1088,7 @@ int AnimationTrackEditTypeAnimation::get_key_height() const { Ref font = get_theme_font("font", "Label"); return int(font->get_height() * 1.5); } + Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_sec) { Object *object = ObjectDB::get_instance(id); @@ -1109,6 +1122,7 @@ Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_ bool AnimationTrackEditTypeAnimation::is_key_selectable_by_distance() const { return false; } + void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { Object *object = ObjectDB::get_instance(id); diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index a239d2e909..3832a93360 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -50,6 +50,7 @@ Variant ArrayPropertyEdit::get_array() const { void ArrayPropertyEdit::_notif_change() { _change_notify(); } + void ArrayPropertyEdit::_notif_changev(const String &p_v) { _change_notify(p_v.utf8().get_data()); } diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index e0891e808b..e0d5184aac 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -35,6 +35,7 @@ float AudioStreamPreview::get_length() const { return length; } + float AudioStreamPreview::get_max(float p_time, float p_time_next) const { if (length == 0) return 0; @@ -60,6 +61,7 @@ float AudioStreamPreview::get_max(float p_time, float p_time_next) const { return (vmax / 255.0) * 2.0 - 1.0; } + float AudioStreamPreview::get_min(float p_time, float p_time_next) const { if (length == 0) return 0; diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index cacf5c744f..5f693fdbb6 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -482,6 +482,7 @@ void CreateDialog::set_preferred_search_result_type(const String &p_preferred_ty String CreateDialog::get_preferred_search_result_type() { return preferred_search_result_type; } + String CreateDialog::get_selected_type() { TreeItem *selected = search_options->get_selected(); if (selected) @@ -644,6 +645,7 @@ bool CreateDialog::can_drop_data_fw(const Point2 &p_point, const Variant &p_data return false; } + void CreateDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { Dictionary d = p_data; diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 3c9fd39069..76d1701372 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -549,41 +549,49 @@ void EditorDebuggerNode::set_live_debugging(bool p_enabled) { dbg->set_live_debugging(p_enabled); }); } + void EditorDebuggerNode::update_live_edit_root() { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->update_live_edit_root(); }); } + void EditorDebuggerNode::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_create_node(p_parent, p_type, p_name); }); } + void EditorDebuggerNode::live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_instance_node(p_parent, p_path, p_name); }); } + void EditorDebuggerNode::live_debug_remove_node(const NodePath &p_at) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_remove_node(p_at); }); } + void EditorDebuggerNode::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_remove_and_keep_node(p_at, p_keep_id); }); } + void EditorDebuggerNode::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_restore_node(p_id, p_at, p_at_pos); }); } + void EditorDebuggerNode::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_duplicate_node(p_at, p_new_name); }); } + void EditorDebuggerNode::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { _for_all(tabs, [&](ScriptEditorDebugger *dbg) { dbg->live_debug_reparent_node(p_at, p_new_place, p_new_name, p_at_pos); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 5ac62bf0ba..867eef1c93 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -97,6 +97,7 @@ void ScriptEditorDebugger::debug_next() { _put_msg("next", Array()); _clear_execution(); } + void ScriptEditorDebugger::debug_step() { ERR_FAIL_COND(!breaked); @@ -1243,6 +1244,7 @@ void ScriptEditorDebugger::live_debug_instance_node(const NodePath &p_parent, co _put_msg("scene:live_instance_node", msg); } } + void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) { if (live_debug) { Array msg; @@ -1250,6 +1252,7 @@ void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) { _put_msg("scene:live_remove_node", msg); } } + void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) { if (live_debug) { Array msg; @@ -1258,6 +1261,7 @@ void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, _put_msg("scene:live_remove_and_keep_node", msg); } } + void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) { if (live_debug) { Array msg; @@ -1267,6 +1271,7 @@ void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath _put_msg("scene:live_restore_node", msg); } } + void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) { if (live_debug) { Array msg; @@ -1275,6 +1280,7 @@ void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const _put_msg("scene:live_duplicate_node", msg); } } + void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) { if (live_debug) { Array msg; diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp index 99ebf16697..d45c9f5ff5 100644 --- a/editor/doc_data.cpp +++ b/editor/doc_data.cpp @@ -771,6 +771,7 @@ Error DocData::load_classes(const String &p_dir) { return OK; } + Error DocData::erase_classes(const String &p_dir) { Error err; DirAccessRef da = DirAccess::open(p_dir, &err); @@ -798,6 +799,7 @@ Error DocData::erase_classes(const String &p_dir) { return OK; } + Error DocData::_load(Ref parser) { Error err = OK; diff --git a/editor/editor_atlas_packer.cpp b/editor/editor_atlas_packer.cpp index c2df1fd82a..469a6c6de1 100644 --- a/editor/editor_atlas_packer.cpp +++ b/editor/editor_atlas_packer.cpp @@ -79,6 +79,7 @@ void EditorAtlasPacker::_plot_triangle(Ref p_bitmap, Vector2i *vertices) xt += dx_low; } } + void EditorAtlasPacker::chart_pack(Vector &charts, int &r_width, int &r_height, int p_atlas_max_size, int p_cell_resolution) { int divide_by = MIN(64, p_cell_resolution); Vector bitmaps; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 8b5658423b..1114ae9bb5 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -409,6 +409,7 @@ void EditorAudioBus::_solo_toggled() { updating_bus = false; } + void EditorAudioBus::_mute_toggled() { updating_bus = true; @@ -422,6 +423,7 @@ void EditorAudioBus::_mute_toggled() { updating_bus = false; } + void EditorAudioBus::_bypass_toggled() { updating_bus = true; diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 6f6a863b70..45c44a3a2b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -137,6 +137,7 @@ void EditorHistory::add_object(ObjectID p_object, int p_relevel) { int EditorHistory::get_history_len() { return history.size(); } + int EditorHistory::get_history_pos() { return current; } @@ -156,6 +157,7 @@ ObjectID EditorHistory::get_history_obj(int p_obj) const { bool EditorHistory::is_at_beginning() const { return current <= 0; } + bool EditorHistory::is_at_end() const { return ((current + 1) >= history.size()); } @@ -189,6 +191,7 @@ bool EditorHistory::is_current_inspector_only() const { const History &h = history[current]; return h.path[h.level].inspector_only; } + ObjectID EditorHistory::get_current() { if (current < 0 || current >= history.size()) return ObjectID(); @@ -424,6 +427,7 @@ void EditorData::add_editor_plugin(EditorPlugin *p_plugin) { int EditorData::get_editor_plugin_count() const { return editor_plugins.size(); } + EditorPlugin *EditorData::get_editor_plugin(int p_idx) { ERR_FAIL_INDEX_V(p_idx, editor_plugins.size(), nullptr); return editor_plugins[p_idx]; @@ -605,11 +609,13 @@ bool EditorData::check_and_update_scene(int p_idx) { int EditorData::get_edited_scene() const { return current_edited_scene; } + void EditorData::set_edited_scene(int p_idx) { ERR_FAIL_INDEX(p_idx, edited_scene.size()); current_edited_scene = p_idx; //swap } + Node *EditorData::get_edited_scene_root(int p_idx) { if (p_idx < 0) { ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), nullptr); @@ -619,6 +625,7 @@ Node *EditorData::get_edited_scene_root(int p_idx) { return edited_scene[p_idx].root; } } + void EditorData::set_edited_scene_root(Node *p_root) { ERR_FAIL_INDEX(current_edited_scene, edited_scene.size()); edited_scene.write[current_edited_scene].root = p_root; @@ -658,6 +665,7 @@ uint64_t EditorData::get_edited_scene_version() const { ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), 0); return edited_scene[current_edited_scene].version; } + uint64_t EditorData::get_scene_version(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0); return edited_scene[p_idx].version; @@ -669,6 +677,7 @@ String EditorData::get_scene_type(int p_idx) const { return ""; return edited_scene[p_idx].root->get_class(); } + void EditorData::move_edited_scene_to_index(int p_idx) { ERR_FAIL_INDEX(current_edited_scene, edited_scene.size()); ERR_FAIL_INDEX(p_idx, edited_scene.size()); @@ -735,6 +744,7 @@ void EditorData::set_edited_scene_live_edit_root(const NodePath &p_root) { edited_scene.write[current_edited_scene].live_edit_root = p_root; } + NodePath EditorData::get_edited_scene_live_edit_root() { ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), String()); @@ -962,6 +972,7 @@ void EditorSelection::remove_node(Node *p_node) { p_node->disconnect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed)); //emit_signal("selection_changed"); } + bool EditorSelection::is_selected(Node *p_node) const { return selection.has(p_node); } @@ -1068,6 +1079,7 @@ void EditorSelection::clear() { changed = true; nl_changed = true; } + EditorSelection::EditorSelection() { emitted = false; changed = false; diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 476f9bcfea..46740a0f6d 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -190,6 +190,7 @@ void EditorExportPreset::set_patch(int p_index, const String &p_path) { patches.write[p_index] = p_path; EditorExport::singleton->save_presets(); } + String EditorExportPreset::get_patch(int p_index) { ERR_FAIL_INDEX_V(p_index, patches.size(), String()); return patches[p_index]; @@ -1082,6 +1083,7 @@ void EditorExportPlatform::gen_export_flags(Vector &r_flags, int p_flags r_flags.push_back("--debug-navigation"); } } + EditorExportPlatform::EditorExportPlatform() { } @@ -1375,6 +1377,7 @@ String EditorExportPlatformPC::get_name() const { String EditorExportPlatformPC::get_os_name() const { return os_name; } + Ref EditorExportPlatformPC::get_logo() const { return logo; } @@ -1534,9 +1537,11 @@ void EditorExportPlatformPC::set_release_64(const String &p_file) { void EditorExportPlatformPC::set_release_32(const String &p_file) { release_file_32 = p_file; } + void EditorExportPlatformPC::set_debug_64(const String &p_file) { debug_file_64 = p_file; } + void EditorExportPlatformPC::set_debug_32(const String &p_file) { debug_file_32 = p_file; } diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 7c8d9ff08f..f8c1c490d5 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -100,6 +100,7 @@ void EditorFeatureProfile::set_disable_class_property(const StringName &p_class, } } } + bool EditorFeatureProfile::is_class_property_disabled(const StringName &p_class, const StringName &p_property) const { if (!disabled_properties.has(p_class)) { return false; @@ -120,6 +121,7 @@ void EditorFeatureProfile::set_disable_feature(Feature p_feature, bool p_disable ERR_FAIL_INDEX(p_feature, FEATURE_MAX); features_disabled[p_feature] = p_disable; } + bool EditorFeatureProfile::is_feature_disabled(Feature p_feature) const { ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, false); return features_disabled[p_feature]; diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 561ebb6298..3b1c4d380a 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -506,6 +506,7 @@ void EditorFileDialog::_push_history() { dir_next->set_disabled(true); } } + void EditorFileDialog::_item_dc_selected(int p_item) { int current = p_item; if (current < 0 || current >= item_list->get_item_count()) @@ -877,6 +878,7 @@ void EditorFileDialog::clear_filters() { update_filters(); invalidate(); } + void EditorFileDialog::add_filter(const String &p_filter) { filters.push_back(p_filter); update_filters(); @@ -886,12 +888,15 @@ void EditorFileDialog::add_filter(const String &p_filter) { String EditorFileDialog::get_current_dir() const { return dir_access->get_current_dir(); } + String EditorFileDialog::get_current_file() const { return file->get_text(); } + String EditorFileDialog::get_current_path() const { return dir_access->get_current_dir().plus_file(file->get_text()); } + void EditorFileDialog::set_current_dir(const String &p_dir) { if (p_dir.is_rel_path()) dir_access->change_dir(OS::get_singleton()->get_resource_dir()); @@ -899,6 +904,7 @@ void EditorFileDialog::set_current_dir(const String &p_dir) { update_dir(); invalidate(); } + void EditorFileDialog::set_current_file(const String &p_file) { file->set_text(p_file); update_dir(); @@ -912,6 +918,7 @@ void EditorFileDialog::set_current_file(const String &p_file) { if (is_visible()) _request_single_thumbnail(get_current_dir().plus_file(get_current_file())); } + void EditorFileDialog::set_current_path(const String &p_path) { if (!p_path.size()) return; @@ -1110,6 +1117,7 @@ void EditorFileDialog::_favorite_move_up() { update_file_list(); } } + void EditorFileDialog::_favorite_move_down() { int current = favorites->get_current(); @@ -1237,6 +1245,7 @@ void EditorFileDialog::_go_back() { dir_prev->set_disabled(local_history_pos == 0); dir_next->set_disabled(local_history_pos == local_history.size() - 1); } + void EditorFileDialog::_go_forward() { if (local_history_pos == local_history.size() - 1) { return; diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index acfb554766..77ba5b3f1d 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -56,6 +56,7 @@ int EditorFileSystemDirectory::find_file_index(const String &p_file) const { } return -1; } + int EditorFileSystemDirectory::find_dir_index(const String &p_dir) const { for (int i = 0; i < subdirs.size(); i++) { if (subdirs[i]->name == p_dir) @@ -1110,6 +1111,7 @@ void EditorFileSystem::_notification(int p_what) { bool EditorFileSystem::is_scanning() const { return scanning || scanning_changes; } + float EditorFileSystem::get_scanning_progress() const { return scan_total; } diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 270495ff55..a1d65ac739 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -127,6 +127,7 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p _fill_folds(p_root, p_node->get_child(i), p_folds, resource_folds, nodes_folded, resources); } } + void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path) { ERR_FAIL_NULL(p_scene); @@ -150,6 +151,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file); config->save(file); } + void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) { Ref config; config.instance(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 31eead83de..16e49ad4e1 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1474,6 +1474,7 @@ void EditorHelp::search_again(bool p_search_previous) { int EditorHelp::get_scroll() const { return class_desc->get_v_scroll()->get_value(); } + void EditorHelp::set_scroll(int p_scroll) { class_desc->get_v_scroll()->set_value(p_scroll); } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index f7d92050e1..0e39d0f2ab 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -532,6 +532,7 @@ bool EditorProperty::use_keying_next() const { return false; } + void EditorProperty::set_checkable(bool p_checkable) { checkable = p_checkable; update(); @@ -737,9 +738,11 @@ void EditorProperty::_gui_input(const Ref &p_event) { void EditorProperty::set_label_reference(Control *p_control) { label_reference = p_control; } + void EditorProperty::set_bottom_editor(Control *p_control) { bottom_editor = p_control; } + Variant EditorProperty::get_drag_data(const Point2 &p_point) { if (property == StringName()) return Variant(); @@ -898,6 +901,7 @@ EditorProperty::EditorProperty() { label_reference = nullptr; bottom_editor = nullptr; } + //////////////////////////////////////////////// //////////////////////////////////////////////// @@ -930,6 +934,7 @@ bool EditorInspectorPlugin::can_handle(Object *p_object) { } return false; } + void EditorInspectorPlugin::parse_begin(Object *p_object) { if (get_script_instance()) { get_script_instance()->call("parse_begin", p_object); @@ -956,6 +961,7 @@ bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_typ } return false; } + void EditorInspectorPlugin::parse_end() { if (get_script_instance()) { get_script_instance()->call("parse_end"); @@ -1826,6 +1832,7 @@ void EditorInspector::update_tree() { //see if this property exists and should be kept } + void EditorInspector::update_property(const String &p_prop) { if (!editor_property_map.has(p_prop)) return; @@ -1884,6 +1891,7 @@ void EditorInspector::set_keying(bool p_active) { keying = p_active; update_tree(); } + void EditorInspector::set_read_only(bool p_read_only) { read_only = p_read_only; update_tree(); @@ -1892,6 +1900,7 @@ void EditorInspector::set_read_only(bool p_read_only) { bool EditorInspector::is_capitalize_paths_enabled() const { return capitalize_paths; } + void EditorInspector::set_enable_capitalize_paths(bool p_capitalize) { capitalize_paths = p_capitalize; update_tree(); @@ -1910,14 +1919,17 @@ void EditorInspector::set_use_doc_hints(bool p_enable) { use_doc_hints = p_enable; update_tree(); } + void EditorInspector::set_hide_script(bool p_hide) { hide_script = p_hide; update_tree(); } + void EditorInspector::set_use_filter(bool p_use) { use_filter = p_use; update_tree(); } + void EditorInspector::register_text_enter(Node *p_line_edit) { search_box = Object::cast_to(p_line_edit); if (search_box) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b975d555af..c8f07f4b8d 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3250,9 +3250,11 @@ ImportDock *EditorNode::get_import_dock() { FileSystemDock *EditorNode::get_filesystem_dock() { return filesystem_dock; } + SceneTreeDock *EditorNode::get_scene_tree_dock() { return scene_tree_dock; } + InspectorDock *EditorNode::get_inspector_dock() { return inspector_dock; } diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 7bffdc5744..f731a87cef 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -553,6 +553,7 @@ void EditorPlugin::forward_spatial_force_draw_over_viewport(Control *p_overlay) get_script_instance()->call("forward_spatial_force_draw_over_viewport", p_overlay); } } + String EditorPlugin::get_name() const { if (get_script_instance() && get_script_instance()->has_method("get_plugin_name")) { return get_script_instance()->call("get_plugin_name"); @@ -560,6 +561,7 @@ String EditorPlugin::get_name() const { return String(); } + const Ref EditorPlugin::get_icon() const { if (get_script_instance() && get_script_instance()->has_method("get_plugin_icon")) { return get_script_instance()->call("get_plugin_icon"); @@ -567,6 +569,7 @@ const Ref EditorPlugin::get_icon() const { return Ref(); } + bool EditorPlugin::has_main_screen() const { if (get_script_instance() && get_script_instance()->has_method("has_main_screen")) { return get_script_instance()->call("has_main_screen"); @@ -574,6 +577,7 @@ bool EditorPlugin::has_main_screen() const { return false; } + void EditorPlugin::make_visible(bool p_visible) { if (get_script_instance() && get_script_instance()->has_method("make_visible")) { get_script_instance()->call("make_visible", p_visible); @@ -597,6 +601,7 @@ bool EditorPlugin::handles(Object *p_object) const { return false; } + Dictionary EditorPlugin::get_state() const { if (get_script_instance() && get_script_instance()->has_method("get_state")) { return get_script_instance()->call("get_state"); @@ -638,6 +643,7 @@ void EditorPlugin::get_breakpoints(List *p_breakpoints) { p_breakpoints->push_back(arr[i]); } } + bool EditorPlugin::get_remove_list(List *p_list) { return false; } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 9bb20122c6..e5ca5d95e8 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -82,6 +82,7 @@ void EditorPropertyText::update_property() { void EditorPropertyText::set_string_name(bool p_enabled) { string_name = p_enabled; } + void EditorPropertyText::set_placeholder(const String &p_string) { text->set_placeholder(p_string); } @@ -209,12 +210,14 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { add_focusable(options); options->connect("item_selected", callable_mp(this, &EditorPropertyTextEnum::_option_selected)); } + ///////////////////// PATH ///////////////////////// void EditorPropertyPath::_path_selected(const String &p_path) { emit_changed(get_edited_property(), p_path); update_property(); } + void EditorPropertyPath::_path_pressed() { if (!dialog) { dialog = memnew(EditorFileDialog); @@ -1158,6 +1161,7 @@ void EditorPropertyRect2::update_property() { spin[3]->set_value(val.size.y); setting = false; } + void EditorPropertyRect2::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1168,6 +1172,7 @@ void EditorPropertyRect2::_notification(int p_what) { } } } + void EditorPropertyRect2::_bind_methods() { } @@ -1239,6 +1244,7 @@ void EditorPropertyVector3::update_property() { spin[2]->set_value(val.z); setting = false; } + void EditorPropertyVector3::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1249,6 +1255,7 @@ void EditorPropertyVector3::_notification(int p_what) { } } } + void EditorPropertyVector3::_bind_methods() { } @@ -1403,6 +1410,7 @@ void EditorPropertyRect2i::update_property() { spin[3]->set_value(val.size.y); setting = false; } + void EditorPropertyRect2i::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1413,6 +1421,7 @@ void EditorPropertyRect2i::_notification(int p_what) { } } } + void EditorPropertyRect2i::_bind_methods() { } @@ -1484,6 +1493,7 @@ void EditorPropertyVector3i::update_property() { spin[2]->set_value(val.z); setting = false; } + void EditorPropertyVector3i::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1494,6 +1504,7 @@ void EditorPropertyVector3i::_notification(int p_what) { } } } + void EditorPropertyVector3i::_bind_methods() { } @@ -1566,6 +1577,7 @@ void EditorPropertyPlane::update_property() { spin[3]->set_value(val.d); setting = false; } + void EditorPropertyPlane::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1576,6 +1588,7 @@ void EditorPropertyPlane::_notification(int p_what) { } } } + void EditorPropertyPlane::_bind_methods() { } @@ -1649,6 +1662,7 @@ void EditorPropertyQuat::update_property() { spin[3]->set_value(val.w); setting = false; } + void EditorPropertyQuat::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1659,6 +1673,7 @@ void EditorPropertyQuat::_notification(int p_what) { } } } + void EditorPropertyQuat::_bind_methods() { } @@ -1735,6 +1750,7 @@ void EditorPropertyAABB::update_property() { setting = false; } + void EditorPropertyAABB::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1745,6 +1761,7 @@ void EditorPropertyAABB::_notification(int p_what) { } } } + void EditorPropertyAABB::_bind_methods() { } @@ -1808,6 +1825,7 @@ void EditorPropertyTransform2D::update_property() { setting = false; } + void EditorPropertyTransform2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1818,6 +1836,7 @@ void EditorPropertyTransform2D::_notification(int p_what) { } } } + void EditorPropertyTransform2D::_bind_methods() { } @@ -1886,6 +1905,7 @@ void EditorPropertyBasis::update_property() { setting = false; } + void EditorPropertyBasis::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1896,6 +1916,7 @@ void EditorPropertyBasis::_notification(int p_what) { } } } + void EditorPropertyBasis::_bind_methods() { } @@ -1970,6 +1991,7 @@ void EditorPropertyTransform::update_property() { setting = false; } + void EditorPropertyTransform::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); @@ -1980,6 +2002,7 @@ void EditorPropertyTransform::_notification(int p_what) { } } } + void EditorPropertyTransform::_bind_methods() { } @@ -2913,6 +2936,7 @@ bool EditorPropertyResource::_is_drop_valid(const Dictionary &p_drag_data) const bool EditorPropertyResource::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { return _is_drop_valid(p_data); } + void EditorPropertyResource::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { ERR_FAIL_COND(!_is_drop_valid(p_data)); diff --git a/editor/editor_scale.cpp b/editor/editor_scale.cpp index 6a26cc6401..450de75328 100644 --- a/editor/editor_scale.cpp +++ b/editor/editor_scale.cpp @@ -37,6 +37,7 @@ static float scale = 1.0; void editor_set_scale(float p_scale) { scale = p_scale; } + float editor_get_scale() { return scale; } diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 61860d2376..fb12c15913 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -382,6 +382,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_ return; } } + void ExportTemplateManager::_http_download_templates_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) { switch (p_status) { case HTTPRequest::RESULT_CANT_RESOLVE: { diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 0f3faf4189..54b4dc2972 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1607,9 +1607,11 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones uint32_t EditorSceneImporterCollada::get_import_flags() const { return IMPORT_SCENE | IMPORT_ANIMATION; } + void EditorSceneImporterCollada::get_extensions(List *r_extensions) const { r_extensions->push_back("dae"); } + Node *EditorSceneImporterCollada::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps, Error *r_err) { ColladaImport state; uint32_t flags = Collada::IMPORT_FLAG_SCENE; diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index c4bf9189f1..3c9f04322e 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -46,6 +46,7 @@ uint32_t EditorSceneImporterGLTF::get_import_flags() const { return IMPORT_SCENE | IMPORT_ANIMATION; } + void EditorSceneImporterGLTF::get_extensions(List *r_extensions) const { r_extensions->push_back("gltf"); r_extensions->push_back("glb"); @@ -874,6 +875,7 @@ Vector EditorSceneImporterGLTF::_decode_accessor_as_quat(GLTFState &state, } return ret; } + Vector EditorSceneImporterGLTF::_decode_accessor_as_xform2d(GLTFState &state, const GLTFAccessorIndex p_accessor, const bool p_for_vertex) { const Vector attribs = _decode_accessor(state, p_accessor, p_for_vertex); Vector ret; diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp index 05a3bfc386..5e52a95e4e 100644 --- a/editor/import/resource_importer_bitmask.cpp +++ b/editor/import/resource_importer_bitmask.cpp @@ -44,9 +44,11 @@ String ResourceImporterBitMap::get_importer_name() const { String ResourceImporterBitMap::get_visible_name() const { return "BitMap"; } + void ResourceImporterBitMap::get_recognized_extensions(List *p_extensions) const { ImageLoader::get_recognized_extensions(p_extensions); } + String ResourceImporterBitMap::get_save_extension() const { return "res"; } @@ -62,6 +64,7 @@ bool ResourceImporterBitMap::get_option_visibility(const String &p_option, const int ResourceImporterBitMap::get_preset_count() const { return 0; } + String ResourceImporterBitMap::get_preset_name(int p_idx) const { return String(); } diff --git a/editor/import/resource_importer_csv.cpp b/editor/import/resource_importer_csv.cpp index e56cb1d3a1..d29ba28a96 100644 --- a/editor/import/resource_importer_csv.cpp +++ b/editor/import/resource_importer_csv.cpp @@ -40,6 +40,7 @@ String ResourceImporterCSV::get_importer_name() const { String ResourceImporterCSV::get_visible_name() const { return "CSV"; } + void ResourceImporterCSV::get_recognized_extensions(List *p_extensions) const { p_extensions->push_back("csv"); } @@ -59,6 +60,7 @@ bool ResourceImporterCSV::get_option_visibility(const String &p_option, const Ma int ResourceImporterCSV::get_preset_count() const { return 0; } + String ResourceImporterCSV::get_preset_name(int p_idx) const { return ""; } diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index 09f2d691f0..04e20dee86 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -42,6 +42,7 @@ String ResourceImporterCSVTranslation::get_importer_name() const { String ResourceImporterCSVTranslation::get_visible_name() const { return "CSV Translation"; } + void ResourceImporterCSVTranslation::get_recognized_extensions(List *p_extensions) const { p_extensions->push_back("csv"); } @@ -61,6 +62,7 @@ bool ResourceImporterCSVTranslation::get_option_visibility(const String &p_optio int ResourceImporterCSVTranslation::get_preset_count() const { return 0; } + String ResourceImporterCSVTranslation::get_preset_name(int p_idx) const { return ""; } diff --git a/editor/import/resource_importer_image.cpp b/editor/import/resource_importer_image.cpp index 927d911e94..885b00865b 100644 --- a/editor/import/resource_importer_image.cpp +++ b/editor/import/resource_importer_image.cpp @@ -42,6 +42,7 @@ String ResourceImporterImage::get_importer_name() const { String ResourceImporterImage::get_visible_name() const { return "Image"; } + void ResourceImporterImage::get_recognized_extensions(List *p_extensions) const { ImageLoader::get_recognized_extensions(p_extensions); } @@ -61,6 +62,7 @@ bool ResourceImporterImage::get_option_visibility(const String &p_option, const int ResourceImporterImage::get_preset_count() const { return 0; } + String ResourceImporterImage::get_preset_name(int p_idx) const { return String(); } diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index 18c6dc149b..2c9e7dcd3b 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -76,9 +76,11 @@ String ResourceImporterLayeredTexture::get_visible_name() const { ERR_FAIL_V(""); } + void ResourceImporterLayeredTexture::get_recognized_extensions(List *p_extensions) const { ImageLoader::get_recognized_extensions(p_extensions); } + String ResourceImporterLayeredTexture::get_save_extension() const { switch (mode) { case MODE_CUBEMAP: { @@ -126,6 +128,7 @@ bool ResourceImporterLayeredTexture::get_option_visibility(const String &p_optio int ResourceImporterLayeredTexture::get_preset_count() const { return 0; } + String ResourceImporterLayeredTexture::get_preset_name(int p_idx) const { return ""; } diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 73150c8516..4316a9b512 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -435,6 +435,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in return scene; } + Ref EditorOBJImporter::import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps) { return Ref(); } @@ -445,20 +446,25 @@ void EditorOBJImporter::get_extensions(List *r_extensions) const { EditorOBJImporter::EditorOBJImporter() { } + //////////////////////////////////////////////////// String ResourceImporterOBJ::get_importer_name() const { return "wavefront_obj"; } + String ResourceImporterOBJ::get_visible_name() const { return "OBJ As Mesh"; } + void ResourceImporterOBJ::get_recognized_extensions(List *p_extensions) const { p_extensions->push_back("obj"); } + String ResourceImporterOBJ::get_save_extension() const { return "mesh"; } + String ResourceImporterOBJ::get_resource_type() const { return "Mesh"; } @@ -466,6 +472,7 @@ String ResourceImporterOBJ::get_resource_type() const { int ResourceImporterOBJ::get_preset_count() const { return 0; } + String ResourceImporterOBJ::get_preset_name(int p_idx) const { return ""; } @@ -476,6 +483,7 @@ void ResourceImporterOBJ::get_import_options(List *r_options, int r_options->push_back(ImportOption(PropertyInfo(Variant::VECTOR3, "offset_mesh"), Vector3(0, 0, 0))); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "optimize_mesh"), true)); } + bool ResourceImporterOBJ::get_option_visibility(const String &p_option, const Map &p_options) const { return true; } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 012e3e95a7..f4fb0f9f0c 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -53,6 +53,7 @@ uint32_t EditorSceneImporter::get_import_flags() const { ERR_FAIL_V(0); } + void EditorSceneImporter::get_extensions(List *r_extensions) const { if (get_script_instance()) { Array arr = get_script_instance()->call("_get_extensions"); @@ -64,6 +65,7 @@ void EditorSceneImporter::get_extensions(List *r_extensions) const { ERR_FAIL(); } + Node *EditorSceneImporter::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps, Error *r_err) { if (get_script_instance()) { return get_script_instance()->call("_import_scene", p_path, p_flags, p_bake_fps); @@ -202,6 +204,7 @@ bool ResourceImporterScene::get_option_visibility(const String &p_option, const int ResourceImporterScene::get_preset_count() const { return PRESET_MAX; } + String ResourceImporterScene::get_preset_name(int p_idx) const { switch (p_idx) { case PRESET_SINGLE_SCENE: @@ -1520,14 +1523,17 @@ ResourceImporterScene *ResourceImporterScene::singleton = nullptr; ResourceImporterScene::ResourceImporterScene() { singleton = this; } + /////////////////////////////////////// uint32_t EditorSceneImporterESCN::get_import_flags() const { return IMPORT_SCENE; } + void EditorSceneImporterESCN::get_extensions(List *r_extensions) const { r_extensions->push_back("escn"); } + Node *EditorSceneImporterESCN::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps, Error *r_err) { Error error; Ref ps = ResourceFormatLoaderText::singleton->load(p_path, p_path, &error); @@ -1538,6 +1544,7 @@ Node *EditorSceneImporterESCN::import_scene(const String &p_path, uint32_t p_fla return scene; } + Ref EditorSceneImporterESCN::import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps) { ERR_FAIL_V(Ref()); } diff --git a/editor/import/resource_importer_shader_file.cpp b/editor/import/resource_importer_shader_file.cpp index 0813bca6f1..a2e80dfa18 100644 --- a/editor/import/resource_importer_shader_file.cpp +++ b/editor/import/resource_importer_shader_file.cpp @@ -44,9 +44,11 @@ String ResourceImporterShaderFile::get_importer_name() const { String ResourceImporterShaderFile::get_visible_name() const { return "GLSL Shader File"; } + void ResourceImporterShaderFile::get_recognized_extensions(List *p_extensions) const { p_extensions->push_back("glsl"); } + String ResourceImporterShaderFile::get_save_extension() const { return "res"; } @@ -58,6 +60,7 @@ String ResourceImporterShaderFile::get_resource_type() const { int ResourceImporterShaderFile::get_preset_count() const { return 0; } + String ResourceImporterShaderFile::get_preset_name(int p_idx) const { return String(); } @@ -68,6 +71,7 @@ void ResourceImporterShaderFile::get_import_options(List *r_option bool ResourceImporterShaderFile::get_option_visibility(const String &p_option, const Map &p_options) const { return true; } + static String _include_function(const String &p_path, void *userpointer) { Error err; diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index aeeae36f5b..ab23ab6db6 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -140,9 +140,11 @@ String ResourceImporterTexture::get_importer_name() const { String ResourceImporterTexture::get_visible_name() const { return "Texture2D"; } + void ResourceImporterTexture::get_recognized_extensions(List *p_extensions) const { ImageLoader::get_recognized_extensions(p_extensions); } + String ResourceImporterTexture::get_save_extension() const { return "stex"; } @@ -181,6 +183,7 @@ bool ResourceImporterTexture::get_option_visibility(const String &p_option, cons int ResourceImporterTexture::get_preset_count() const { return 4; } + String ResourceImporterTexture::get_preset_name(int p_idx) const { static const char *preset_names[] = { "2D, Detect 3D", diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 314c27b8e4..0ef5d84eca 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -45,6 +45,7 @@ String ResourceImporterTextureAtlas::get_importer_name() const { String ResourceImporterTextureAtlas::get_visible_name() const { return "TextureAtlas"; } + void ResourceImporterTextureAtlas::get_recognized_extensions(List *p_extensions) const { ImageLoader::get_recognized_extensions(p_extensions); } @@ -64,6 +65,7 @@ bool ResourceImporterTextureAtlas::get_option_visibility(const String &p_option, int ResourceImporterTextureAtlas::get_preset_count() const { return 0; } + String ResourceImporterTextureAtlas::get_preset_name(int p_idx) const { return String(); } diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 3ffc7b34af..eace84400a 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -45,9 +45,11 @@ String ResourceImporterWAV::get_importer_name() const { String ResourceImporterWAV::get_visible_name() const { return "Microsoft WAV"; } + void ResourceImporterWAV::get_recognized_extensions(List *p_extensions) const { p_extensions->push_back("wav"); } + String ResourceImporterWAV::get_save_extension() const { return "sample"; } @@ -67,6 +69,7 @@ bool ResourceImporterWAV::get_option_visibility(const String &p_option, const Ma int ResourceImporterWAV::get_preset_count() const { return 0; } + String ResourceImporterWAV::get_preset_name(int p_idx) const { return String(); } diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 2d8069acea..4a3011086f 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -384,6 +384,7 @@ static bool _find_owners(EditorFileSystemDirectory *efsd, const String &p_path) return false; } + void ImportDock::_reimport_attempt() { bool need_restart = false; bool used_in_resources = false; @@ -484,6 +485,7 @@ void ImportDock::_property_toggled(const StringName &p_prop, bool p_checked) { params->checked.erase(p_prop); } } + void ImportDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_reimport"), &ImportDock::_reimport); } diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index ab425aab40..8ada7e9ba5 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -287,6 +287,7 @@ void InspectorDock::_edit_forward() { if (EditorNode::get_singleton()->get_editor_history()->next()) editor->edit_current(); } + void InspectorDock::_edit_back() { EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); if ((current && editor_history->previous()) || editor_history->get_path_size() == 1) diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 2bdc0b12e9..20b84f9358 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -2117,6 +2117,7 @@ Variant VisibilityNotifier3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_g VisibilityNotifier3D *notifier = Object::cast_to(p_gizmo->get_spatial_node()); return notifier->get_aabb(); } + void VisibilityNotifier3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { VisibilityNotifier3D *notifier = Object::cast_to(p_gizmo->get_spatial_node()); @@ -2302,10 +2303,12 @@ String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_giz return ""; } + Variant GPUParticles3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { GPUParticles3D *particles = Object::cast_to(p_gizmo->get_spatial_node()); return particles->get_visibility_aabb(); } + void GPUParticles3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { GPUParticles3D *particles = Object::cast_to(p_gizmo->get_spatial_node()); @@ -2418,6 +2421,7 @@ void GPUParticles3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_handles(handles, get_material("handles")); p_gizmo->add_unscaled_billboard(icon, 0.05); } + //// ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() { @@ -2465,10 +2469,12 @@ String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gi return ""; } + Variant ReflectionProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { ReflectionProbe *probe = Object::cast_to(p_gizmo->get_spatial_node()); return AABB(probe->get_extents(), probe->get_origin_offset()); } + void ReflectionProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { ReflectionProbe *probe = Object::cast_to(p_gizmo->get_spatial_node()); Transform gt = probe->get_global_transform(); @@ -2604,6 +2610,7 @@ void ReflectionProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_unscaled_billboard(icon, 0.05); p_gizmo->add_handles(handles, get_material("handles")); } + /////////////////////////////// //// @@ -2640,10 +2647,12 @@ String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p return ""; } + Variant DecalGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { Decal *decal = Object::cast_to(p_gizmo->get_spatial_node()); return decal->get_extents(); } + void DecalGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { Decal *decal = Object::cast_to(p_gizmo->get_spatial_node()); Transform gt = decal->get_global_transform(); @@ -2778,10 +2787,12 @@ String GIProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int return ""; } + Variant GIProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { GIProbe *probe = Object::cast_to(p_gizmo->get_spatial_node()); return probe->get_extents(); } + void GIProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { GIProbe *probe = Object::cast_to(p_gizmo->get_spatial_node()); @@ -2935,9 +2946,11 @@ BakedLightmapGizmoPlugin::BakedLightmapGizmoPlugin() { String BakedLightmapGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { return ""; } + Variant BakedLightmapGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { return Variant(); } + void BakedLightmapGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { } @@ -3102,6 +3115,7 @@ void BakedLightmapGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_mesh(mesh); } + ///////// LightmapProbeGizmoPlugin::LightmapProbeGizmoPlugin() { @@ -3114,9 +3128,11 @@ LightmapProbeGizmoPlugin::LightmapProbeGizmoPlugin() { String LightmapProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { return ""; } + Variant LightmapProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const { return Variant(); } + void LightmapProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { } @@ -3195,6 +3211,7 @@ void LightmapProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->add_lines(lines, material_lines); } + //// CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() { @@ -3282,6 +3299,7 @@ Variant CollisionShape3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo return Variant(); } + void CollisionShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) { CollisionShape3D *cs = Object::cast_to(p_gizmo->get_spatial_node()); @@ -3389,6 +3407,7 @@ void CollisionShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_i cs2->set_height(d * 2.0); } } + void CollisionShape3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { CollisionShape3D *cs = Object::cast_to(p_gizmo->get_spatial_node()); @@ -3490,6 +3509,7 @@ void CollisionShape3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int ur->commit_action(); } } + void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { CollisionShape3D *cs = Object::cast_to(p_gizmo->get_spatial_node()); diff --git a/editor/pane_drag.cpp b/editor/pane_drag.cpp index 0f21a2af88..8cadc3925e 100644 --- a/editor/pane_drag.cpp +++ b/editor/pane_drag.cpp @@ -55,6 +55,7 @@ void PaneDrag::_notification(int p_what) { break; } } + Size2 PaneDrag::get_minimum_size() const { Ref icon = get_theme_icon("PaneDrag", "EditorIcons"); if (!icon.is_null()) diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index aba2d53eba..28d0e113d4 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -237,6 +237,7 @@ void AnimationPlayerEditor::_play_bw_from_pressed() { //unstop stop->set_pressed(false); } + void AnimationPlayerEditor::_stop_pressed() { if (!player) { return; @@ -305,6 +306,7 @@ void AnimationPlayerEditor::_animation_new() { name->select_all(); name->grab_focus(); } + void AnimationPlayerEditor::_animation_rename() { if (animation->get_item_count() == 0) return; @@ -318,6 +320,7 @@ void AnimationPlayerEditor::_animation_rename() { name->select_all(); name->grab_focus(); } + void AnimationPlayerEditor::_animation_load() { ERR_FAIL_COND(!player); file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); @@ -626,6 +629,7 @@ Dictionary AnimationPlayerEditor::get_state() const { return d; } + void AnimationPlayerEditor::set_state(const Dictionary &p_state) { if (!p_state.has("visible") || !p_state["visible"]) { return; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index ce41be7f28..bcd393957c 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1166,6 +1166,7 @@ void AnimationNodeStateMachineEditor::_end_selected() { state_machine_draw->update(); } } + void AnimationNodeStateMachineEditor::_update_mode() { if (tool_select->is_pressed()) { tool_erase_hb->show(); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 5ec76d8471..ad2164b719 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -72,6 +72,7 @@ void EditorAssetLibraryItem::_asset_clicked() { void EditorAssetLibraryItem::_category_clicked() { emit_signal("category_selected", category_id); } + void EditorAssetLibraryItem::_author_clicked() { emit_signal("author_selected", author_id); } @@ -297,6 +298,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { get_ok()->set_text(TTR("Download")); get_cancel()->set_text(TTR("Close")); } + /////////////////////////////////////////////////////////////////////////////////// void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) { @@ -437,6 +439,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) { } break; } } + void EditorAssetLibraryItemDownload::_close() { // Clean up downloaded file. DirAccess::remove_file_or_error(download->get_download_file()); @@ -650,6 +653,7 @@ void EditorAssetLibrary::_select_category(int p_id) { } } } + void EditorAssetLibrary::_select_asset(int p_id) { _api_request("asset/" + itos(p_id), REQUESTING_ASSET); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 0f794d0f48..2d7198bec8 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4334,6 +4334,7 @@ void CanvasItemEditor::_button_toggle_grid_snap(bool p_status) { grid_snap_active = p_status; viewport->update(); } + void CanvasItemEditor::_button_override_camera(bool p_pressed) { EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton(); @@ -5762,6 +5763,7 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) { Dictionary CanvasItemEditorPlugin::get_state() const { return canvas_item_editor->get_state(); } + void CanvasItemEditorPlugin::set_state(const Dictionary &p_state) { canvas_item_editor->set_state(p_state); } diff --git a/editor/plugins/collision_polygon_3d_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp index 9619a97807..920a7f195a 100644 --- a/editor/plugins/collision_polygon_3d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp @@ -60,6 +60,7 @@ void CollisionPolygon3DEditor::_notification(int p_what) { } break; } } + void CollisionPolygon3DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = nullptr; diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 4895696f36..0c0f014af6 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -183,6 +183,7 @@ EditorImagePreviewPlugin::EditorImagePreviewPlugin() { bool EditorImagePreviewPlugin::generate_small_preview_automatically() const { return true; } + //////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////// bool EditorBitmapPreviewPlugin::handles(const String &p_type) const { @@ -572,6 +573,7 @@ Ref EditorScriptPreviewPlugin::generate(const RES &p_from, const Size EditorScriptPreviewPlugin::EditorScriptPreviewPlugin() { } + /////////////////////////////////////////////////////////////////// bool EditorAudioStreamPreviewPlugin::handles(const String &p_type) const { @@ -665,6 +667,7 @@ void EditorMeshPreviewPlugin::_preview_done(const Variant &p_udata) { void EditorMeshPreviewPlugin::_bind_methods() { ClassDB::bind_method("_preview_done", &EditorMeshPreviewPlugin::_preview_done); } + bool EditorMeshPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "Mesh"); //any Mesh } diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 6c0ce699ac..1ccfeccf7a 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -37,6 +37,7 @@ Size2 GradientEditor::get_minimum_size() const { return Size2(0, 60) * EDSCALE; } + void GradientEditor::_gradient_changed() { if (editing) return; diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index 77f60b6677..2829b9bd5b 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -96,6 +96,7 @@ bool ItemListPlugin::_get(const StringName &p_name, Variant &r_ret) const { return true; } + void ItemListPlugin::_get_property_list(List *p_list) const { for (int i = 0; i < get_item_count(); i++) { String base = itos(i) + "/"; diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 2e61ff59fd..992f080cec 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -239,10 +239,12 @@ MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) { String StandardMaterial3DConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool StandardMaterial3DConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref StandardMaterial3DConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); @@ -281,10 +283,12 @@ Ref StandardMaterial3DConversionPlugin::convert(const Ref &p String ParticlesMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool ParticlesMaterialConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref ParticlesMaterialConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); @@ -316,10 +320,12 @@ Ref ParticlesMaterialConversionPlugin::convert(const Ref &p_ String CanvasItemMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool CanvasItemMaterialConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref CanvasItemMaterialConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); @@ -351,10 +357,12 @@ Ref CanvasItemMaterialConversionPlugin::convert(const Ref &p String ProceduralSkyMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool ProceduralSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref ProceduralSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); @@ -386,10 +394,12 @@ Ref ProceduralSkyMaterialConversionPlugin::convert(const Ref String PanoramaSkyMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool PanoramaSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref PanoramaSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); @@ -421,10 +431,12 @@ Ref PanoramaSkyMaterialConversionPlugin::convert(const Ref & String PhysicalSkyMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } + bool PhysicalSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { Ref mat = p_resource; return mat.is_valid(); } + Ref PhysicalSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { Ref mat = p_resource; ERR_FAIL_COND_V(!mat.is_valid(), Ref()); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index fa600ad744..bfdd148e3f 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -395,9 +395,11 @@ int Node3DEditorViewport::get_selected_count() const { float Node3DEditorViewport::get_znear() const { return CLAMP(spatial_editor->get_znear(), MIN_Z, MAX_Z); } + float Node3DEditorViewport::get_zfar() const { return CLAMP(spatial_editor->get_zfar(), MIN_Z, MAX_Z); } + float Node3DEditorViewport::get_fov() const { return CLAMP(spatial_editor->get_fov(), MIN_FOV, MAX_FOV); } @@ -970,9 +972,11 @@ void Node3DEditorViewport::_surface_focus_enter() { void Node3DEditorViewport::_surface_focus_exit() { view_menu->set_disable_shortcuts(true); } + bool Node3DEditorViewport ::_is_node_locked(const Node *p_node) { return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_"); } + void Node3DEditorViewport::_list_select(Ref b) { _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift()); @@ -3011,6 +3015,7 @@ void Node3DEditorViewport::_finish_gizmo_instances() { RS::get_singleton()->free(scale_plane_gizmo_instance[i]); } } + void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) { ERR_FAIL_COND(p_activate && !preview); ERR_FAIL_COND(!p_activate && !previewing); @@ -4408,6 +4413,7 @@ Dictionary Node3DEditor::get_state() const { return d; } + void Node3DEditor::set_state(const Dictionary &p_state) { Dictionary d = p_state; @@ -5511,6 +5517,7 @@ void Node3DEditor::_unhandled_key_input(Ref p_event) { snap_key_enabled = Input::get_singleton()->is_key_pressed(KEY_CONTROL); } + void Node3DEditor::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons")); @@ -6116,6 +6123,7 @@ void Node3DEditorPlugin::make_visible(bool p_visible) { spatial_editor->set_process(false); } } + void Node3DEditorPlugin::edit(Object *p_object) { spatial_editor->edit(Object::cast_to(p_object)); } diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 41011343c8..d4f49100d6 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -49,6 +49,7 @@ void Path2DEditor::_notification(int p_what) { } break; } } + void Path2DEditor::_node_removed(Node *p_node) { if (p_node == node) { node = nullptr; diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 0ed7995914..0aee064c41 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -55,6 +55,7 @@ String Path3DGizmo::get_handle_name(int p_idx) const { return n; } + Variant Path3DGizmo::get_handle_value(int p_idx) { Ref c = path->get_curve(); if (c.is_null()) @@ -80,6 +81,7 @@ Variant Path3DGizmo::get_handle_value(int p_idx) { return ofs; } + void Path3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) { Ref c = path->get_curve(); if (c.is_null()) diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index 12a2b4c2b7..37e779fbbb 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -268,6 +268,7 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() { filters->connect("item_activated", callable_mp(this, &EditorPropertyRootMotion::_confirmed)); //filters->connect("item_edited", this, "_filter_edited"); } + ////////////////////////// bool EditorInspectorRootMotionPlugin::can_handle(Object *p_object) { diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index d1cadb6f67..e0748f5237 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -46,6 +46,7 @@ Ref ShaderTextEditor::get_edited_shader() const { return shader; } + void ShaderTextEditor::set_edited_shader(const Ref &p_shader) { if (shader == p_shader) { return; diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 4162778fb9..d869f9fcbc 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -98,6 +98,7 @@ void SpriteFramesEditor::_sheet_preview_draw() { split_sheet_dialog->get_ok()->set_disabled(false); split_sheet_dialog->get_ok()->set_text(vformat(TTR("Add %d Frame(s)"), frames_selected.size())); } + void SpriteFramesEditor::_sheet_preview_input(const Ref &p_event) { Ref mb = p_event; diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 333d95196e..0d957bb101 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -43,9 +43,11 @@ void EditorInspectorPluginStyleBox::parse_begin(Object *p_object) { preview->edit(sb); add_custom_control(preview); } + bool EditorInspectorPluginStyleBox::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { return false; //do not want } + void EditorInspectorPluginStyleBox::parse_end() { } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 7c5a290537..bc4b97d40a 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -134,6 +134,7 @@ TextureEditor::~TextureEditor() { texture->remove_change_receptor(this); } } + // bool EditorInspectorPluginTexture::can_handle(Object *p_object) { return Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr; diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp index 24a6103450..e0e5bdb407 100644 --- a/editor/plugins/texture_layered_editor_plugin.cpp +++ b/editor/plugins/texture_layered_editor_plugin.cpp @@ -249,6 +249,7 @@ TextureLayeredEditor::~TextureLayeredEditor() { texture->remove_change_receptor(this); } } + // bool EditorInspectorPluginLayeredTexture::can_handle(Object *p_object) { return Object::cast_to(p_object) != nullptr; diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index e096ed933e..9ab7e7ae8a 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2358,6 +2358,7 @@ void TileSetEditor::_zoom_in() { workspace_overlay->set_custom_minimum_size(workspace->get_rect().size * scale); } } + void TileSetEditor::_zoom_out() { float scale = workspace->get_scale().x; if (scale > min_scale) { @@ -2367,6 +2368,7 @@ void TileSetEditor::_zoom_out() { workspace_overlay->set_custom_minimum_size(workspace->get_rect().size * scale); } } + void TileSetEditor::_zoom_reset() { workspace->set_scale(Vector2(1, 1)); workspace_container->set_custom_minimum_size(workspace->get_rect().size); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 2cf18a4d13..223cc249e1 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -3221,6 +3221,7 @@ bool EditorInspectorShaderModePlugin::parse_property(Object *p_object, Variant:: void EditorInspectorShaderModePlugin::parse_end() { //do none } + ////////////////////////////////// void VisualShaderNodePortPreview::_shader_changed() { diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 6060ef44bb..8487a3d1d2 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -83,6 +83,7 @@ void BackgroundProgress::_task_step(const String &p_task, int p_step) { else t.progress->set_value(p_step); } + void BackgroundProgress::_end_task(const String &p_task) { _THREAD_SAFE_METHOD_ @@ -103,6 +104,7 @@ void BackgroundProgress::_bind_methods() { void BackgroundProgress::add_task(const String &p_task, const String &p_label, int p_steps) { MessageQueue::get_singleton()->push_call(this, "_add_task", p_task, p_label, p_steps); } + void BackgroundProgress::task_step(const String &p_task, int p_step) { //this code is weird, but it prevents deadlock. bool no_updates = true; diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 3b115d7427..bc4a1ee118 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -55,6 +55,7 @@ void ProjectExportDialog::_theme_changed() { if (panel) panel->add_theme_style_override("panel", patches->get_theme_stylebox("bg", "Tree")); } + void ProjectExportDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_VISIBILITY_CHANGED: { diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 60b9902f68..4f9c6c2cf3 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -575,6 +575,7 @@ void ProjectSettingsEditor::_edit_item(Ref p_exiting_event) { _add_item(ie_type, p_exiting_event); } + void ProjectSettingsEditor::_action_activated() { TreeItem *ti = input_editor->get_selected(); @@ -1259,6 +1260,7 @@ void ProjectSettingsEditor::_translation_res_add(const String &p_path) { void ProjectSettingsEditor::_translation_res_option_file_open() { translation_res_option_file_open->popup_centered_ratio(); } + void ProjectSettingsEditor::_translation_res_option_add(const String &p_path) { ERR_FAIL_COND(!ProjectSettings::get_singleton()->has_setting("locale/translation_remaps")); diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 37de0b51d9..870bf52a91 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -413,6 +413,7 @@ void PropertySelector::select_method_from_script(const Ref