Merge pull request #68549 from touilleMan/gdextension-revert-get_property_type_func-removal
Revert removal of GDNativeExtensionScriptInstanceInfo::get_property_type_func in GDExtension
This commit is contained in:
commit
324106b3df
@ -309,6 +309,7 @@ typedef GDNativeBool (*GDNativeExtensionScriptInstanceSet)(GDNativeExtensionScri
|
|||||||
typedef GDNativeBool (*GDNativeExtensionScriptInstanceGet)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name, GDNativeVariantPtr r_ret);
|
typedef GDNativeBool (*GDNativeExtensionScriptInstanceGet)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name, GDNativeVariantPtr r_ret);
|
||||||
typedef const GDNativePropertyInfo *(*GDNativeExtensionScriptInstanceGetPropertyList)(GDNativeExtensionScriptInstanceDataPtr p_instance, uint32_t *r_count);
|
typedef const GDNativePropertyInfo *(*GDNativeExtensionScriptInstanceGetPropertyList)(GDNativeExtensionScriptInstanceDataPtr p_instance, uint32_t *r_count);
|
||||||
typedef void (*GDNativeExtensionScriptInstanceFreePropertyList)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativePropertyInfo *p_list);
|
typedef void (*GDNativeExtensionScriptInstanceFreePropertyList)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativePropertyInfo *p_list);
|
||||||
|
typedef GDNativeVariantType (*GDNativeExtensionScriptInstanceGetPropertyType)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name, GDNativeBool *r_is_valid);
|
||||||
|
|
||||||
typedef GDNativeBool (*GDNativeExtensionScriptInstancePropertyCanRevert)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name);
|
typedef GDNativeBool (*GDNativeExtensionScriptInstancePropertyCanRevert)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name);
|
||||||
typedef GDNativeBool (*GDNativeExtensionScriptInstancePropertyGetRevert)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name, GDNativeVariantPtr r_ret);
|
typedef GDNativeBool (*GDNativeExtensionScriptInstancePropertyGetRevert)(GDNativeExtensionScriptInstanceDataPtr p_instance, const GDNativeStringNamePtr p_name, GDNativeVariantPtr r_ret);
|
||||||
@ -354,6 +355,7 @@ typedef struct {
|
|||||||
|
|
||||||
GDNativeExtensionScriptInstanceGetMethodList get_method_list_func;
|
GDNativeExtensionScriptInstanceGetMethodList get_method_list_func;
|
||||||
GDNativeExtensionScriptInstanceFreeMethodList free_method_list_func;
|
GDNativeExtensionScriptInstanceFreeMethodList free_method_list_func;
|
||||||
|
GDNativeExtensionScriptInstanceGetPropertyType get_property_type_func;
|
||||||
|
|
||||||
GDNativeExtensionScriptInstanceHasMethod has_method_func;
|
GDNativeExtensionScriptInstanceHasMethod has_method_func;
|
||||||
|
|
||||||
|
@ -681,21 +681,15 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = nullptr) const override {
|
virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = nullptr) const override {
|
||||||
Variant::Type type = Variant::Type::NIL;
|
if (native_info->get_property_type_func) {
|
||||||
if (native_info->get_property_list_func) {
|
GDNativeBool is_valid = 0;
|
||||||
uint32_t pcount;
|
GDNativeVariantType type = native_info->get_property_type_func(instance, (const GDNativeStringNamePtr)&p_name, &is_valid);
|
||||||
const GDNativePropertyInfo *pinfo = native_info->get_property_list_func(instance, &pcount);
|
if (r_is_valid) {
|
||||||
for (uint32_t i = 0; i < pcount; i++) {
|
*r_is_valid = is_valid != 0;
|
||||||
if (p_name == *reinterpret_cast<StringName *>(pinfo->name)) {
|
|
||||||
type = Variant::Type(pinfo->type);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (native_info->free_property_list_func) {
|
|
||||||
native_info->free_property_list_func(instance, pinfo);
|
|
||||||
}
|
}
|
||||||
|
return Variant::Type(type);
|
||||||
}
|
}
|
||||||
return type;
|
return Variant::NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool property_can_revert(const StringName &p_name) const override {
|
virtual bool property_can_revert(const StringName &p_name) const override {
|
||||||
|
Loading…
Reference in New Issue
Block a user