Compare commits

..

3 Commits

Author SHA1 Message Date
Chris Cranford 9168b89a53
Merge ab00640afc into 0ddef6ed96 2024-01-14 00:57:00 +00:00
Chris Cranford ab00640afc Add pure virtual test 2024-01-13 19:56:48 -05:00
Chris Cranford 16be4f8750 Rework GDCLASS macro to allow pure virtual functions 2024-01-12 16:28:23 -05:00
1 changed files with 3 additions and 11 deletions

View File

@ -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)
}
};