diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2019-04-30 13:52:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 13:52:09 +0200 |
commit | e014561a28cc060c0cde8c8468d739ea9461316c (patch) | |
tree | 3eff82207d82b259150c1acbb474dcce24375fb3 /modules/mono/mono_gd/gd_mono_marshal.cpp | |
parent | 378ddde5e37ae540d17534a312a77ce290be09e2 (diff) | |
parent | 470b80cc559b8e8aff2466001e673c37e0efc5c9 (diff) | |
download | redot-engine-e014561a28cc060c0cde8c8468d739ea9461316c.tar.gz |
Merge pull request #28519 from neikeq/mono-exported-arrays-resource-type-hint
C#: Support resource type hint in exported arrays
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_marshal.cpp')
-rw-r--r-- | modules/mono/mono_gd/gd_mono_marshal.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index de4f3650bd..d586b73cf9 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -184,8 +184,13 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type, ExportInfo *r_e reftype, &key_reftype, &value_reftype, &exc); UNLIKELY_UNHANDLED_EXCEPTION(exc); - r_export_info->dictionary.key_type = managed_to_variant_type(ManagedType::from_reftype(key_reftype)); - r_export_info->dictionary.value_type = managed_to_variant_type(ManagedType::from_reftype(value_reftype)); + ManagedType key_type = ManagedType::from_reftype(key_reftype); + ManagedType value_type = ManagedType::from_reftype(value_reftype); + + r_export_info->dictionary.key_type = managed_to_variant_type(key_type); + r_export_info->dictionary.key_native_name = NATIVE_GDMONOCLASS_NAME(key_type.type_class); + r_export_info->dictionary.value_type = managed_to_variant_type(value_type); + r_export_info->dictionary.value_native_name = NATIVE_GDMONOCLASS_NAME(value_type.type_class); } return Variant::DICTIONARY; @@ -205,7 +210,10 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type, ExportInfo *r_e reftype, &elem_reftype, &exc); UNLIKELY_UNHANDLED_EXCEPTION(exc); - r_export_info->array.element_type = managed_to_variant_type(ManagedType::from_reftype(elem_reftype)); + ManagedType elem_type = ManagedType::from_reftype(elem_reftype); + + r_export_info->array.element_type = managed_to_variant_type(elem_type); + r_export_info->array.element_native_name = NATIVE_GDMONOCLASS_NAME(elem_type.type_class); } return Variant::ARRAY; |