From e28fd07b2bbe78db0f286604a6eb469d8a0664be Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Thu, 17 Jun 2021 16:03:09 -0600 Subject: [PATCH] Rename `instance()`->`instantiate()` when it's a verb --- core/core_bind.cpp | 12 +- core/core_bind.h | 4 +- core/debugger/remote_debugger_peer.cpp | 2 +- core/input/input.cpp | 16 +-- core/input/input_event.cpp | 16 +-- core/io/file_access_network.cpp | 2 +- core/io/http_client.cpp | 2 +- core/io/image.cpp | 8 +- core/io/image_loader.cpp | 2 +- core/io/marshalls.cpp | 4 +- core/io/resource.cpp | 4 +- core/io/resource_format_binary.cpp | 2 +- core/io/resource_loader.cpp | 2 +- core/io/resource_saver.cpp | 2 +- core/io/stream_peer.cpp | 2 +- core/object/class_db.cpp | 8 +- core/object/class_db.h | 4 +- core/object/object.cpp | 2 +- core/object/ref_counted.h | 4 +- core/object/script_language.cpp | 2 +- core/object/script_language.h | 2 +- core/os/midi_driver.cpp | 2 +- core/register_core_types.cpp | 14 +-- core/string/translation_po.cpp | 2 +- core/variant/variant_parser.cpp | 4 +- doc/classes/ClassDB.xml | 4 +- doc/classes/Control.xml | 6 +- doc/classes/EditorPlugin.xml | 2 +- doc/classes/InstancePlaceholder.xml | 2 +- doc/classes/Light3D.xml | 2 +- doc/classes/MeshInstance3D.xml | 2 +- doc/classes/Node.xml | 12 +- doc/classes/PackedScene.xml | 14 +-- doc/classes/Performance.xml | 4 +- doc/classes/Resource.xml | 2 +- doc/classes/SceneState.xml | 8 +- doc/classes/Script.xml | 4 +- doc/classes/WorldEnvironment.xml | 2 +- doc/translations/ar.po | 6 +- doc/translations/ca.po | 6 +- doc/translations/classes.pot | 6 +- doc/translations/cs.po | 6 +- doc/translations/de.po | 6 +- doc/translations/es.po | 8 +- doc/translations/fa.po | 6 +- doc/translations/fi.po | 6 +- doc/translations/fr.po | 6 +- doc/translations/id.po | 6 +- doc/translations/it.po | 6 +- doc/translations/ja.po | 6 +- doc/translations/ko.po | 6 +- doc/translations/nl.po | 6 +- doc/translations/pl.po | 6 +- doc/translations/pt_BR.po | 6 +- doc/translations/ro.po | 6 +- doc/translations/ru.po | 6 +- doc/translations/sr_Cyrl.po | 6 +- doc/translations/th.po | 6 +- doc/translations/tr.po | 6 +- doc/translations/uk.po | 6 +- doc/translations/zh_Hans.po | 6 +- doc/translations/zh_Hant.po | 6 +- drivers/png/image_loader_png.cpp | 2 +- drivers/register_driver_types.cpp | 2 +- editor/action_map_editor.cpp | 12 +- editor/animation_track_editor.cpp | 4 +- editor/audio_stream_preview.cpp | 2 +- editor/create_dialog.cpp | 12 +- editor/debugger/editor_debugger_node.cpp | 2 +- editor/debugger/editor_debugger_server.cpp | 2 +- editor/debugger/editor_profiler.cpp | 4 +- editor/debugger/editor_visual_profiler.cpp | 4 +- editor/doc_tools.cpp | 6 +- editor/editor_atlas_packer.cpp | 2 +- editor/editor_audio_buses.cpp | 6 +- editor/editor_autoload_settings.cpp | 4 +- editor/editor_data.cpp | 8 +- editor/editor_export.cpp | 8 +- editor/editor_feature_profile.cpp | 10 +- editor/editor_file_dialog.cpp | 2 +- editor/editor_file_system.cpp | 6 +- editor/editor_folding.cpp | 8 +- editor/editor_fonts.cpp | 44 +++---- editor/editor_inspector.cpp | 6 +- editor/editor_inspector.h | 6 +- editor/editor_layouts_dialog.cpp | 2 +- editor/editor_log.cpp | 4 +- editor/editor_node.cpp | 108 +++++++++--------- editor/editor_node.h | 6 +- editor/editor_plugin_settings.cpp | 2 +- editor/editor_properties.cpp | 2 +- editor/editor_properties_array_dict.cpp | 6 +- editor/editor_resource_picker.cpp | 8 +- editor/editor_resource_preview.cpp | 10 +- editor/editor_run_native.cpp | 2 +- editor/editor_settings.cpp | 12 +- editor/editor_spin_slider.cpp | 2 +- editor/editor_themes.cpp | 4 +- editor/fileserver/editor_file_server.cpp | 2 +- editor/filesystem_dock.cpp | 4 +- editor/import/editor_import_collada.cpp | 2 +- editor/import/resource_importer_bitmask.cpp | 4 +- .../resource_importer_csv_translation.cpp | 2 +- .../resource_importer_layered_texture.cpp | 4 +- editor/import/resource_importer_obj.cpp | 8 +- editor/import/resource_importer_scene.cpp | 4 +- .../import/resource_importer_shader_file.cpp | 2 +- editor/import/resource_importer_texture.cpp | 6 +- .../resource_importer_texture_atlas.cpp | 16 +-- editor/import/resource_importer_wav.cpp | 2 +- editor/import/scene_import_settings.cpp | 10 +- editor/import/scene_importer_mesh.cpp | 10 +- editor/import_dock.cpp | 10 +- editor/node_3d_editor_gizmos.cpp | 4 +- .../animation_blend_space_1d_editor.cpp | 6 +- .../animation_blend_space_2d_editor.cpp | 6 +- .../animation_blend_tree_editor_plugin.cpp | 4 +- .../animation_player_editor_plugin.cpp | 4 +- .../animation_state_machine_editor.cpp | 8 +- .../plugins/animation_tree_editor_plugin.cpp | 2 +- .../plugins/asset_library_editor_plugin.cpp | 8 +- editor/plugins/canvas_item_editor_plugin.cpp | 42 +++---- .../collision_polygon_3d_editor_plugin.cpp | 2 +- .../cpu_particles_2d_editor_plugin.cpp | 2 +- editor/plugins/curve_editor_plugin.cpp | 4 +- editor/plugins/editor_preview_plugins.cpp | 12 +- editor/plugins/font_editor_plugin.cpp | 4 +- .../gpu_particles_2d_editor_plugin.cpp | 14 +-- .../gpu_particles_3d_editor_plugin.cpp | 4 +- ..._particles_collision_sdf_editor_plugin.cpp | 2 +- editor/plugins/gradient_editor_plugin.cpp | 2 +- editor/plugins/material_editor_plugin.cpp | 34 +++--- editor/plugins/mesh_editor_plugin.cpp | 4 +- editor/plugins/mesh_library_editor_plugin.cpp | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 76 ++++++------ editor/plugins/node_3d_editor_plugin.h | 2 +- editor/plugins/ot_features_plugin.cpp | 2 +- editor/plugins/path_3d_editor_plugin.cpp | 2 +- editor/plugins/polygon_2d_editor_plugin.cpp | 4 +- editor/plugins/script_editor_plugin.cpp | 6 +- editor/plugins/script_editor_plugin.h | 2 +- editor/plugins/script_text_editor.cpp | 4 +- editor/plugins/shader_editor_plugin.cpp | 2 +- editor/plugins/shader_file_editor_plugin.cpp | 2 +- editor/plugins/skeleton_3d_editor_plugin.cpp | 2 +- editor/plugins/sprite_2d_editor_plugin.cpp | 6 +- .../plugins/sprite_frames_editor_plugin.cpp | 2 +- editor/plugins/style_box_editor_plugin.cpp | 2 +- editor/plugins/text_editor.cpp | 4 +- editor/plugins/texture_3d_editor_plugin.cpp | 6 +- editor/plugins/texture_editor_plugin.cpp | 2 +- .../plugins/texture_layered_editor_plugin.cpp | 10 +- editor/plugins/theme_editor_preview.cpp | 4 +- editor/plugins/tiles/tile_map_editor.cpp | 8 +- .../tiles/tile_set_atlas_source_editor.cpp | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 20 ++-- editor/project_manager.cpp | 4 +- editor/property_editor.cpp | 18 +-- editor/scene_tree_dock.cpp | 104 ++++++++--------- editor/scene_tree_dock.h | 8 +- editor/scene_tree_editor.cpp | 2 +- main/main.cpp | 18 +-- modules/basis_universal/register_types.cpp | 2 +- modules/basis_universal/texture_basisu.cpp | 2 +- modules/bmp/image_loader_bmp.cpp | 2 +- modules/camera/camera_osx.mm | 6 +- modules/csg/csg_shape.cpp | 6 +- modules/dds/register_types.cpp | 2 +- modules/fbx/data/fbx_material.cpp | 8 +- modules/fbx/data/fbx_mesh_data.cpp | 6 +- modules/fbx/editor_scene_importer_fbx.cpp | 26 ++--- modules/fbx/register_types.cpp | 2 +- modules/fbx/tools/import_utils.h | 4 +- modules/gdnative/gdnative.cpp | 6 +- .../gdnative/nativescript/api_generator.cpp | 2 +- .../gdnative/nativescript/nativescript.cpp | 6 +- modules/gdnative/nativescript/nativescript.h | 2 +- .../gdnative/nativescript/register_types.cpp | 4 +- .../pluginscript/pluginscript_script.cpp | 18 +-- .../pluginscript/pluginscript_script.h | 2 +- modules/gdnative/register_types.cpp | 8 +- .../gdnative/videodecoder/register_types.cpp | 2 +- .../videodecoder/video_stream_gdnative.cpp | 2 +- modules/gdnative/xr/xr_interface_gdnative.cpp | 4 +- .../navigation_mesh_generator.cpp | 8 +- modules/gdscript/doc_classes/@GDScript.xml | 2 +- .../gdscript/editor/gdscript_highlighter.cpp | 2 +- modules/gdscript/gdscript.cpp | 16 +-- modules/gdscript/gdscript.h | 8 +- modules/gdscript/gdscript_analyzer.cpp | 2 +- modules/gdscript/gdscript_cache.cpp | 4 +- modules/gdscript/gdscript_compiler.cpp | 2 +- modules/gdscript/gdscript_editor.cpp | 4 +- .../gdscript_language_protocol.cpp | 6 +- .../language_server/gdscript_workspace.cpp | 2 +- modules/gdscript/register_types.cpp | 10 +- .../gdscript/tests/gdscript_test_runner.cpp | 8 +- modules/gdscript/tests/test_gdscript.cpp | 2 +- .../editor_scene_exporter_gltf_plugin.cpp | 2 +- modules/gltf/editor_scene_importer_gltf.cpp | 12 +- modules/gltf/gltf_document.cpp | 106 ++++++++--------- modules/gltf/register_types.cpp | 2 +- modules/gridmap/grid_map.cpp | 4 +- modules/gridmap/grid_map_editor_plugin.cpp | 10 +- modules/jpg/image_loader_jpegd.cpp | 2 +- modules/lightmapper_rd/lightmapper_rd.cpp | 34 +++--- modules/mbedtls/crypto_mbedtls.cpp | 4 +- modules/mbedtls/dtls_server_mbedtls.cpp | 4 +- modules/mbedtls/packet_peer_mbed_dtls.cpp | 2 +- modules/mbedtls/stream_peer_mbedtls.cpp | 2 +- modules/minimp3/audio_stream_mp3.cpp | 2 +- modules/minimp3/register_types.cpp | 2 +- modules/minimp3/resource_importer_mp3.cpp | 2 +- modules/mobile_vr/register_types.cpp | 2 +- modules/mono/csharp_script.cpp | 10 +- modules/mono/csharp_script.h | 2 +- .../GodotTools/Ides/GodotIdeManager.cs | 4 +- modules/mono/glue/base_object_glue.cpp | 4 +- modules/mono/mono_gd/gd_mono.cpp | 4 +- modules/mono/mono_gd/gd_mono_utils.cpp | 2 +- modules/mono/register_types.cpp | 4 +- modules/pvr/image_compress_pvrtc.cpp | 2 +- modules/pvr/register_types.cpp | 2 +- .../stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 +- modules/stb_vorbis/register_types.cpp | 2 +- .../resource_importer_ogg_vorbis.cpp | 2 +- modules/text_server_adv/dynamic_font_adv.cpp | 2 +- modules/text_server_fb/dynamic_font_fb.cpp | 2 +- modules/tga/image_loader_tga.cpp | 2 +- modules/theora/register_types.cpp | 2 +- modules/theora/video_stream_theora.cpp | 2 +- modules/upnp/upnp.cpp | 2 +- modules/visual_script/visual_script.cpp | 6 +- modules/visual_script/visual_script.h | 6 +- .../visual_script_builtin_funcs.cpp | 2 +- .../visual_script_builtin_funcs.h | 2 +- .../visual_script/visual_script_editor.cpp | 60 +++++----- .../visual_script_expression.cpp | 2 +- .../visual_script/visual_script_expression.h | 2 +- .../visual_script_flow_control.cpp | 16 +-- .../visual_script_flow_control.h | 14 +-- .../visual_script_func_nodes.cpp | 16 +-- .../visual_script/visual_script_func_nodes.h | 8 +- modules/visual_script/visual_script_nodes.cpp | 60 +++++----- modules/visual_script/visual_script_nodes.h | 54 ++++----- .../visual_script_yield_nodes.cpp | 12 +- .../visual_script/visual_script_yield_nodes.h | 4 +- modules/webm/register_types.cpp | 2 +- modules/webm/video_stream_webm.cpp | 2 +- modules/webp/image_loader_webp.cpp | 2 +- modules/websocket/wsl_client.cpp | 4 +- modules/websocket/wsl_server.cpp | 2 +- modules/webxr/register_types.cpp | 2 +- modules/webxr/webxr_interface_js.cpp | 2 +- platform/android/display_server_android.cpp | 26 ++--- platform/android/export/export.cpp | 14 +-- platform/android/plugin/godot_plugin_jni.cpp | 2 +- platform/iphone/display_server_iphone.mm | 6 +- platform/iphone/export/export.cpp | 10 +- .../javascript/display_server_javascript.cpp | 16 +-- platform/javascript/export/export.cpp | 18 +-- platform/linuxbsd/display_server_x11.cpp | 14 +-- platform/linuxbsd/export/export.cpp | 4 +- platform/osx/display_server_osx.mm | 20 ++-- platform/osx/export/export.cpp | 6 +- platform/uwp/app.cpp | 10 +- platform/uwp/export/export.cpp | 4 +- platform/uwp/os_uwp.cpp | 2 +- platform/windows/display_server_windows.cpp | 18 +-- platform/windows/export/export.cpp | 4 +- scene/2d/canvas_modulate.cpp | 2 +- scene/2d/navigation_region_2d.cpp | 2 +- scene/2d/physics_body_2d.cpp | 4 +- scene/2d/touch_screen_button.cpp | 4 +- scene/3d/audio_stream_player_3d.cpp | 2 +- scene/3d/camera_3d.cpp | 2 +- scene/3d/gpu_particles_collision_3d.cpp | 2 +- scene/3d/light_3d.cpp | 2 +- scene/3d/lightmap_gi.cpp | 10 +- scene/3d/mesh_instance_3d.cpp | 4 +- scene/3d/occluder_instance_3d.cpp | 4 +- scene/3d/physics_body_3d.cpp | 4 +- scene/3d/skeleton_3d.cpp | 4 +- scene/3d/soft_body_3d.cpp | 2 +- scene/3d/voxel_gi.cpp | 6 +- scene/3d/voxelizer.cpp | 6 +- scene/3d/world_environment.cpp | 2 +- scene/animation/animation_blend_tree.cpp | 2 +- .../animation_node_state_machine.cpp | 4 +- scene/animation/animation_player.cpp | 2 +- scene/debugger/scene_debugger.cpp | 4 +- scene/gui/button.cpp | 2 +- scene/gui/code_edit.cpp | 4 +- scene/gui/color_picker.cpp | 8 +- scene/gui/graph_node.cpp | 2 +- scene/gui/item_list.cpp | 4 +- scene/gui/link_button.cpp | 2 +- scene/gui/popup_menu.h | 4 +- scene/gui/rich_text_label.h | 4 +- scene/gui/spin_box.cpp | 2 +- scene/gui/tab_container.cpp | 2 +- scene/gui/tabs.cpp | 2 +- scene/gui/text_edit.cpp | 2 +- scene/gui/text_edit.h | 2 +- scene/gui/tree.cpp | 2 +- scene/gui/tree.h | 4 +- scene/main/http_request.cpp | 2 +- scene/main/instance_placeholder.cpp | 2 +- scene/main/node.cpp | 20 ++-- scene/main/scene_tree.cpp | 6 +- scene/main/viewport.cpp | 10 +- scene/register_scene_types.cpp | 18 +-- scene/resources/audio_stream_sample.cpp | 2 +- scene/resources/bit_map.cpp | 8 +- .../resources/default_theme/default_theme.cpp | 8 +- scene/resources/font.cpp | 14 +-- scene/resources/material.cpp | 2 +- scene/resources/mesh.cpp | 4 +- scene/resources/packed_scene.cpp | 62 +++++----- scene/resources/packed_scene.h | 8 +- scene/resources/resource_format_text.cpp | 12 +- scene/resources/shader.cpp | 2 +- scene/resources/surface_tool.cpp | 2 +- scene/resources/texture.cpp | 24 ++-- scene/resources/tile_set.cpp | 2 +- scene/resources/visual_shader.cpp | 6 +- servers/audio/audio_effect.h | 2 +- servers/audio/audio_stream.cpp | 4 +- .../audio/effects/audio_effect_amplify.cpp | 4 +- servers/audio/effects/audio_effect_amplify.h | 2 +- .../audio/effects/audio_effect_capture.cpp | 4 +- servers/audio/effects/audio_effect_capture.h | 2 +- servers/audio/effects/audio_effect_chorus.cpp | 4 +- servers/audio/effects/audio_effect_chorus.h | 2 +- .../audio/effects/audio_effect_compressor.cpp | 4 +- .../audio/effects/audio_effect_compressor.h | 2 +- servers/audio/effects/audio_effect_delay.cpp | 4 +- servers/audio/effects/audio_effect_delay.h | 2 +- .../audio/effects/audio_effect_distortion.cpp | 4 +- .../audio/effects/audio_effect_distortion.h | 2 +- servers/audio/effects/audio_effect_eq.cpp | 4 +- servers/audio/effects/audio_effect_eq.h | 2 +- servers/audio/effects/audio_effect_filter.cpp | 4 +- servers/audio/effects/audio_effect_filter.h | 2 +- .../audio/effects/audio_effect_limiter.cpp | 4 +- servers/audio/effects/audio_effect_limiter.h | 2 +- servers/audio/effects/audio_effect_panner.cpp | 4 +- servers/audio/effects/audio_effect_panner.h | 2 +- servers/audio/effects/audio_effect_phaser.cpp | 4 +- servers/audio/effects/audio_effect_phaser.h | 2 +- .../effects/audio_effect_pitch_shift.cpp | 4 +- .../audio/effects/audio_effect_pitch_shift.h | 2 +- servers/audio/effects/audio_effect_record.cpp | 6 +- servers/audio/effects/audio_effect_record.h | 2 +- servers/audio/effects/audio_effect_reverb.cpp | 4 +- servers/audio/effects/audio_effect_reverb.h | 2 +- .../audio_effect_spectrum_analyzer.cpp | 4 +- .../effects/audio_effect_spectrum_analyzer.h | 2 +- .../effects/audio_effect_stereo_enhance.cpp | 4 +- .../effects/audio_effect_stereo_enhance.h | 2 +- .../audio/effects/audio_stream_generator.cpp | 2 +- servers/audio_server.cpp | 6 +- .../renderer_rd/renderer_scene_gi_rd.cpp | 4 +- .../renderer_rd/renderer_scene_render_rd.cpp | 10 +- .../renderer_rd/renderer_scene_sky_rd.cpp | 2 +- .../renderer_rd/renderer_storage_rd.cpp | 12 +- .../renderer_scene_occlusion_cull.cpp | 2 +- servers/rendering/rendering_device.cpp | 2 +- servers/rendering/rendering_device_binds.cpp | 4 +- servers/text_server.cpp | 10 +- thirdparty/enet/godot.cpp | 4 +- 371 files changed, 1318 insertions(+), 1318 deletions(-) diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 912c89a9d2..85fdcaee12 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -1850,12 +1850,12 @@ bool _ClassDB::is_parent_class(const StringName &p_class, const StringName &p_in return ClassDB::is_parent_class(p_class, p_inherits); } -bool _ClassDB::can_instance(const StringName &p_class) const { - return ClassDB::can_instance(p_class); +bool _ClassDB::can_instantiate(const StringName &p_class) const { + return ClassDB::can_instantiate(p_class); } -Variant _ClassDB::instance(const StringName &p_class) const { - Object *obj = ClassDB::instance(p_class); +Variant _ClassDB::instantiate(const StringName &p_class) const { + Object *obj = ClassDB::instantiate(p_class); if (!obj) { return Variant(); } @@ -1984,8 +1984,8 @@ void _ClassDB::_bind_methods() { ClassDB::bind_method(D_METHOD("get_parent_class", "class"), &_ClassDB::get_parent_class); ClassDB::bind_method(D_METHOD("class_exists", "class"), &_ClassDB::class_exists); ClassDB::bind_method(D_METHOD("is_parent_class", "class", "inherits"), &_ClassDB::is_parent_class); - ClassDB::bind_method(D_METHOD("can_instance", "class"), &_ClassDB::can_instance); - ClassDB::bind_method(D_METHOD("instance", "class"), &_ClassDB::instance); + ClassDB::bind_method(D_METHOD("can_instantiate", "class"), &_ClassDB::can_instantiate); + ClassDB::bind_method(D_METHOD("instantiate", "class"), &_ClassDB::instantiate); ClassDB::bind_method(D_METHOD("class_has_signal", "class", "signal"), &_ClassDB::has_signal); ClassDB::bind_method(D_METHOD("class_get_signal", "class", "signal"), &_ClassDB::get_signal); diff --git a/core/core_bind.h b/core/core_bind.h index 74b6a5b26f..c01a149f58 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -585,8 +585,8 @@ public: StringName get_parent_class(const StringName &p_class) const; bool class_exists(const StringName &p_class) const; bool is_parent_class(const StringName &p_class, const StringName &p_inherits) const; - bool can_instance(const StringName &p_class) const; - Variant instance(const StringName &p_class) const; + bool can_instantiate(const StringName &p_class) const; + Variant instantiate(const StringName &p_class) const; bool has_signal(StringName p_class, StringName p_signal) const; Dictionary get_signal(StringName p_class, StringName p_signal) const; diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp index 39113eda14..ea5e32203c 100644 --- a/core/debugger/remote_debugger_peer.cpp +++ b/core/debugger/remote_debugger_peer.cpp @@ -84,7 +84,7 @@ RemoteDebuggerPeerTCP::RemoteDebuggerPeerTCP(Ref p_tcp) { thread.start(_thread_func, this); #endif } else { - tcp_client.instance(); + tcp_client.instantiate(); } } diff --git a/core/input/input.cpp b/core/input/input.cpp index 6e98b596d7..be536aa730 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -500,7 +500,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) { Ref touch_event; - touch_event.instance(); + touch_event.instantiate(); touch_event->set_pressed(mb->is_pressed()); touch_event->set_position(mb->get_position()); event_dispatch_function(touch_event); @@ -517,7 +517,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) { Ref drag_event; - drag_event.instance(); + drag_event.instantiate(); drag_event->set_position(mm->get_position()); drag_event->set_relative(mm->get_relative()); @@ -555,7 +555,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (translate) { Ref button_event; - button_event.instance(); + button_event.instantiate(); button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(st->get_position()); @@ -582,7 +582,7 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) { Ref motion_event; - motion_event.instance(); + motion_event.instantiate(); motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); motion_event->set_position(sd->get_position()); @@ -787,7 +787,7 @@ void Input::ensure_touch_mouse_raised() { mouse_from_touch_index = -1; Ref button_event; - button_event.instance(); + button_event.instantiate(); button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(mouse_pos); @@ -821,7 +821,7 @@ void Input::set_default_cursor_shape(CursorShape p_shape) { // The default shape is set in Viewport::_gui_input_event. To instantly // see the shape in the viewport we need to trigger a mouse motion event. Ref mm; - mm.instance(); + mm.instantiate(); mm->set_position(mouse_pos); mm->set_global_position(mouse_pos); parse_input_event(mm); @@ -1031,7 +1031,7 @@ void Input::joy_hat(int p_device, int p_val) { void Input::_button_event(int p_device, int p_index, bool p_pressed) { Ref ievent; - ievent.instance(); + ievent.instantiate(); ievent->set_device(p_device); ievent->set_button_index(p_index); ievent->set_pressed(p_pressed); @@ -1041,7 +1041,7 @@ void Input::_button_event(int p_device, int p_index, bool p_pressed) { void Input::_axis_event(int p_device, int p_axis, float p_value) { Ref ievent; - ievent.instance(); + ievent.instantiate(); ievent->set_device(p_device); ievent->set_axis(p_axis); ievent->set_axis_value(p_value); diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 72fb409b63..14762f955c 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -375,7 +375,7 @@ String InputEventKey::to_string() { Ref InputEventKey::create_reference(uint32_t p_keycode) { Ref ie; - ie.instance(); + ie.instantiate(); ie->set_keycode(p_keycode & KEY_CODE_MASK); ie->set_unicode(p_keycode & KEY_CODE_MASK); @@ -545,7 +545,7 @@ Ref InputEventMouseButton::xformed_by(const Transform2D &p_xform, co Vector2 l = p_xform.xform(get_position() + p_local_ofs); Ref mb; - mb.instance(); + mb.instantiate(); mb->set_device(get_device()); mb->set_window_id(get_window_id()); @@ -731,7 +731,7 @@ Ref InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co Vector2 s = p_xform.basis_xform(get_speed()); Ref mm; - mm.instance(); + mm.instantiate(); mm->set_device(get_device()); mm->set_window_id(get_window_id()); @@ -1048,7 +1048,7 @@ String InputEventJoypadButton::to_string() { Ref InputEventJoypadButton::create_reference(int p_btn_index) { Ref ie; - ie.instance(); + ie.instantiate(); ie->set_button_index(p_btn_index); return ie; @@ -1097,7 +1097,7 @@ bool InputEventScreenTouch::is_pressed() const { Ref InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref st; - st.instance(); + st.instantiate(); st->set_device(get_device()); st->set_window_id(get_window_id()); st->set_index(index); @@ -1170,7 +1170,7 @@ Vector2 InputEventScreenDrag::get_speed() const { Ref InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref sd; - sd.instance(); + sd.instantiate(); sd->set_device(get_device()); sd->set_window_id(get_window_id()); @@ -1325,7 +1325,7 @@ real_t InputEventMagnifyGesture::get_factor() const { Ref InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref ev; - ev.instance(); + ev.instantiate(); ev->set_device(get_device()); ev->set_window_id(get_window_id()); @@ -1365,7 +1365,7 @@ Vector2 InputEventPanGesture::get_delta() const { Ref InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref ev; - ev.instance(); + ev.instantiate(); ev->set_device(get_device()); ev->set_window_id(get_window_id()); diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 63a8f9c5b6..9ee3876c2f 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -210,7 +210,7 @@ FileAccessNetworkClient *FileAccessNetworkClient::singleton = nullptr; FileAccessNetworkClient::FileAccessNetworkClient() { singleton = this; - client.instance(); + client.instantiate(); } FileAccessNetworkClient::~FileAccessNetworkClient() { diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 449ebaa6ee..78f04e57d3 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -730,7 +730,7 @@ int HTTPClient::get_read_chunk_size() const { } HTTPClient::HTTPClient() { - tcp_connection.instance(); + tcp_connection.instantiate(); } HTTPClient::~HTTPClient() {} diff --git a/core/io/image.cpp b/core/io/image.cpp index 9cd0ea7b5d..25d9eab3fe 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -1945,7 +1945,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con memcpy(wr.ptr(), ptr, size); wr = uint8_t*(); Ref im; - im.instance(); + im.instantiate(); im->create(w, h, false, format, imgdata); im->save_png("res://mipmap_" + itos(i) + ".png"); } @@ -3280,7 +3280,7 @@ Ref Image::rgbe_to_srgb() { ERR_FAIL_COND_V(format != FORMAT_RGBE9995, Ref()); Ref new_image; - new_image.instance(); + new_image.instantiate(); new_image->create(width, height, false, Image::FORMAT_RGB8); for (int row = 0; row < height; row++) { @@ -3310,7 +3310,7 @@ Ref Image::get_image_from_mipmap(int p_mipamp) const { } Ref image; - image.instance(); + image.instantiate(); image->width = w; image->height = h; image->format = format; @@ -3627,7 +3627,7 @@ Image::Image(const uint8_t *p_mem_png_jpg, int p_len) { Ref Image::duplicate(bool p_subresources) const { Ref copy; - copy.instance(); + copy.instantiate(); copy->_copy_internals_from(*this); return copy; } diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index 7de038e6fe..b45e9d26b1 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -163,7 +163,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String &p_origin } Ref image; - image.instance(); + image.instantiate(); Error err = ImageLoader::loader[idx]->load_image(image, f, false, 1.0); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index c447e11ee7..f342db2dad 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -547,7 +547,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int r_variant = (Object *)nullptr; } else { Ref obj_as_id; - obj_as_id.instance(); + obj_as_id.instantiate(); obj_as_id->set_object_id(val); r_variant = obj_as_id; @@ -565,7 +565,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int if (str == String()) { r_variant = (Object *)nullptr; } else { - Object *obj = ClassDB::instance(str); + Object *obj = ClassDB::instantiate(str); ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE); ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); diff --git a/core/io/resource.cpp b/core/io/resource.cpp index b970e85c99..efa622d976 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -164,7 +164,7 @@ Ref Resource::duplicate_for_local_scene(Node *p_for_scene, Map plist; get_property_list(&plist); - Ref r = Object::cast_to(ClassDB::instance(get_class())); + Ref r = Object::cast_to(ClassDB::instantiate(get_class())); ERR_FAIL_COND_V(r.is_null(), Ref()); r->local_scene = p_for_scene; @@ -224,7 +224,7 @@ Ref Resource::duplicate(bool p_subresources) const { List plist; get_property_list(&plist); - Ref r = (Resource *)ClassDB::instance(get_class()); + Ref r = (Resource *)ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(r.is_null(), Ref()); for (List::Element *E = plist.front(); E; E = E->next()) { diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index f83ba30514..0e9815245f 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -704,7 +704,7 @@ Error ResourceLoaderBinary::load() { if (res.is_null()) { //did not replace - Object *obj = ClassDB::instance(t); + Object *obj = ClassDB::instantiate(t); if (!obj) { error = ERR_FILE_CORRUPT; ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource of unrecognized type in file: " + t + "."); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1700766cbf..c5dfe1f2b0 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -1045,7 +1045,7 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) { bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader"); ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + "."); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + "."); diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 389a4fdbbd..80cb85fba3 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -210,7 +210,7 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) { bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver"); ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + "."); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + "."); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index ee5e9eca0c..27f8d4e88f 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -512,7 +512,7 @@ void StreamPeerBuffer::clear() { Ref StreamPeerBuffer::duplicate() const { Ref spb; - spb.instance(); + spb.instantiate(); spb->data = data; return spb; } diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 5bf874ccae..df36587662 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -516,7 +516,7 @@ void ClassDB::instance_get_native_extension_data(ObjectNativeExtension **r_exten } } -Object *ClassDB::instance(const StringName &p_class) { +Object *ClassDB::instantiate(const StringName &p_class) { ClassInfo *ti; { OBJTYPE_RLOCK; @@ -544,7 +544,7 @@ Object *ClassDB::instance(const StringName &p_class) { return ti->creation_func(); } -bool ClassDB::can_instance(const StringName &p_class) { +bool ClassDB::can_instantiate(const StringName &p_class) { OBJTYPE_RLOCK; ClassInfo *ti = classes.getptr(p_class); @@ -1522,8 +1522,8 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con if (Engine::get_singleton()->has_singleton(p_class)) { c = Engine::get_singleton()->get_singleton_object(p_class); cleanup_c = false; - } else if (ClassDB::can_instance(p_class)) { - c = ClassDB::instance(p_class); + } else if (ClassDB::can_instantiate(p_class)) { + c = ClassDB::instantiate(p_class); cleanup_c = true; } diff --git a/core/object/class_db.h b/core/object/class_db.h index 4355c9b0ea..a4af535149 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -230,8 +230,8 @@ public: static StringName get_compatibility_remapped_class(const StringName &p_class); static bool class_exists(const StringName &p_class); static bool is_parent_class(const StringName &p_class, const StringName &p_inherits); - static bool can_instance(const StringName &p_class); - static Object *instance(const StringName &p_class); + static bool can_instantiate(const StringName &p_class); + static Object *instantiate(const StringName &p_class); static void instance_get_native_extension_data(ObjectNativeExtension **r_extension, void **r_extension_instance); static APIType get_api_type(const StringName &p_class); diff --git a/core/object/object.cpp b/core/object/object.cpp index 799e63a512..bad40f14d9 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -871,7 +871,7 @@ void Object::set_script(const Variant &p_script) { Ref