From e28fd07b2bbe78db0f286604a6eb469d8a0664be Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Thu, 17 Jun 2021 16:03:09 -0600 Subject: Rename `instance()`->`instantiate()` when it's a verb --- scene/main/node.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'scene/main/node.cpp') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 679fca0217..baf185c847 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1813,7 +1813,7 @@ bool Node::get_scene_instance_load_placeholder() const { Node *Node::_duplicate(int p_flags, Map *r_duplimap) const { Node *node = nullptr; - bool instanced = false; + bool instantiated = false; if (Object::cast_to(this)) { const InstancePlaceholder *ip = Object::cast_to(this); @@ -1830,13 +1830,13 @@ Node *Node::_duplicate(int p_flags, Map *r_duplimap) const ges = PackedScene::GEN_EDIT_STATE_INSTANCE; } #endif - node = res->instance(ges); + node = res->instantiate(ges); ERR_FAIL_COND_V(!node, nullptr); - instanced = true; + instantiated = true; } else { - Object *obj = ClassDB::instance(get_class()); + Object *obj = ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(!obj, nullptr); node = Object::cast_to(obj); if (!node) { @@ -1856,9 +1856,9 @@ Node *Node::_duplicate(int p_flags, Map *r_duplimap) const List node_tree; node_tree.push_front(this); - if (instanced) { - // Since nodes in the instanced hierarchy won't be duplicated explicitly, we need to make an inventory - // of all the nodes in the tree of the instanced scene in order to transfer the values of the properties + if (instantiated) { + // Since nodes in the instantiated hierarchy won't be duplicated explicitly, we need to make an inventory + // of all the nodes in the tree of the instantiated scene in order to transfer the values of the properties Vector instance_roots; instance_roots.push_back(this); @@ -1866,8 +1866,8 @@ Node *Node::_duplicate(int p_flags, Map *r_duplimap) const for (List::Element *N = node_tree.front(); N; N = N->next()) { for (int i = 0; i < N->get()->get_child_count(); ++i) { Node *descendant = N->get()->get_child(i); - // Skip nodes not really belonging to the instanced hierarchy; they'll be processed normally later - // but remember non-instanced nodes that are hidden below instanced ones + // Skip nodes not really belonging to the instantiated hierarchy; they'll be processed normally later + // but remember non-instantiated nodes that are hidden below instantiated ones if (!instance_roots.has(descendant->get_owner())) { if (descendant->get_parent() && descendant->get_parent() != this && descendant->data.owner != descendant->get_parent()) { hidden_roots.push_back(descendant); @@ -1950,7 +1950,7 @@ Node *Node::_duplicate(int p_flags, Map *r_duplimap) const if (get_child(i)->data.parent_owned) { continue; } - if (instanced && get_child(i)->data.owner == this) { + if (instantiated && get_child(i)->data.owner == this) { continue; //part of instance } -- cgit v1.2.3