diff options
| author | Emmanuel Leblond <emmanuel.leblond@gmail.com> | 2022-10-23 22:31:57 +0200 |
|---|---|---|
| committer | Emmanuel Leblond <emmanuel.leblond@gmail.com> | 2022-11-08 21:44:33 +0100 |
| commit | b6ba0dca13c1cda5826f23abf203c2f05c0bee42 (patch) | |
| tree | 61e66b034c3ecf45dd2fecf46526dde78f0382e4 /include | |
| parent | 3b82d5937bd1b4d44cc38cbdbc59ee37a89f07fd (diff) | |
| download | redot-cpp-b6ba0dca13c1cda5826f23abf203c2f05c0bee42.tar.gz | |
StringName is working fine with demo \o/
Diffstat (limited to 'include')
| -rw-r--r-- | include/godot_cpp/classes/wrapped.hpp | 10 | ||||
| -rw-r--r-- | include/godot_cpp/core/class_db.hpp | 4 | ||||
| -rw-r--r-- | include/godot_cpp/core/method_bind.hpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 5208e4e..1dfa5a2 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -78,7 +78,7 @@ protected: Wrapped(GodotObject *p_godot_object); public: - static StringName get_class_static() { + static StringName &get_class_static() { static StringName string_name = StringName("Wrapped"); return string_name; } @@ -159,12 +159,12 @@ public: initialized = true; \ } \ \ - static StringName get_class_static() { \ + static StringName &get_class_static() { \ static StringName string_name = StringName(#m_class); \ return string_name; \ } \ \ - static StringName get_parent_class_static() { \ + static StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \ @@ -349,12 +349,12 @@ protected: public: \ static void initialize_class() {} \ \ - static StringName get_class_static() { \ + static StringName &get_class_static() { \ static StringName string_name = StringName(#m_class); \ return string_name; \ } \ \ - static StringName get_parent_class_static() { \ + static StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \ diff --git a/include/godot_cpp/core/class_db.hpp b/include/godot_cpp/core/class_db.hpp index 0353621..634e55c 100644 --- a/include/godot_cpp/core/class_db.hpp +++ b/include/godot_cpp/core/class_db.hpp @@ -191,7 +191,7 @@ void ClassDB::_register_class(bool p_virtual) { T::free, // GDNativeExtensionClassFreeInstance free_instance_func; /* this one is mandatory */ &ClassDB::get_virtual_func, // GDNativeExtensionClassGetVirtual get_virtual_func; nullptr, // GDNativeExtensionClassGetRID get_rid; - (void *)&cl.name, // void *class_userdata; + (void *)&T::get_class_static(), // void *class_userdata; }; internal::gdn_interface->classdb_register_extension_class(internal::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info); @@ -249,7 +249,7 @@ MethodBind *ClassDB::bind_vararg_method(uint32_t p_flags, StringName p_name, M p std::unordered_map<StringName, ClassInfo>::iterator type_it = classes.find(instance_type); if (type_it == classes.end()) { memdelete(bind); - ERR_FAIL_V_MSG(nullptr, String("Class '{0}' doesn't exist.").format(instance_type)); + ERR_FAIL_V_MSG(nullptr, String("Class '{0}' doesn't exist.").format(Array::make(instance_type))); } ClassInfo &type = type_it->second; diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp index c80c040..d7d747d 100644 --- a/include/godot_cpp/core/method_bind.hpp +++ b/include/godot_cpp/core/method_bind.hpp @@ -121,7 +121,7 @@ public: std::vector<PropertyInfo> vec; // First element is return value vec.reserve(argument_count + 1); - for (int i = 0; i < argument_count; i++) { + for (int i = 0; i < argument_count + 1; i++) { vec.push_back(get_argument_info(i - 1)); } return vec; |
