Merge pull request #72926 from Bromeon/bugfix/gdext-set-typed

GDExtension: `array_set_typed` now accepts enum instead of `uint32_t`
This commit is contained in:
Rémi Verschelde 2023-02-09 12:05:14 +01:00
commit ebe3cfc061
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 3 additions and 3 deletions

View file

@ -871,11 +871,11 @@ void gdextension_array_ref(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_
self->_ref(*from); self->_ref(*from);
} }
void gdextension_array_set_typed(GDExtensionTypePtr p_self, uint32_t p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script) { void gdextension_array_set_typed(GDExtensionTypePtr p_self, GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script) {
Array *self = reinterpret_cast<Array *>(p_self); Array *self = reinterpret_cast<Array *>(p_self);
const StringName *class_name = reinterpret_cast<const StringName *>(p_class_name); const StringName *class_name = reinterpret_cast<const StringName *>(p_class_name);
const Variant *script = reinterpret_cast<const Variant *>(p_script); const Variant *script = reinterpret_cast<const Variant *>(p_script);
self->set_typed(p_type, *class_name, *script); self->set_typed((uint32_t)p_type, *class_name, *script);
} }
/* Dictionary functions */ /* Dictionary functions */

View file

@ -554,7 +554,7 @@ typedef struct {
GDExtensionVariantPtr (*array_operator_index)(GDExtensionTypePtr p_self, GDExtensionInt p_index); // p_self should be an Array ptr GDExtensionVariantPtr (*array_operator_index)(GDExtensionTypePtr p_self, GDExtensionInt p_index); // p_self should be an Array ptr
GDExtensionVariantPtr (*array_operator_index_const)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index); // p_self should be an Array ptr GDExtensionVariantPtr (*array_operator_index_const)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index); // p_self should be an Array ptr
void (*array_ref)(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_from); // p_self should be an Array ptr void (*array_ref)(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_from); // p_self should be an Array ptr
void (*array_set_typed)(GDExtensionTypePtr p_self, uint32_t p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script); // p_self should be an Array ptr void (*array_set_typed)(GDExtensionTypePtr p_self, GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script); // p_self should be an Array ptr
/* Dictionary functions */ /* Dictionary functions */