diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-06-17 16:03:09 -0600 |
---|---|---|
committer | Lightning_A <aaronjrecord@gmail.com> | 2021-06-19 20:49:18 -0600 |
commit | e28fd07b2bbe78db0f286604a6eb469d8a0664be (patch) | |
tree | d10b935e7a77774960fefd93ac306db447cc2bfd /core | |
parent | 60dcc4f39c0e6289dba691225c002cd6e77be6ba (diff) |
Rename `instance()`->`instantiate()` when it's a verb
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 12 | ||||
-rw-r--r-- | core/core_bind.h | 4 | ||||
-rw-r--r-- | core/debugger/remote_debugger_peer.cpp | 2 | ||||
-rw-r--r-- | core/input/input.cpp | 16 | ||||
-rw-r--r-- | core/input/input_event.cpp | 16 | ||||
-rw-r--r-- | core/io/file_access_network.cpp | 2 | ||||
-rw-r--r-- | core/io/http_client.cpp | 2 | ||||
-rw-r--r-- | core/io/image.cpp | 8 | ||||
-rw-r--r-- | core/io/image_loader.cpp | 2 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 4 | ||||
-rw-r--r-- | core/io/resource.cpp | 4 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_saver.cpp | 2 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 2 | ||||
-rw-r--r-- | core/object/class_db.cpp | 8 | ||||
-rw-r--r-- | core/object/class_db.h | 4 | ||||
-rw-r--r-- | core/object/object.cpp | 2 | ||||
-rw-r--r-- | core/object/ref_counted.h | 4 | ||||
-rw-r--r-- | core/object/script_language.cpp | 2 | ||||
-rw-r--r-- | core/object/script_language.h | 2 | ||||
-rw-r--r-- | core/os/midi_driver.cpp | 2 | ||||
-rw-r--r-- | core/register_core_types.cpp | 14 | ||||
-rw-r--r-- | core/string/translation_po.cpp | 2 | ||||
-rw-r--r-- | core/variant/variant_parser.cpp | 4 |
25 files changed, 62 insertions, 62 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<StreamPeerTCP> 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<InputEvent> &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) { Ref<InputEventScreenTouch> 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<InputEvent> &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) { Ref<InputEventScreenDrag> 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<InputEvent> &p_event, bool p_is_em if (translate) { Ref<InputEventMouseButton> 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<InputEvent> &p_event, bool p_is_em if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) { Ref<InputEventMouseMotion> 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<InputEventMouseButton> 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<InputEventMouseMotion> 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<InputEventJoypadButton> 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<InputEventJoypadMotion> 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> InputEventKey::create_reference(uint32_t p_keycode) { Ref<InputEventKey> 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<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co Vector2 l = p_xform.xform(get_position() + p_local_ofs); Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_device(get_device()); mb->set_window_id(get_window_id()); @@ -731,7 +731,7 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co Vector2 s = p_xform.basis_xform(get_speed()); Ref<InputEventMouseMotion> 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> InputEventJoypadButton::create_reference(int p_btn_index) { Ref<InputEventJoypadButton> ie; - ie.instance(); + ie.instantiate(); ie->set_button_index(p_btn_index); return ie; @@ -1097,7 +1097,7 @@ bool InputEventScreenTouch::is_pressed() const { Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventScreenTouch> 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<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventScreenDrag> 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<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventMagnifyGesture> 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<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventPanGesture> 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<Image> 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> Image::rgbe_to_srgb() { ERR_FAIL_COND_V(format != FORMAT_RGBE9995, Ref<Image>()); Ref<Image> 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> Image::get_image_from_mipmap(int p_mipamp) const { } Ref<Image> 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<Resource> Image::duplicate(bool p_subresources) const { Ref<Image> 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; - 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<EncodedObjectAsID> 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> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res List<PropertyInfo> plist; get_property_list(&plist); - Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instance(get_class())); + Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instantiate(get_class())); ERR_FAIL_COND_V(r.is_null(), Ref<Resource>()); r->local_scene = p_for_scene; @@ -224,7 +224,7 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const { List<PropertyInfo> plist; get_property_list(&plist); - Ref<Resource> r = (Resource *)ClassDB::instance(get_class()); + Ref<Resource> r = (Resource *)ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(r.is_null(), Ref<Resource>()); for (List<PropertyInfo>::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> StreamPeerBuffer::duplicate() const { Ref<StreamPeerBuffer> 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<Script> s = script; if (!s.is_null()) { - if (s->can_instance()) { + if (s->can_instantiate()) { OBJ_DEBUG_LOCK script_instance = s->instance_create(this); } else if (Engine::get_singleton()->is_editor_hint()) { diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h index 3dd7cc456b..61780eb061 100644 --- a/core/object/ref_counted.h +++ b/core/object/ref_counted.h @@ -213,7 +213,7 @@ public: inline bool is_null() const { return reference == nullptr; } void unref() { - //TODO this should be moved to mutexes, since this engine does not really + // TODO: this should be moved to mutexes, since this engine does not really // do a lot of referencing on references and stuff // mutexes will avoid more crashes? @@ -223,7 +223,7 @@ public: reference = nullptr; } - void instance() { + void instantiate() { ref(memnew(T)); } diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index dd6bc09abb..626a7413e7 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -100,7 +100,7 @@ Dictionary Script::_get_script_constant_map() { } void Script::_bind_methods() { - ClassDB::bind_method(D_METHOD("can_instance"), &Script::can_instance); + ClassDB::bind_method(D_METHOD("can_instantiate"), &Script::can_instantiate); //ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create); ClassDB::bind_method(D_METHOD("instance_has", "base_object"), &Script::instance_has); ClassDB::bind_method(D_METHOD("has_source_code"), &Script::has_source_code); diff --git a/core/object/script_language.h b/core/object/script_language.h index 5d1f6a0deb..2cbaa0f52e 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -115,7 +115,7 @@ protected: Dictionary _get_script_constant_map(); public: - virtual bool can_instance() const = 0; + virtual bool can_instantiate() const = 0; virtual Ref<Script> get_base_script() const = 0; //for script inheritance diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp index a8be84c56c..a33bc6b4c3 100644 --- a/core/os/midi_driver.cpp +++ b/core/os/midi_driver.cpp @@ -45,7 +45,7 @@ void MIDIDriver::set_singleton() { void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length) { Ref<InputEventMIDI> event; - event.instance(); + event.instantiate(); uint32_t param_position = 1; if (length >= 1) { diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index fc8ab72e1a..a81f8ce8d1 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -113,18 +113,18 @@ void register_core_types() { CoreStringNames::create(); - resource_format_po.instance(); + resource_format_po.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_po); - resource_saver_binary.instance(); + resource_saver_binary.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_binary); - resource_loader_binary.instance(); + resource_loader_binary.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_binary); - resource_format_importer.instance(); + resource_format_importer.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_importer); - resource_format_image.instance(); + resource_format_image.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_image); ClassDB::register_class<Object>(); @@ -171,9 +171,9 @@ void register_core_types() { ClassDB::register_custom_instance_class<Crypto>(); ClassDB::register_custom_instance_class<StreamPeerSSL>(); - resource_format_saver_crypto.instance(); + resource_format_saver_crypto.instantiate(); ResourceSaver::add_resource_format_saver(resource_format_saver_crypto); - resource_format_loader_crypto.instance(); + resource_format_loader_crypto.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_loader_crypto); ClassDB::register_virtual_class<IP>(); diff --git a/core/string/translation_po.cpp b/core/string/translation_po.cpp index d6b84cabc9..f9b4e661e4 100644 --- a/core/string/translation_po.cpp +++ b/core/string/translation_po.cpp @@ -188,7 +188,7 @@ void TranslationPO::set_plural_rule(const String &p_plural_rule) { plural_rule = plural_rule.replacen("(", ""); plural_rule = plural_rule.replacen(")", ""); _cache_plural_tests(plural_rule); - expr.instance(); + expr.instantiate(); input_name.push_back("n"); } diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index 28930a19e2..e61ce1eeaa 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -738,10 +738,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, String type = token.value; - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); if (!obj) { - r_err_str = "Can't instance Object() of type: " + type; + r_err_str = "Can't instantiate Object() of type: " + type; return ERR_PARSE_ERROR; } |