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.
This commit is contained in:
parent
81c2d7a82a
commit
2f651277da
7 changed files with 168 additions and 72 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue