Compare commits
3 Commits
04c46ac573
...
9168b89a53
Author | SHA1 | Date |
---|---|---|
|
9168b89a53 | |
|
ab00640afc | |
|
16be4f8750 |
|
@ -152,20 +152,12 @@ template <class T>
|
|||
class ClassCreator {
|
||||
public:
|
||||
static GDExtensionObjectPtr create(void *data) {
|
||||
if constexpr (!std::is_abstract_v<T>) {
|
||||
T *new_object = memnew(T);
|
||||
return new_object->_owner;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
T *new_object = memnew(T);
|
||||
return new_object->_owner;
|
||||
};
|
||||
|
||||
static GDExtensionClassInstancePtr recreate(void *data, GDExtensionObjectPtr obj) {
|
||||
if constexpr (!std::is_abstract_v<T>) {
|
||||
_GDCLASS_RECREATE(T)
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
_GDCLASS_RECREATE(T)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue