diff options
author | reduz <reduzio@gmail.com> | 2022-03-19 13:18:52 +0100 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-03-22 16:27:34 +0100 |
commit | 2f651277dac25ca8628102068929e3cf3e245904 (patch) | |
tree | 79477e49a2e8d72017ef0a9584ce75b232e5cd8b /core/extension | |
parent | 81c2d7a82a805477fc716e47c93a0dfb2447260d (diff) |
Add static method support to ClassDB
* Based on the work done for Variant in the past.
* Added `ClassDB::bind_static_method`
* Cleaned up ClassDB::bind_method to use variadic templates.
This adds support for having static methods in Object derived classes.
Note that this does not make it work yet in GDScript or Mono and, while it works for GDExtension, GodotCPP needs to be updated.
Diffstat (limited to 'core/extension')
-rw-r--r-- | core/extension/extension_api_dump.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 31af28b783..9acc28f51e 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -666,6 +666,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { Dictionary d2; d2["name"] = String(method_name); d2["is_const"] = (F.flags & METHOD_FLAG_CONST) ? true : false; + d2["is_static"] = (F.flags & METHOD_FLAG_STATIC) ? true : false; d2["is_vararg"] = false; d2["is_virtual"] = true; // virtual functions have no hash since no MethodBind is involved @@ -708,6 +709,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { d2["is_const"] = method->is_const(); d2["is_vararg"] = method->is_vararg(); + d2["is_static"] = method->is_static(); d2["is_virtual"] = false; d2["hash"] = method->get_hash(); |