RID rework.

This commit is contained in:
Relintai 2023-05-26 18:48:57 +02:00
parent 8d8409ed1e
commit f40012edd7
2 changed files with 8 additions and 8 deletions

View File

@ -30,8 +30,8 @@
#include "gdn/rid.h" #include "gdn/rid.h"
#include "core/object/resource.h"
#include "core/containers/rid.h" #include "core/containers/rid.h"
#include "core/object/resource.h"
#include "core/variant/variant.h" #include "core/variant/variant.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -40,11 +40,6 @@ extern "C" {
static_assert(sizeof(pandemonium_rid) == sizeof(RID), "RID size mismatch"); static_assert(sizeof(pandemonium_rid) == sizeof(RID), "RID size mismatch");
void GDAPI pandemonium_rid_new(pandemonium_rid *r_dest) {
RID *dest = (RID *)r_dest;
memnew_placement(dest, RID);
}
pandemonium_int GDAPI pandemonium_rid_get_id(const pandemonium_rid *p_self) { pandemonium_int GDAPI pandemonium_rid_get_id(const pandemonium_rid *p_self) {
const RID *self = (const RID *)p_self; const RID *self = (const RID *)p_self;
return self->get_id(); return self->get_id();
@ -71,6 +66,11 @@ pandemonium_bool GDAPI pandemonium_rid_operator_less(const pandemonium_rid *p_se
return *self < *b; return *self < *b;
} }
void GDAPI pandemonium_rid_new(pandemonium_rid *r_dest) {
RID *dest = (RID *)r_dest;
memnew_placement(dest, RID);
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -57,8 +57,6 @@ typedef struct {
extern "C" { extern "C" {
#endif #endif
void GDAPI pandemonium_rid_new(pandemonium_rid *r_dest);
pandemonium_int GDAPI pandemonium_rid_get_id(const pandemonium_rid *p_self); pandemonium_int GDAPI pandemonium_rid_get_id(const pandemonium_rid *p_self);
void GDAPI pandemonium_rid_new_with_resource(pandemonium_rid *r_dest, const pandemonium_object *p_from); void GDAPI pandemonium_rid_new_with_resource(pandemonium_rid *r_dest, const pandemonium_object *p_from);
@ -67,6 +65,8 @@ pandemonium_bool GDAPI pandemonium_rid_operator_equal(const pandemonium_rid *p_s
pandemonium_bool GDAPI pandemonium_rid_operator_less(const pandemonium_rid *p_self, const pandemonium_rid *p_b); pandemonium_bool GDAPI pandemonium_rid_operator_less(const pandemonium_rid *p_self, const pandemonium_rid *p_b);
void GDAPI pandemonium_rid_new(pandemonium_rid *r_dest);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif