mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-01 05:48:37 +03:00
Use StringName in the whole GDExtension API instead of const char *
This commit is contained in:
@@ -36,20 +36,24 @@
|
||||
|
||||
namespace godot {
|
||||
|
||||
const StringName *Wrapped::_get_extension_class() const {
|
||||
const StringName *Wrapped::_get_extension_class_name() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Wrapped::_postinitialize() {
|
||||
const StringName *extension_class = _get_extension_class();
|
||||
const StringName *extension_class = _get_extension_class_name();
|
||||
if (extension_class) {
|
||||
godot::internal::gdn_interface->object_set_instance(_owner, (void *)extension_class, this);
|
||||
// TODO: replace C cast by a proper reinterpret_cast once `object_set_instance` signature correctly handles `const GDNativeStringNamePtr` param
|
||||
// (see: https://github.com/godotengine/godot/pull/67751)
|
||||
godot::internal::gdn_interface->object_set_instance(_owner, (GDNativeStringNamePtr)(extension_class), this);
|
||||
}
|
||||
godot::internal::gdn_interface->object_set_instance_binding(_owner, godot::internal::token, this, _get_bindings_callbacks());
|
||||
}
|
||||
|
||||
Wrapped::Wrapped(const StringName p_godot_class) {
|
||||
_owner = godot::internal::gdn_interface->classdb_construct_object((void *)&p_godot_class);
|
||||
// TODO: replace C cast by a proper reinterpret_cast once `classdb_construct_object` signature correctly handles `const GDNativeStringNamePtr` param
|
||||
// (see: https://github.com/godotengine/godot/pull/67751)
|
||||
_owner = godot::internal::gdn_interface->classdb_construct_object((GDNativeStringNamePtr)(p_godot_class._native_ptr()));
|
||||
}
|
||||
|
||||
Wrapped::Wrapped(GodotObject *p_godot_object) {
|
||||
|
||||
Reference in New Issue
Block a user