diff options
Diffstat (limited to 'modules/gdnative/include')
-rw-r--r-- | modules/gdnative/include/gdnative/array.h | 8 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/callable.h | 126 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/color.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 18 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/packed_arrays.h (renamed from modules/gdnative/include/gdnative/pool_arrays.h) | 207 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/rect2.h | 54 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/rid.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/variant.h | 40 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/vector2.h | 57 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/vector3.h | 55 | ||||
-rw-r--r-- | modules/gdnative/include/nativescript/godot_nativescript.h | 82 | ||||
-rw-r--r-- | modules/gdnative/include/net/godot_net.h | 1 | ||||
-rw-r--r-- | modules/gdnative/include/videodecoder/godot_videodecoder.h | 2 |
13 files changed, 535 insertions, 119 deletions
diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index e3114e9348..4db685873f 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -51,7 +51,7 @@ typedef struct { } #endif -#include <gdnative/pool_arrays.h> +#include <gdnative/packed_arrays.h> #include <gdnative/variant.h> #include <gdnative/gdnative.h> @@ -66,8 +66,10 @@ void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_p void GDAPI godot_array_new_packed_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a); void GDAPI godot_array_new_packed_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a); void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa); -void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra); -void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia); +void GDAPI godot_array_new_packed_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra); +void GDAPI godot_array_new_packed_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra); +void GDAPI godot_array_new_packed_int32_array(godot_array *r_dest, const godot_packed_int32_array *p_pia); +void GDAPI godot_array_new_packed_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia); void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba); void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value); diff --git a/modules/gdnative/include/gdnative/callable.h b/modules/gdnative/include/gdnative/callable.h new file mode 100644 index 0000000000..dbb5d02590 --- /dev/null +++ b/modules/gdnative/include/gdnative/callable.h @@ -0,0 +1,126 @@ +/*************************************************************************/ +/* callable.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef GODOT_CALLABLE_H +#define GODOT_CALLABLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdint.h> + +#define GODOT_CALLABLE_SIZE (16) + +#ifndef GODOT_CORE_API_GODOT_CALLABLE_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_CALLABLE_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_CALLABLE_SIZE]; +} godot_callable; +#endif + +#define GODOT_SIGNAL_SIZE (16) + +#ifndef GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_SIGNAL_SIZE]; +} godot_signal; +#endif + +#ifdef __cplusplus +} +#endif + +#include <gdnative/gdnative.h> +#include <gdnative/string_name.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// Callable + +void GDAPI godot_callable_new_with_object(godot_callable *r_dest, const godot_object *p_object, const godot_string_name *p_method); +void GDAPI godot_callable_new_with_object_id(godot_callable *r_dest, uint64_t p_objectid, const godot_string_name *p_method); +void GDAPI godot_callable_new_copy(godot_callable *r_dest, const godot_callable *p_src); + +void GDAPI godot_callable_destroy(godot_callable *p_self); + +godot_int GDAPI godot_callable_call(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount, godot_variant *r_return_value); +void GDAPI godot_callable_call_deferred(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount); + +godot_bool GDAPI godot_callable_is_null(const godot_callable *p_self); +godot_bool GDAPI godot_callable_is_custom(const godot_callable *p_self); +godot_bool GDAPI godot_callable_is_standard(const godot_callable *p_self); + +godot_object GDAPI *godot_callable_get_object(const godot_callable *p_self); +uint64_t GDAPI godot_callable_get_object_id(const godot_callable *p_self); +godot_string_name GDAPI godot_callable_get_method(const godot_callable *p_self); + +uint32_t GDAPI godot_callable_hash(const godot_callable *p_self); + +godot_string GDAPI godot_callable_as_string(const godot_callable *p_self); + +godot_bool GDAPI godot_callable_operator_equal(const godot_callable *p_self, const godot_callable *p_other); +godot_bool GDAPI godot_callable_operator_less(const godot_callable *p_self, const godot_callable *p_other); + +// Signal + +void GDAPI godot_signal_new_with_object(godot_signal *r_dest, const godot_object *p_object, const godot_string_name *p_name); +void GDAPI godot_signal_new_with_object_id(godot_signal *r_dest, uint64_t p_objectid, const godot_string_name *p_name); +void GDAPI godot_signal_new_copy(godot_signal *r_dest, const godot_signal *p_src); + +void GDAPI godot_signal_destroy(godot_signal *p_self); + +godot_int GDAPI godot_signal_emit(const godot_signal *p_self, const godot_variant **p_arguments, godot_int p_argcount); + +godot_int GDAPI godot_signal_connect(godot_signal *p_self, const godot_callable *p_callable, const godot_array *p_binds, uint32_t p_flags); +void GDAPI godot_signal_disconnect(godot_signal *p_self, const godot_callable *p_callable); + +godot_bool GDAPI godot_signal_is_null(const godot_signal *p_self); +godot_bool GDAPI godot_signal_is_connected(const godot_signal *p_self, const godot_callable *p_callable); + +godot_array GDAPI godot_signal_get_connections(const godot_signal *p_self); + +godot_object GDAPI *godot_signal_get_object(const godot_signal *p_self); +uint64_t GDAPI godot_signal_get_object_id(const godot_signal *p_self); +godot_string_name GDAPI godot_signal_get_name(const godot_signal *p_self); + +godot_string GDAPI godot_signal_as_string(const godot_signal *p_self); + +godot_bool GDAPI godot_signal_operator_equal(const godot_signal *p_self, const godot_signal *p_other); +godot_bool GDAPI godot_signal_operator_less(const godot_signal *p_self, const godot_signal *p_other); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/modules/gdnative/include/gdnative/color.h b/modules/gdnative/include/gdnative/color.h index 47c01dbb20..e7737bf8e1 100644 --- a/modules/gdnative/include/gdnative/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -95,7 +95,7 @@ godot_color GDAPI godot_color_inverted(const godot_color *p_self); godot_color GDAPI godot_color_contrasted(const godot_color *p_self); -godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); +godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 6fdca30122..6a0a375da8 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -144,15 +144,15 @@ typedef void godot_object; #include <gdnative/string_name.h> -////// Vector2 +////// Vector2 & Vector2i #include <gdnative/vector2.h> -////// Rect2 +////// Rect2 & Rect2i #include <gdnative/rect2.h> -////// Vector3 +////// Vector3 & Vector3i #include <gdnative/vector3.h> @@ -192,6 +192,10 @@ typedef void godot_object; #include <gdnative/rid.h> +/////// Callable & Signal + +#include <gdnative/callable.h> + /////// Dictionary #include <gdnative/dictionary.h> @@ -200,8 +204,8 @@ typedef void godot_object; #include <gdnative/array.h> -// single API file for Pool*Array -#include <gdnative/pool_arrays.h> +// single API file for Packed*Array +#include <gdnative/packed_arrays.h> void GDAPI godot_object_destroy(godot_object *p_o); @@ -289,7 +293,9 @@ void GDAPI *godot_get_class_tag(const godot_string_name *p_class); godot_object GDAPI *godot_object_cast_to(const godot_object *p_object, void *p_class_tag); // equivalent of GDScript's instance_from_id -godot_object GDAPI *godot_instance_from_id(godot_int p_instance_id); +godot_object GDAPI *godot_instance_from_id(uint64_t p_instance_id); + +uint64_t GDAPI godot_object_get_instance_id(const godot_object *p_object); #ifdef __cplusplus } diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/packed_arrays.h index c610377f54..8cff6d49a5 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/packed_arrays.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* pool_arrays.h */ +/* packed_arrays.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef GODOT_POOL_ARRAYS_H -#define GODOT_POOL_ARRAYS_H +#ifndef GODOT_PACKED_ARRAYS_H +#define GODOT_PACKED_ARRAYS_H #ifdef __cplusplus extern "C" { @@ -39,7 +39,7 @@ extern "C" { /////// PackedByteArray -#define GODOT_PACKED_BYTE_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_BYTE_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED @@ -50,29 +50,51 @@ typedef struct { /////// PackedInt32Array -#define GODOT_PACKED_INT_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_INT32_ARRAY_SIZE (2 * sizeof(void *)) -#ifndef GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_INT32_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_INT32_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_PACKED_INT_ARRAY_SIZE]; -} godot_packed_int_array; + uint8_t _dont_touch_that[GODOT_PACKED_INT32_ARRAY_SIZE]; +} godot_packed_int32_array; +#endif + +/////// PackedInt64Array + +#define GODOT_PACKED_INT64_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_INT64_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_INT64_ARRAY_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_PACKED_INT64_ARRAY_SIZE]; +} godot_packed_int64_array; #endif /////// PackedFloat32Array -#define GODOT_PACKED_REAL_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_FLOAT32_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_FLOAT32_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_FLOAT32_ARRAY_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_PACKED_FLOAT32_ARRAY_SIZE]; +} godot_packed_float32_array; +#endif + +/////// PackedFloat64Array -#ifndef GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED +#define GODOT_PACKED_FLOAT64_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_FLOAT64_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_FLOAT64_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_PACKED_REAL_ARRAY_SIZE]; -} godot_packed_real_array; + uint8_t _dont_touch_that[GODOT_PACKED_FLOAT64_ARRAY_SIZE]; +} godot_packed_float64_array; #endif /////// PackedStringArray -#define GODOT_PACKED_STRING_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_STRING_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED @@ -83,7 +105,7 @@ typedef struct { /////// PackedVector2Array -#define GODOT_PACKED_VECTOR2_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR2_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED @@ -94,7 +116,7 @@ typedef struct { /////// PackedVector3Array -#define GODOT_PACKED_VECTOR3_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR3_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED @@ -105,7 +127,7 @@ typedef struct { /////// PackedColorArray -#define GODOT_PACKED_COLOR_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_COLOR_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED @@ -136,6 +158,9 @@ void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *r_dest); void GDAPI godot_packed_byte_array_new_copy(godot_packed_byte_array *r_dest, const godot_packed_byte_array *p_src); void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_dest, const godot_array *p_a); +const uint8_t GDAPI *godot_packed_byte_array_ptr(const godot_packed_byte_array *p_self); +uint8_t GDAPI *godot_packed_byte_array_ptrw(godot_packed_byte_array *p_self); + void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data); void GDAPI godot_packed_byte_array_append_array(godot_packed_byte_array *p_self, const godot_packed_byte_array *p_array); @@ -159,63 +184,133 @@ godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_ void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self); -// int +// int32 + +void GDAPI godot_packed_int32_array_new(godot_packed_int32_array *r_dest); +void GDAPI godot_packed_int32_array_new_copy(godot_packed_int32_array *r_dest, const godot_packed_int32_array *p_src); +void GDAPI godot_packed_int32_array_new_with_array(godot_packed_int32_array *r_dest, const godot_array *p_a); + +const int32_t GDAPI *godot_packed_int32_array_ptr(const godot_packed_int32_array *p_self); +int32_t GDAPI *godot_packed_int32_array_ptrw(godot_packed_int32_array *p_self); + +void GDAPI godot_packed_int32_array_append(godot_packed_int32_array *p_self, const int32_t p_data); + +void GDAPI godot_packed_int32_array_append_array(godot_packed_int32_array *p_self, const godot_packed_int32_array *p_array); + +godot_error GDAPI godot_packed_int32_array_insert(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data); + +void GDAPI godot_packed_int32_array_invert(godot_packed_int32_array *p_self); + +void GDAPI godot_packed_int32_array_push_back(godot_packed_int32_array *p_self, const int32_t p_data); + +void GDAPI godot_packed_int32_array_remove(godot_packed_int32_array *p_self, const godot_int p_idx); + +void GDAPI godot_packed_int32_array_resize(godot_packed_int32_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_int32_array_set(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data); +int32_t GDAPI godot_packed_int32_array_get(const godot_packed_int32_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_self); + +godot_bool GDAPI godot_packed_int32_array_empty(const godot_packed_int32_array *p_self); -void GDAPI godot_packed_int_array_new(godot_packed_int_array *r_dest); -void GDAPI godot_packed_int_array_new_copy(godot_packed_int_array *r_dest, const godot_packed_int_array *p_src); -void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, const godot_array *p_a); +void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self); -void GDAPI godot_packed_int_array_append(godot_packed_int_array *p_self, const godot_int p_data); +// int64 -void GDAPI godot_packed_int_array_append_array(godot_packed_int_array *p_self, const godot_packed_int_array *p_array); +void GDAPI godot_packed_int64_array_new(godot_packed_int64_array *r_dest); +void GDAPI godot_packed_int64_array_new_copy(godot_packed_int64_array *r_dest, const godot_packed_int64_array *p_src); +void GDAPI godot_packed_int64_array_new_with_array(godot_packed_int64_array *r_dest, const godot_array *p_a); -godot_error GDAPI godot_packed_int_array_insert(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); +const int64_t GDAPI *godot_packed_int64_array_ptr(const godot_packed_int64_array *p_self); +int64_t GDAPI *godot_packed_int64_array_ptrw(godot_packed_int64_array *p_self); -void GDAPI godot_packed_int_array_invert(godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_append(godot_packed_int64_array *p_self, const int64_t p_data); -void GDAPI godot_packed_int_array_push_back(godot_packed_int_array *p_self, const godot_int p_data); +void GDAPI godot_packed_int64_array_append_array(godot_packed_int64_array *p_self, const godot_packed_int64_array *p_array); -void GDAPI godot_packed_int_array_remove(godot_packed_int_array *p_self, const godot_int p_idx); +godot_error GDAPI godot_packed_int64_array_insert(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data); -void GDAPI godot_packed_int_array_resize(godot_packed_int_array *p_self, const godot_int p_size); +void GDAPI godot_packed_int64_array_invert(godot_packed_int64_array *p_self); -void GDAPI godot_packed_int_array_set(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); -godot_int GDAPI godot_packed_int_array_get(const godot_packed_int_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_int64_array_push_back(godot_packed_int64_array *p_self, const int64_t p_data); -godot_int GDAPI godot_packed_int_array_size(const godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_remove(godot_packed_int64_array *p_self, const godot_int p_idx); -godot_bool GDAPI godot_packed_int_array_empty(const godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_resize(godot_packed_int64_array *p_self, const godot_int p_size); -void GDAPI godot_packed_int_array_destroy(godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_set(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data); +int64_t GDAPI godot_packed_int64_array_get(const godot_packed_int64_array *p_self, const godot_int p_idx); -// real +godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_new(godot_packed_real_array *r_dest); -void GDAPI godot_packed_real_array_new_copy(godot_packed_real_array *r_dest, const godot_packed_real_array *p_src); -void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_dest, const godot_array *p_a); +godot_bool GDAPI godot_packed_int64_array_empty(const godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_append(godot_packed_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_append_array(godot_packed_real_array *p_self, const godot_packed_real_array *p_array); +// float32 -godot_error GDAPI godot_packed_real_array_insert(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); +void GDAPI godot_packed_float32_array_new(godot_packed_float32_array *r_dest); +void GDAPI godot_packed_float32_array_new_copy(godot_packed_float32_array *r_dest, const godot_packed_float32_array *p_src); +void GDAPI godot_packed_float32_array_new_with_array(godot_packed_float32_array *r_dest, const godot_array *p_a); -void GDAPI godot_packed_real_array_invert(godot_packed_real_array *p_self); +const float GDAPI *godot_packed_float32_array_ptr(const godot_packed_float32_array *p_self); +float GDAPI *godot_packed_float32_array_ptrw(godot_packed_float32_array *p_self); -void GDAPI godot_packed_real_array_push_back(godot_packed_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_float32_array_append(godot_packed_float32_array *p_self, const float p_data); -void GDAPI godot_packed_real_array_remove(godot_packed_real_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_float32_array_append_array(godot_packed_float32_array *p_self, const godot_packed_float32_array *p_array); -void GDAPI godot_packed_real_array_resize(godot_packed_real_array *p_self, const godot_int p_size); +godot_error GDAPI godot_packed_float32_array_insert(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data); -void GDAPI godot_packed_real_array_set(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); -godot_real GDAPI godot_packed_real_array_get(const godot_packed_real_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_float32_array_invert(godot_packed_float32_array *p_self); -godot_int GDAPI godot_packed_real_array_size(const godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_push_back(godot_packed_float32_array *p_self, const float p_data); -godot_bool GDAPI godot_packed_real_array_empty(const godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_remove(godot_packed_float32_array *p_self, const godot_int p_idx); -void GDAPI godot_packed_real_array_destroy(godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_resize(godot_packed_float32_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_float32_array_set(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data); +float GDAPI godot_packed_float32_array_get(const godot_packed_float32_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array *p_self); + +godot_bool GDAPI godot_packed_float32_array_empty(const godot_packed_float32_array *p_self); + +void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self); + +// float64 + +void GDAPI godot_packed_float64_array_new(godot_packed_float64_array *r_dest); +void GDAPI godot_packed_float64_array_new_copy(godot_packed_float64_array *r_dest, const godot_packed_float64_array *p_src); +void GDAPI godot_packed_float64_array_new_with_array(godot_packed_float64_array *r_dest, const godot_array *p_a); + +const double GDAPI *godot_packed_float64_array_ptr(const godot_packed_float64_array *p_self); +double GDAPI *godot_packed_float64_array_ptrw(godot_packed_float64_array *p_self); + +void GDAPI godot_packed_float64_array_append(godot_packed_float64_array *p_self, const double p_data); + +void GDAPI godot_packed_float64_array_append_array(godot_packed_float64_array *p_self, const godot_packed_float64_array *p_array); + +godot_error GDAPI godot_packed_float64_array_insert(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data); + +void GDAPI godot_packed_float64_array_invert(godot_packed_float64_array *p_self); + +void GDAPI godot_packed_float64_array_push_back(godot_packed_float64_array *p_self, const double p_data); + +void GDAPI godot_packed_float64_array_remove(godot_packed_float64_array *p_self, const godot_int p_idx); + +void GDAPI godot_packed_float64_array_resize(godot_packed_float64_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_float64_array_set(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data); +double GDAPI godot_packed_float64_array_get(const godot_packed_float64_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array *p_self); + +godot_bool GDAPI godot_packed_float64_array_empty(const godot_packed_float64_array *p_self); + +void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self); // string @@ -223,6 +318,9 @@ void GDAPI godot_packed_string_array_new(godot_packed_string_array *r_dest); void GDAPI godot_packed_string_array_new_copy(godot_packed_string_array *r_dest, const godot_packed_string_array *p_src); void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r_dest, const godot_array *p_a); +const godot_string GDAPI *godot_packed_string_array_ptr(const godot_packed_string_array *p_self); +godot_string GDAPI *godot_packed_string_array_ptrw(godot_packed_string_array *p_self); + void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data); void GDAPI godot_packed_string_array_append_array(godot_packed_string_array *p_self, const godot_packed_string_array *p_array); @@ -252,6 +350,9 @@ void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *r_dest); void GDAPI godot_packed_vector2_array_new_copy(godot_packed_vector2_array *r_dest, const godot_packed_vector2_array *p_src); void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array *r_dest, const godot_array *p_a); +const godot_vector2 GDAPI *godot_packed_vector2_array_ptr(const godot_packed_vector2_array *p_self); +godot_vector2 GDAPI *godot_packed_vector2_array_ptrw(godot_packed_vector2_array *p_self); + void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data); void GDAPI godot_packed_vector2_array_append_array(godot_packed_vector2_array *p_self, const godot_packed_vector2_array *p_array); @@ -281,6 +382,9 @@ void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *r_dest); void GDAPI godot_packed_vector3_array_new_copy(godot_packed_vector3_array *r_dest, const godot_packed_vector3_array *p_src); void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array *r_dest, const godot_array *p_a); +const godot_vector3 GDAPI *godot_packed_vector3_array_ptr(const godot_packed_vector3_array *p_self); +godot_vector3 GDAPI *godot_packed_vector3_array_ptrw(godot_packed_vector3_array *p_self); + void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data); void GDAPI godot_packed_vector3_array_append_array(godot_packed_vector3_array *p_self, const godot_packed_vector3_array *p_array); @@ -310,6 +414,9 @@ void GDAPI godot_packed_color_array_new(godot_packed_color_array *r_dest); void GDAPI godot_packed_color_array_new_copy(godot_packed_color_array *r_dest, const godot_packed_color_array *p_src); void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_dest, const godot_array *p_a); +const godot_color GDAPI *godot_packed_color_array_ptr(const godot_packed_color_array *p_self); +godot_color GDAPI *godot_packed_color_array_ptrw(godot_packed_color_array *p_self); + void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data); void GDAPI godot_packed_color_array_append_array(godot_packed_color_array *p_self, const godot_packed_color_array *p_array); diff --git a/modules/gdnative/include/gdnative/rect2.h b/modules/gdnative/include/gdnative/rect2.h index 0ecf072471..f317afc9da 100644 --- a/modules/gdnative/include/gdnative/rect2.h +++ b/modules/gdnative/include/gdnative/rect2.h @@ -44,6 +44,13 @@ typedef struct godot_rect2 { } godot_rect2; #endif +#ifndef GODOT_CORE_API_GODOT_RECT2I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_RECT2I_TYPE_DEFINED +typedef struct godot_rect2i { + uint8_t _dont_touch_that[16]; +} godot_rect2i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -56,11 +63,15 @@ typedef struct godot_rect2 { extern "C" { #endif +// Rect2 + void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size); void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height); godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self); +godot_rect2i GDAPI godot_rect2_as_rect2i(const godot_rect2 *p_self); + godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self); godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b); @@ -95,6 +106,49 @@ void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_ void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size); +// Rect2I + +void GDAPI godot_rect2i_new_with_position_and_size(godot_rect2i *r_dest, const godot_vector2i *p_pos, const godot_vector2i *p_size); +void GDAPI godot_rect2i_new(godot_rect2i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_width, const godot_int p_height); + +godot_string GDAPI godot_rect2i_as_string(const godot_rect2i *p_self); + +godot_rect2 GDAPI godot_rect2i_as_rect2(const godot_rect2i *p_self); + +godot_int GDAPI godot_rect2i_get_area(const godot_rect2i *p_self); + +godot_bool GDAPI godot_rect2i_intersects(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self); + +godot_rect2i GDAPI godot_rect2i_clip(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_rect2i GDAPI godot_rect2i_merge(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_has_point(const godot_rect2i *p_self, const godot_vector2i *p_point); + +godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int p_by); + +godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, const godot_int p_left, const godot_int p_top, const godot_int p_right, const godot_int p_bottom); + +godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by); + +godot_rect2i GDAPI godot_rect2i_abs(const godot_rect2i *p_self); + +godot_rect2i GDAPI godot_rect2i_expand(const godot_rect2i *p_self, const godot_vector2i *p_to); + +godot_bool GDAPI godot_rect2i_operator_equal(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_vector2i GDAPI godot_rect2i_get_position(const godot_rect2i *p_self); + +godot_vector2i GDAPI godot_rect2i_get_size(const godot_rect2i *p_self); + +void GDAPI godot_rect2i_set_position(godot_rect2i *p_self, const godot_vector2i *p_pos); + +void GDAPI godot_rect2i_set_size(godot_rect2i *p_self, const godot_vector2i *p_size); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/gdnative/rid.h b/modules/gdnative/include/gdnative/rid.h index 04661cedc8..73b601dc04 100644 --- a/modules/gdnative/include/gdnative/rid.h +++ b/modules/gdnative/include/gdnative/rid.h @@ -37,7 +37,7 @@ extern "C" { #include <stdint.h> -#define GODOT_RID_SIZE sizeof(void *) +#define GODOT_RID_SIZE sizeof(uint64_t) #ifndef GODOT_CORE_API_GODOT_RID_TYPE_DEFINED #define GODOT_CORE_API_GODOT_RID_TYPE_DEFINED diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index 934e856fbf..0a611b76e9 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -37,7 +37,7 @@ extern "C" { #include <stdint.h> -#define GODOT_VARIANT_SIZE (16 + sizeof(void *)) +#define GODOT_VARIANT_SIZE (16 + sizeof(int64_t)) #ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED #define GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED @@ -71,16 +71,21 @@ typedef enum godot_variant_type { // misc types GODOT_VARIANT_TYPE_COLOR, + GODOT_VARIANT_TYPE_STRING_NAME, GODOT_VARIANT_TYPE_NODE_PATH, GODOT_VARIANT_TYPE_RID, GODOT_VARIANT_TYPE_OBJECT, + GODOT_VARIANT_TYPE_CALLABLE, + GODOT_VARIANT_TYPE_SIGNAL, GODOT_VARIANT_TYPE_DICTIONARY, GODOT_VARIANT_TYPE_ARRAY, // arrays GODOT_VARIANT_TYPE_PACKED_BYTE_ARRAY, - GODOT_VARIANT_TYPE_PACKED_INT_ARRAY, - GODOT_VARIANT_TYPE_PACKED_REAL_ARRAY, + GODOT_VARIANT_TYPE_PACKED_INT32_ARRAY, + GODOT_VARIANT_TYPE_PACKED_INT64_ARRAY, + GODOT_VARIANT_TYPE_PACKED_FLOAT32_ARRAY, + GODOT_VARIANT_TYPE_PACKED_FLOAT64_ARRAY, GODOT_VARIANT_TYPE_PACKED_STRING_ARRAY, GODOT_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, GODOT_VARIANT_TYPE_PACKED_VECTOR3_ARRAY, @@ -149,15 +154,17 @@ typedef enum godot_variant_operator { #include <gdnative/aabb.h> #include <gdnative/array.h> #include <gdnative/basis.h> +#include <gdnative/callable.h> #include <gdnative/color.h> #include <gdnative/dictionary.h> #include <gdnative/node_path.h> +#include <gdnative/packed_arrays.h> #include <gdnative/plane.h> -#include <gdnative/pool_arrays.h> #include <gdnative/quat.h> #include <gdnative/rect2.h> #include <gdnative/rid.h> #include <gdnative/string.h> +#include <gdnative/string_name.h> #include <gdnative/transform.h> #include <gdnative/transform2d.h> #include <gdnative/variant.h> @@ -181,9 +188,13 @@ void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i); void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i); void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r); void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s); +void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s); void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2); +void GDAPI godot_variant_new_vector2i(godot_variant *r_dest, const godot_vector2i *p_v2); void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2); +void GDAPI godot_variant_new_rect2i(godot_variant *r_dest, const godot_rect2i *p_rect2); void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3); +void GDAPI godot_variant_new_vector3i(godot_variant *r_dest, const godot_vector3i *p_v3); void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d); void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane); void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat); @@ -193,12 +204,16 @@ void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transf void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color); void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np); void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid); +void GDAPI godot_variant_new_callable(godot_variant *r_dest, const godot_callable *p_callable); +void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p_signal); void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj); void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict); void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr); void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba); -void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia); -void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra); +void GDAPI godot_variant_new_packed_int32_array(godot_variant *r_dest, const godot_packed_int32_array *p_pia); +void GDAPI godot_variant_new_packed_int64_array(godot_variant *r_dest, const godot_packed_int64_array *p_pia); +void GDAPI godot_variant_new_packed_float32_array(godot_variant *r_dest, const godot_packed_float32_array *p_pra); +void GDAPI godot_variant_new_packed_float64_array(godot_variant *r_dest, const godot_packed_float64_array *p_pra); void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa); void GDAPI godot_variant_new_packed_vector2_array(godot_variant *r_dest, const godot_packed_vector2_array *p_pv2a); void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const godot_packed_vector3_array *p_pv3a); @@ -209,9 +224,13 @@ uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self); int64_t GDAPI godot_variant_as_int(const godot_variant *p_self); double GDAPI godot_variant_as_real(const godot_variant *p_self); godot_string GDAPI godot_variant_as_string(const godot_variant *p_self); +godot_string_name GDAPI godot_variant_as_string_name(const godot_variant *p_self); godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self); +godot_vector2i GDAPI godot_variant_as_vector2i(const godot_variant *p_self); godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self); +godot_rect2i GDAPI godot_variant_as_rect2i(const godot_variant *p_self); godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self); +godot_vector3i GDAPI godot_variant_as_vector3i(const godot_variant *p_self); godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self); godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self); godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self); @@ -221,12 +240,16 @@ godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self); godot_color GDAPI godot_variant_as_color(const godot_variant *p_self); godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self); godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self); +godot_callable GDAPI godot_variant_as_callable(const godot_variant *p_self); +godot_signal GDAPI godot_variant_as_signal(const godot_variant *p_self); godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self); godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self); godot_array GDAPI godot_variant_as_array(const godot_variant *p_self); godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_variant *p_self); -godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self); -godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self); +godot_packed_int32_array GDAPI godot_variant_as_packed_int32_array(const godot_variant *p_self); +godot_packed_int64_array GDAPI godot_variant_as_packed_int64_array(const godot_variant *p_self); +godot_packed_float32_array GDAPI godot_variant_as_packed_float32_array(const godot_variant *p_self); +godot_packed_float64_array GDAPI godot_variant_as_packed_float64_array(const godot_variant *p_self); godot_packed_string_array GDAPI godot_variant_as_packed_string_array(const godot_variant *p_self); godot_packed_vector2_array GDAPI godot_variant_as_packed_vector2_array(const godot_variant *p_self); godot_packed_vector3_array GDAPI godot_variant_as_packed_vector3_array(const godot_variant *p_self); @@ -239,6 +262,7 @@ godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const god godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other); godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other); +uint32_t GDAPI godot_variant_hash(const godot_variant *p_self); godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other); godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 15a1a6063b..35b02c5a75 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -46,6 +46,15 @@ typedef struct { } godot_vector2; #endif +#define GODOT_VECTOR2I_SIZE 8 + +#ifndef GODOT_CORE_API_GODOT_VECTOR2I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_VECTOR2I_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_VECTOR2I_SIZE]; +} godot_vector2i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -57,10 +66,14 @@ typedef struct { extern "C" { #endif +// Vector2 + void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y); godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self); +godot_vector2i GDAPI godot_vector2_as_vector2i(const godot_vector2 *p_self); + godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self); godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self); @@ -81,7 +94,7 @@ godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to); -godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); +godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); godot_vector2 GDAPI godot_vector2_cubic_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_vector2 *p_pre_a, const godot_vector2 *p_post_b, const godot_real p_t); @@ -93,6 +106,8 @@ godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self); godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self); +godot_vector2 GDAPI godot_vector2_sign(const godot_vector2 *p_self); + godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by); godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self); @@ -135,6 +150,46 @@ godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self); godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self); +// Vector2i + +void GDAPI godot_vector2i_new(godot_vector2i *r_dest, const godot_int p_x, const godot_int p_y); + +godot_string GDAPI godot_vector2i_as_string(const godot_vector2i *p_self); + +godot_vector2 GDAPI godot_vector2i_as_vector2(const godot_vector2i *p_self); + +godot_real GDAPI godot_vector2i_aspect(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_abs(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_sign(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_operator_add(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_subtract(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_multiply_vector(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_multiply_scalar(const godot_vector2i *p_self, const godot_int p_b); + +godot_vector2i GDAPI godot_vector2i_operator_divide_vector(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_divide_scalar(const godot_vector2i *p_self, const godot_int p_b); + +godot_bool GDAPI godot_vector2i_operator_equal(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_bool GDAPI godot_vector2i_operator_less(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_neg(const godot_vector2i *p_self); + +void GDAPI godot_vector2i_set_x(godot_vector2i *p_self, const godot_int p_x); + +void GDAPI godot_vector2i_set_y(godot_vector2i *p_self, const godot_int p_y); + +godot_int GDAPI godot_vector2i_get_x(const godot_vector2i *p_self); + +godot_int GDAPI godot_vector2i_get_y(const godot_vector2i *p_self); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/gdnative/vector3.h b/modules/gdnative/include/gdnative/vector3.h index 1b344590ea..5127b8789b 100644 --- a/modules/gdnative/include/gdnative/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -46,6 +46,15 @@ typedef struct { } godot_vector3; #endif +#define GODOT_VECTOR3I_SIZE 12 + +#ifndef GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_VECTOR3I_SIZE]; +} godot_vector3i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -64,10 +73,14 @@ typedef enum { GODOT_VECTOR3_AXIS_Z, } godot_vector3_axis; +// Vector3 + void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z); godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self); +godot_vector3i GDAPI godot_vector3_as_vector3i(const godot_vector3 *p_self); + godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self); godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self); @@ -86,7 +99,7 @@ godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const god godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi); -godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); +godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); godot_vector3 GDAPI godot_vector3_cubic_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_vector3 *p_pre_a, const godot_vector3 *p_post_b, const godot_real p_t); @@ -102,6 +115,8 @@ godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self); godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self); +godot_vector3 GDAPI godot_vector3_sign(const godot_vector3 *p_self); + godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self); godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self); @@ -142,6 +157,44 @@ void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axi godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis); +// Vector3i + +void GDAPI godot_vector3i_new(godot_vector3i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_z); + +godot_string GDAPI godot_vector3i_as_string(const godot_vector3i *p_self); + +godot_vector3 GDAPI godot_vector3i_as_vector3(const godot_vector3i *p_self); + +godot_int GDAPI godot_vector3i_min_axis(const godot_vector3i *p_self); + +godot_int GDAPI godot_vector3i_max_axis(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_abs(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_sign(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_operator_add(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_subtract(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_multiply_vector(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_multiply_scalar(const godot_vector3i *p_self, const godot_int p_b); + +godot_vector3i GDAPI godot_vector3i_operator_divide_vector(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_divide_scalar(const godot_vector3i *p_self, const godot_int p_b); + +godot_bool GDAPI godot_vector3i_operator_equal(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_bool GDAPI godot_vector3i_operator_less(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_neg(const godot_vector3i *p_self); + +void GDAPI godot_vector3i_set_axis(godot_vector3i *p_self, const godot_vector3_axis p_axis, const godot_int p_val); + +godot_int GDAPI godot_vector3i_get_axis(const godot_vector3i *p_self, const godot_vector3_axis p_axis); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index dcf2ddb9ca..825033c99c 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -45,7 +45,7 @@ typedef enum { GODOT_METHOD_RPC_MODE_REMOTESYNC, GODOT_METHOD_RPC_MODE_MASTERSYNC, GODOT_METHOD_RPC_MODE_PUPPETSYNC, -} godot_method_rpc_mode; +} godot_nativescript_method_rpc_mode; typedef enum { GODOT_PROPERTY_HINT_NONE, ///< no hint provided. @@ -82,7 +82,7 @@ typedef enum { GODOT_PROPERTY_HINT_PROPERTY_OF_INSTANCE, ///< a property of an instance GODOT_PROPERTY_HINT_PROPERTY_OF_SCRIPT, ///< a property of a script & base GODOT_PROPERTY_HINT_MAX, -} godot_property_hint; +} godot_nativescript_property_hint; typedef enum { @@ -95,6 +95,7 @@ typedef enum { GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor GODOT_PROPERTY_USAGE_CATEGORY = 256, + GODOT_PROPERTY_USAGE_SUBGROUP = 512, GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, @@ -105,106 +106,95 @@ typedef enum { GODOT_PROPERTY_USAGE_DEFAULT = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK, GODOT_PROPERTY_USAGE_DEFAULT_INTL = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK | GODOT_PROPERTY_USAGE_INTERNATIONALIZED, GODOT_PROPERTY_USAGE_NOEDITOR = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_NETWORK, -} godot_property_usage_flags; +} godot_nativescript_property_usage_flags; typedef struct { - godot_method_rpc_mode rset_type; + godot_nativescript_method_rpc_mode rset_type; godot_int type; - godot_property_hint hint; + godot_nativescript_property_hint hint; godot_string hint_string; - godot_property_usage_flags usage; + godot_nativescript_property_usage_flags usage; godot_variant default_value; -} godot_property_attributes; +} godot_nativescript_property_attributes; typedef struct { // instance pointer, method_data - return user data GDCALLINGCONV void *(*create_func)(godot_object *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_create_func; +} godot_nativescript_instance_create_func; typedef struct { // instance pointer, method data, user data GDCALLINGCONV void (*destroy_func)(godot_object *, void *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_destroy_func; +} godot_nativescript_instance_destroy_func; -void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func); +void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func); -void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func); +void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func); typedef struct { - godot_method_rpc_mode rpc_type; -} godot_method_attributes; + godot_nativescript_method_rpc_mode rpc_type; +} godot_nativescript_method_attributes; + +typedef struct { + godot_string name; + + godot_variant_type type; + godot_nativescript_property_hint hint; + godot_string hint_string; +} godot_nativescript_method_argument; typedef struct { // instance pointer, method data, user data, num args, args - return result as varaint GDCALLINGCONV godot_variant (*method)(godot_object *, void *, void *, int, godot_variant **); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_method; +} godot_nativescript_instance_method; -void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method); +void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_nativescript_method_attributes p_attr, godot_nativescript_instance_method p_method); +void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_nativescript_method_argument *p_args); typedef struct { // instance pointer, method data, user data, value GDCALLINGCONV void (*set_func)(godot_object *, void *, void *, godot_variant *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_property_set_func; +} godot_nativescript_property_set_func; typedef struct { // instance pointer, method data, user data, value GDCALLINGCONV godot_variant (*get_func)(godot_object *, void *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_property_get_func; +} godot_nativescript_property_get_func; -void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func); +void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_nativescript_property_attributes *p_attr, godot_nativescript_property_set_func p_set_func, godot_nativescript_property_get_func p_get_func); typedef struct { godot_string name; godot_int type; - godot_property_hint hint; + godot_nativescript_property_hint hint; godot_string hint_string; - godot_property_usage_flags usage; + godot_nativescript_property_usage_flags usage; godot_variant default_value; -} godot_signal_argument; +} godot_nativescript_signal_argument; typedef struct { godot_string name; int num_args; - godot_signal_argument *args; + godot_nativescript_signal_argument *args; int num_default_args; godot_variant *default_args; -} godot_signal; +} godot_nativescript_signal; -void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal); +void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_nativescript_signal *p_signal); void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance); -/* - * - * - * NativeScript 1.1 - * - * - */ - -// method registering with argument names - -typedef struct { - godot_string name; - - godot_variant_type type; - godot_property_hint hint; - godot_string hint_string; -} godot_method_arg; - -void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_method_arg *p_args); - // documentation void GDAPI godot_nativescript_set_class_documentation(void *p_gdnative_handle, const char *p_name, godot_string p_documentation); @@ -229,9 +219,9 @@ typedef struct { GDCALLINGCONV bool (*refcount_decremented_instance_binding)(void *, godot_object *); void *data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_binding_functions; +} godot_nativescript_instance_binding_functions; -int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_instance_binding_functions p_binding_functions); +int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_nativescript_instance_binding_functions p_binding_functions); void GDAPI godot_nativescript_unregister_instance_binding_data_functions(int p_idx); void GDAPI *godot_nativescript_get_instance_binding_data(int p_idx, godot_object *p_object); diff --git a/modules/gdnative/include/net/godot_net.h b/modules/gdnative/include/net/godot_net.h index d245f3b965..42804112f2 100644 --- a/modules/gdnative/include/net/godot_net.h +++ b/modules/gdnative/include/net/godot_net.h @@ -45,7 +45,6 @@ extern "C" { #define GODOT_NET_API_MINOR 1 typedef struct { - godot_gdnative_api_version version; /* version of our API */ godot_object *data; /* User reference */ diff --git a/modules/gdnative/include/videodecoder/godot_videodecoder.h b/modules/gdnative/include/videodecoder/godot_videodecoder.h index 3e91a2e9ac..16c92abd22 100644 --- a/modules/gdnative/include/videodecoder/godot_videodecoder.h +++ b/modules/gdnative/include/videodecoder/godot_videodecoder.h @@ -46,7 +46,7 @@ typedef struct void *next; void *(*constructor)(godot_object *); void (*destructor)(void *); - const char *(*get_plugin_name)(void); + const char *(*get_plugin_name)(); const char **(*get_supported_extensions)(int *count); godot_bool (*open_file)(void *, void *); // data struct, and a FileAccess pointer godot_real (*get_length)(const void *); |