diff options
Diffstat (limited to 'modules/dlscript/godot')
| -rw-r--r-- | modules/dlscript/godot/godot_node_path.cpp | 8 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_node_path.h | 1 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_quat.cpp | 2 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_string.cpp | 2 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_transform.cpp | 2 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_variant.cpp | 20 | ||||
| -rw-r--r-- | modules/dlscript/godot/godot_variant.h | 8 |
7 files changed, 28 insertions, 15 deletions
diff --git a/modules/dlscript/godot/godot_node_path.cpp b/modules/dlscript/godot/godot_node_path.cpp index cc0652c75b..8b79175e44 100644 --- a/modules/dlscript/godot/godot_node_path.cpp +++ b/modules/dlscript/godot/godot_node_path.cpp @@ -2,8 +2,6 @@ #include "path_db.h" -#include <memory.h> // why is there no <cmemory> btw? - #ifdef __cplusplus extern "C" { #endif @@ -22,6 +20,12 @@ void GDAPI godot_node_path_new(godot_node_path *p_np, const godot_string *p_from memnew_placement_custom(np, NodePath, NodePath(*from)); } +void GDAPI godot_node_path_copy(godot_node_path *p_np, const godot_node_path *p_from) { + NodePath *np = (NodePath *)p_np; + NodePath *from = (NodePath *)p_from; + *np = *from; +} + godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_np, const godot_int p_idx) { const NodePath *np = (const NodePath *)p_np; godot_string str; diff --git a/modules/dlscript/godot/godot_node_path.h b/modules/dlscript/godot/godot_node_path.h index b322e55d83..04f1e70c1d 100644 --- a/modules/dlscript/godot/godot_node_path.h +++ b/modules/dlscript/godot/godot_node_path.h @@ -16,6 +16,7 @@ typedef struct godot_node_path { #include "../godot.h" void GDAPI godot_node_path_new(godot_node_path *p_np, const godot_string *p_from); +void GDAPI godot_node_path_copy(godot_node_path *p_np, const godot_node_path *p_from); godot_string GDAPI godot_node_path_get_name(const godot_node_path *p_np, const godot_int p_idx); godot_int GDAPI godot_node_path_get_name_count(const godot_node_path *p_np); diff --git a/modules/dlscript/godot/godot_quat.cpp b/modules/dlscript/godot/godot_quat.cpp index 5571614e07..9bd2eb0639 100644 --- a/modules/dlscript/godot/godot_quat.cpp +++ b/modules/dlscript/godot/godot_quat.cpp @@ -2,8 +2,6 @@ #include "math/quat.h" -#include <memory.h> // why is there no <cmemory> btw? - #ifdef __cplusplus extern "C" { #endif diff --git a/modules/dlscript/godot/godot_string.cpp b/modules/dlscript/godot/godot_string.cpp index 1501743e02..97d0985a50 100644 --- a/modules/dlscript/godot/godot_string.cpp +++ b/modules/dlscript/godot/godot_string.cpp @@ -3,7 +3,7 @@ #include "string_db.h" #include "ustring.h" -#include <memory.h> // why is there no <cmemory> btw? +#include <string.h> #ifdef __cplusplus extern "C" { diff --git a/modules/dlscript/godot/godot_transform.cpp b/modules/dlscript/godot/godot_transform.cpp index 18d218e6c4..c8da519f6b 100644 --- a/modules/dlscript/godot/godot_transform.cpp +++ b/modules/dlscript/godot/godot_transform.cpp @@ -2,8 +2,6 @@ #include "math/transform.h" -#include <memory.h> // why is there no <cmemory> btw? - #ifdef __cplusplus extern "C" { #endif diff --git a/modules/dlscript/godot/godot_variant.cpp b/modules/dlscript/godot/godot_variant.cpp index e7c47ff9ff..3681f89753 100644 --- a/modules/dlscript/godot/godot_variant.cpp +++ b/modules/dlscript/godot/godot_variant.cpp @@ -34,7 +34,12 @@ void GDAPI godot_variant_new_bool(godot_variant *p_v, const godot_bool p_b) { memnew_placement_custom(v, Variant, Variant(p_b)); } -void GDAPI godot_variant_new_int(godot_variant *p_v, const uint64_t p_i) { +void GDAPI godot_variant_new_uint(godot_variant *p_v, const uint64_t p_i) { + Variant *v = (Variant *)p_v; + memnew_placement_custom(v, Variant, Variant(p_i)); +} + +void GDAPI godot_variant_new_int(godot_variant *p_v, const int64_t p_i) { Variant *v = (Variant *)p_v; memnew_placement_custom(v, Variant, Variant(p_i)); } @@ -199,14 +204,19 @@ godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_v) { return v->operator bool(); } -uint64_t GDAPI godot_variant_as_int(const godot_variant *p_v) { +uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_v) { + const Variant *v = (const Variant *)p_v; + return v->operator uint64_t(); +} + +int64_t GDAPI godot_variant_as_int(const godot_variant *p_v) { const Variant *v = (const Variant *)p_v; - return v->operator godot_int(); + return v->operator int64_t(); } -godot_real GDAPI godot_variant_as_real(const godot_variant *p_v) { +double GDAPI godot_variant_as_real(const godot_variant *p_v) { const Variant *v = (const Variant *)p_v; - return v->operator godot_real(); + return v->operator double(); } godot_string GDAPI godot_variant_as_string(const godot_variant *p_v) { diff --git a/modules/dlscript/godot/godot_variant.h b/modules/dlscript/godot/godot_variant.h index 0b91af863d..1ff5ba4a57 100644 --- a/modules/dlscript/godot/godot_variant.h +++ b/modules/dlscript/godot/godot_variant.h @@ -71,7 +71,8 @@ void GDAPI godot_variant_copy(godot_variant *p_dest, const godot_variant *p_src) void GDAPI godot_variant_new_nil(godot_variant *p_v); void GDAPI godot_variant_new_bool(godot_variant *p_v, const godot_bool p_b); -void GDAPI godot_variant_new_int(godot_variant *p_v, const uint64_t p_i); +void GDAPI godot_variant_new_uint(godot_variant *p_v, const uint64_t p_i); +void GDAPI godot_variant_new_int(godot_variant *p_v, const int64_t p_i); void GDAPI godot_variant_new_real(godot_variant *p_v, const double p_r); void GDAPI godot_variant_new_string(godot_variant *p_v, const godot_string *p_s); void GDAPI godot_variant_new_vector2(godot_variant *p_v, const godot_vector2 *p_v2); @@ -100,8 +101,9 @@ void GDAPI godot_variant_new_pool_vector3_array(godot_variant *p_v, const godot_ void GDAPI godot_variant_new_pool_color_array(godot_variant *p_v, const godot_pool_color_array *p_pca); godot_bool GDAPI godot_variant_as_bool(const godot_variant *p_v); -uint64_t GDAPI godot_variant_as_int(const godot_variant *p_v); -godot_real GDAPI godot_variant_as_real(const godot_variant *p_v); +uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_v); +int64_t GDAPI godot_variant_as_int(const godot_variant *p_v); +double GDAPI godot_variant_as_real(const godot_variant *p_v); godot_string GDAPI godot_variant_as_string(const godot_variant *p_v); godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_v); godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_v); |