Merge pull request #1013 from bruvzg/set_typed_move
Move Array:set_typed to internal GDExtension structure.pull/977/head
commit
f59fd96ab4
|
@ -696,6 +696,7 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
|
|||
if class_name == "Array":
|
||||
result.append(f"\tconst Variant &operator[](int p_index) const;")
|
||||
result.append(f"\tVariant &operator[](int p_index);")
|
||||
result.append(f"\tvoid set_typed(uint32_t p_type, const StringName &p_class_name, const Variant &p_script);")
|
||||
|
||||
if class_name == "Dictionary":
|
||||
result.append(f"\tconst Variant &operator[](const Variant &p_key) const;")
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -551,6 +551,7 @@ typedef struct {
|
|||
|
||||
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
|
||||
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
|
||||
|
||||
/* Dictionary functions */
|
||||
|
||||
|
|
|
@ -208,6 +208,10 @@ Variant &Array::operator[](int p_index) {
|
|||
return *var;
|
||||
}
|
||||
|
||||
void Array::set_typed(uint32_t p_type, const StringName &p_class_name, const Variant &p_script) {
|
||||
internal::gde_interface->array_set_typed((GDExtensionTypePtr *)this, p_type, (GDExtensionConstStringNamePtr)&p_class_name, (GDExtensionConstVariantPtr)&p_script);
|
||||
}
|
||||
|
||||
const Variant &Dictionary::operator[](const Variant &p_key) const {
|
||||
const Variant *var = (const Variant *)internal::gde_interface->dictionary_operator_index_const((GDExtensionTypePtr *)this, (GDExtensionVariantPtr)&p_key);
|
||||
return *var;
|
||||
|
|
|
@ -57,9 +57,6 @@ func _ready():
|
|||
prints("String += operator")
|
||||
prints(" test string +=", $Example.test_string_ops())
|
||||
|
||||
prints("WorkerThreadPool")
|
||||
prints(" test worker_thread_pool", $Example.test_workpool_ops())
|
||||
|
||||
prints("PackedArray iterators")
|
||||
prints(" test packed array iterators", $Example.test_vector_ops())
|
||||
|
||||
|
|
Loading…
Reference in New Issue