diff options
Diffstat (limited to 'core/class_db.h')
-rw-r--r-- | core/class_db.h | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/core/class_db.h b/core/class_db.h index f760aa1738..eae2a9afd4 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -48,7 +48,6 @@ #ifdef DEBUG_METHODS_ENABLED struct MethodDefinition { - StringName name; Vector<StringName> args; MethodDefinition() {} @@ -103,7 +102,6 @@ public: public: struct PropertySetGet { - int index; StringName setter; StringName getter; @@ -113,10 +111,10 @@ public: }; struct ClassInfo { + APIType api = API_NONE; + ClassInfo *inherits_ptr = nullptr; + void *class_ptr = nullptr; - APIType api; - ClassInfo *inherits_ptr; - void *class_ptr; HashMap<StringName, MethodBind *> method_map; HashMap<StringName, int> constant_map; HashMap<StringName, List<StringName>> enum_map; @@ -133,11 +131,12 @@ public: StringName inherits; StringName name; - bool disabled; - bool exposed; - Object *(*creation_func)(); - ClassInfo(); - ~ClassInfo(); + bool disabled = false; + bool exposed = false; + Object *(*creation_func)() = nullptr; + + ClassInfo() {} + ~ClassInfo() {} }; template <class T> @@ -167,13 +166,11 @@ public: // DO NOT USE THIS!!!!!! NEEDS TO BE PUBLIC BUT DO NOT USE NO MATTER WHAT!!! template <class T> static void _add_class() { - _add_class2(T::get_class_static(), T::get_parent_class_static()); } template <class T> static void register_class() { - GLOBAL_LOCK_FUNCTION; T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); @@ -186,7 +183,6 @@ public: template <class T> static void register_virtual_class() { - GLOBAL_LOCK_FUNCTION; T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); @@ -198,13 +194,11 @@ public: template <class T> static Object *_create_ptr_func() { - return T::create(); } template <class T> static void register_custom_instance_class() { - GLOBAL_LOCK_FUNCTION; T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); @@ -231,7 +225,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method) { - MethodBind *bind = create_method_bind(p_method); return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, nullptr, 0); //use static function, much smaller binary usage @@ -239,7 +232,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[1] = { &p_def1 }; @@ -248,7 +240,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[2] = { &p_def1, &p_def2 }; @@ -257,7 +248,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[3] = { &p_def1, &p_def2, &p_def3 }; @@ -266,7 +256,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[4] = { &p_def1, &p_def2, &p_def3, &p_def4 }; @@ -275,7 +264,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[5] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5 }; @@ -284,7 +272,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[6] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6 }; @@ -293,7 +280,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[7] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7 }; @@ -302,7 +288,6 @@ public: template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method, const Variant &p_def1, const Variant &p_def2, const Variant &p_def3, const Variant &p_def4, const Variant &p_def5, const Variant &p_def6, const Variant &p_def7, const Variant &p_def8) { - MethodBind *bind = create_method_bind(p_method); const Variant *ptr[8] = { &p_def1, &p_def2, &p_def3, &p_def4, &p_def5, &p_def6, &p_def7, &p_def8 }; @@ -311,7 +296,6 @@ public: template <class M> static MethodBind *bind_vararg_method(uint32_t p_flags, StringName p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector<Variant> &p_default_args = Vector<Variant>(), bool p_return_nil_is_variant = true) { - GLOBAL_LOCK_FUNCTION; MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant); |