summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
Diffstat (limited to 'core/object')
-rw-r--r--core/object/class_db.cpp8
-rw-r--r--core/object/class_db.h4
-rw-r--r--core/object/object.cpp2
-rw-r--r--core/object/ref_counted.h4
-rw-r--r--core/object/script_language.cpp2
-rw-r--r--core/object/script_language.h2
6 files changed, 11 insertions, 11 deletions
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