summaryrefslogtreecommitdiffstats
path: root/core/extension/extension_api_dump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/extension/extension_api_dump.cpp')
-rw-r--r--core/extension/extension_api_dump.cpp37
1 files changed, 24 insertions, 13 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp
index 69be2d2a8f..1c9b4dc3e8 100644
--- a/core/extension/extension_api_dump.cpp
+++ b/core/extension/extension_api_dump.cpp
@@ -189,6 +189,7 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
{ Variant::PACKED_VECTOR2_ARRAY, ptrsize_32 * 2, ptrsize_64 * 2, ptrsize_32 * 2, ptrsize_64 * 2 },
{ Variant::PACKED_VECTOR3_ARRAY, ptrsize_32 * 2, ptrsize_64 * 2, ptrsize_32 * 2, ptrsize_64 * 2 },
{ Variant::PACKED_COLOR_ARRAY, ptrsize_32 * 2, ptrsize_64 * 2, ptrsize_32 * 2, ptrsize_64 * 2 },
+ { Variant::PACKED_VECTOR4_ARRAY, ptrsize_32 * 2, ptrsize_64 * 2, ptrsize_32 * 2, ptrsize_64 * 2 },
{ Variant::VARIANT_MAX, sizeof(uint64_t) + sizeof(float) * 4, sizeof(uint64_t) + sizeof(float) * 4, sizeof(uint64_t) + sizeof(double) * 4, sizeof(uint64_t) + sizeof(double) * 4 },
};
@@ -230,6 +231,7 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
static_assert(type_size_array[Variant::PACKED_VECTOR2_ARRAY][sizeof(void *)] == sizeof(PackedVector2Array), "Size of PackedVector2Array mismatch");
static_assert(type_size_array[Variant::PACKED_VECTOR3_ARRAY][sizeof(void *)] == sizeof(PackedVector3Array), "Size of PackedVector3Array mismatch");
static_assert(type_size_array[Variant::PACKED_COLOR_ARRAY][sizeof(void *)] == sizeof(PackedColorArray), "Size of PackedColorArray mismatch");
+ static_assert(type_size_array[Variant::PACKED_VECTOR4_ARRAY][sizeof(void *)] == sizeof(PackedVector4Array), "Size of PackedVector4Array mismatch");
static_assert(type_size_array[Variant::VARIANT_MAX][sizeof(void *)] == sizeof(Variant), "Size of Variant mismatch");
Array core_type_sizes;
@@ -1016,26 +1018,34 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
d2["is_virtual"] = true;
// virtual functions have no hash since no MethodBind is involved
bool has_return = mi.return_val.type != Variant::NIL || (mi.return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT);
- Array arguments;
- for (int i = (has_return ? -1 : 0); i < mi.arguments.size(); i++) {
- PropertyInfo pinfo = i == -1 ? mi.return_val : mi.arguments[i];
+ if (has_return) {
+ PropertyInfo pinfo = mi.return_val;
Dictionary d3;
- if (i >= 0) {
- d3["name"] = pinfo.name;
+ d3["type"] = get_property_info_type_name(pinfo);
+
+ if (mi.get_argument_meta(-1) > 0) {
+ d3["meta"] = get_type_meta_name((GodotTypeInfo::Metadata)mi.get_argument_meta(-1));
}
+ d2["return_value"] = d3;
+ }
+
+ Array arguments;
+ int i = 0;
+ for (List<PropertyInfo>::ConstIterator itr = mi.arguments.begin(); itr != mi.arguments.end(); ++itr, ++i) {
+ const PropertyInfo &pinfo = *itr;
+ Dictionary d3;
+
+ d3["name"] = pinfo.name;
+
d3["type"] = get_property_info_type_name(pinfo);
if (mi.get_argument_meta(i) > 0) {
d3["meta"] = get_type_meta_name((GodotTypeInfo::Metadata)mi.get_argument_meta(i));
}
- if (i == -1) {
- d2["return_value"] = d3;
- } else {
- arguments.push_back(d3);
- }
+ arguments.push_back(d3);
}
if (arguments.size()) {
@@ -1149,10 +1159,11 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
Array arguments;
- for (int i = 0; i < F.arguments.size(); i++) {
+ int i = 0;
+ for (List<PropertyInfo>::ConstIterator itr = F.arguments.begin(); itr != F.arguments.end(); ++itr, ++i) {
Dictionary d3;
- d3["name"] = F.arguments[i].name;
- d3["type"] = get_property_info_type_name(F.arguments[i]);
+ d3["name"] = itr->name;
+ d3["type"] = get_property_info_type_name(*itr);
if (F.get_argument_meta(i) > 0) {
d3["meta"] = get_type_meta_name((GodotTypeInfo::Metadata)F.get_argument_meta(i));
}