summaryrefslogtreecommitdiff
path: root/modules/gdnative/godot
diff options
context:
space:
mode:
authorThomas Herzog <thomas.herzog@mail.com>2017-07-24 04:51:34 +0200
committerGitHub <noreply@github.com>2017-07-24 04:51:34 +0200
commitb31973b64de038a1d2dfaa1fcea0c72ee5ce012b (patch)
tree0d299c22cbffc2a353c126372a44f067914b71d0 /modules/gdnative/godot
parent85aa0adeef6ab89e98105fdaa49f441e5763d970 (diff)
parent534d62d2f4ea1ff4be11b50bc79684b5780e4615 (diff)
Merge pull request #9804 from karroffel/gdnative-rewrite
[GDNative] new GDNative API
Diffstat (limited to 'modules/gdnative/godot')
-rw-r--r--modules/gdnative/godot/array.cpp (renamed from modules/gdnative/godot/godot_array.cpp)4
-rw-r--r--modules/gdnative/godot/array.h (renamed from modules/gdnative/godot/godot_array.h)15
-rw-r--r--modules/gdnative/godot/basis.cpp (renamed from modules/gdnative/godot/godot_basis.cpp)4
-rw-r--r--modules/gdnative/godot/basis.h (renamed from modules/gdnative/godot/godot_basis.h)13
-rw-r--r--modules/gdnative/godot/color.cpp (renamed from modules/gdnative/godot/godot_color.cpp)4
-rw-r--r--modules/gdnative/godot/color.h (renamed from modules/gdnative/godot/godot_color.h)12
-rw-r--r--modules/gdnative/godot/dictionary.cpp (renamed from modules/gdnative/godot/godot_dictionary.cpp)4
-rw-r--r--modules/gdnative/godot/dictionary.h (renamed from modules/gdnative/godot/godot_dictionary.h)14
-rw-r--r--modules/gdnative/godot/gdnative.cpp185
-rw-r--r--modules/gdnative/godot/gdnative.h298
-rw-r--r--modules/gdnative/godot/icon.png.import23
-rw-r--r--modules/gdnative/godot/node_path.cpp (renamed from modules/gdnative/godot/godot_node_path.cpp)4
-rw-r--r--modules/gdnative/godot/node_path.h (renamed from modules/gdnative/godot/godot_node_path.h)12
-rw-r--r--modules/gdnative/godot/plane.cpp (renamed from modules/gdnative/godot/godot_plane.cpp)4
-rw-r--r--modules/gdnative/godot/plane.h (renamed from modules/gdnative/godot/godot_plane.h)12
-rw-r--r--modules/gdnative/godot/pool_arrays.cpp (renamed from modules/gdnative/godot/godot_pool_arrays.cpp)10
-rw-r--r--modules/gdnative/godot/pool_arrays.h (renamed from modules/gdnative/godot/godot_pool_arrays.h)61
-rw-r--r--modules/gdnative/godot/quat.cpp (renamed from modules/gdnative/godot/godot_quat.cpp)4
-rw-r--r--modules/gdnative/godot/quat.h (renamed from modules/gdnative/godot/godot_quat.h)12
-rw-r--r--modules/gdnative/godot/rect2.cpp (renamed from modules/gdnative/godot/godot_rect2.cpp)4
-rw-r--r--modules/gdnative/godot/rect2.h (renamed from modules/gdnative/godot/godot_rect2.h)6
-rw-r--r--modules/gdnative/godot/rect3.cpp (renamed from modules/gdnative/godot/godot_rect3.cpp)4
-rw-r--r--modules/gdnative/godot/rect3.h (renamed from modules/gdnative/godot/godot_rect3.h)14
-rw-r--r--modules/gdnative/godot/rid.cpp (renamed from modules/gdnative/godot/godot_rid.cpp)4
-rw-r--r--modules/gdnative/godot/rid.h (renamed from modules/gdnative/godot/godot_rid.h)10
-rw-r--r--modules/gdnative/godot/string.cpp (renamed from modules/gdnative/godot/godot_string.cpp)4
-rw-r--r--modules/gdnative/godot/string.h (renamed from modules/gdnative/godot/godot_string.h)11
-rw-r--r--modules/gdnative/godot/transform.cpp (renamed from modules/gdnative/godot/godot_transform.cpp)4
-rw-r--r--modules/gdnative/godot/transform.h (renamed from modules/gdnative/godot/godot_transform.h)16
-rw-r--r--modules/gdnative/godot/transform2d.cpp (renamed from modules/gdnative/godot/godot_transform2d.cpp)4
-rw-r--r--modules/gdnative/godot/transform2d.h (renamed from modules/gdnative/godot/godot_transform2d.h)14
-rw-r--r--modules/gdnative/godot/variant.cpp (renamed from modules/gdnative/godot/godot_variant.cpp)4
-rw-r--r--modules/gdnative/godot/variant.h (renamed from modules/gdnative/godot/godot_variant.h)47
-rw-r--r--modules/gdnative/godot/vector2.cpp (renamed from modules/gdnative/godot/godot_vector2.cpp)4
-rw-r--r--modules/gdnative/godot/vector2.h (renamed from modules/gdnative/godot/godot_vector2.h)10
-rw-r--r--modules/gdnative/godot/vector3.cpp (renamed from modules/gdnative/godot/godot_vector3.cpp)4
-rw-r--r--modules/gdnative/godot/vector3.h (renamed from modules/gdnative/godot/godot_vector3.h)12
37 files changed, 718 insertions, 153 deletions
diff --git a/modules/gdnative/godot/godot_array.cpp b/modules/gdnative/godot/array.cpp
index 5497dde520..c068eecf8f 100644
--- a/modules/gdnative/godot/godot_array.cpp
+++ b/modules/gdnative/godot/array.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_array.cpp */
+/* array.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_array.h"
+#include "array.h"
#include "core/array.h"
#include "core/os/memory.h"
diff --git a/modules/gdnative/godot/godot_array.h b/modules/gdnative/godot/array.h
index bf8bc61977..cbdbfbdde3 100644
--- a/modules/gdnative/godot/godot_array.h
+++ b/modules/gdnative/godot/array.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_array.h */
+/* array.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -37,16 +37,19 @@ extern "C" {
#include <stdint.h>
+#define GODOT_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
-typedef struct godot_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_ARRAY_SIZE];
} godot_array;
#endif
-#include "godot_pool_arrays.h"
-#include "godot_variant.h"
+#include "pool_arrays.h"
+#include "variant.h"
-#include "../godot.h"
+#include "gdnative.h"
void GDAPI godot_array_new(godot_array *r_dest);
void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src);
diff --git a/modules/gdnative/godot/godot_basis.cpp b/modules/gdnative/godot/basis.cpp
index 46464932c5..7188215d04 100644
--- a/modules/gdnative/godot/godot_basis.cpp
+++ b/modules/gdnative/godot/basis.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_basis.cpp */
+/* basis.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_basis.h"
+#include "basis.h"
#include "core/variant.h"
#include "core/math/matrix3.h"
diff --git a/modules/gdnative/godot/godot_basis.h b/modules/gdnative/godot/basis.h
index a096a8cc08..79b2b45fdd 100644
--- a/modules/gdnative/godot/godot_basis.h
+++ b/modules/gdnative/godot/basis.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_basis.h */
+/* basis.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,18 @@ extern "C" {
#include <stdint.h>
+#define GODOT_BASIS_SIZE 36
+
#ifndef GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_BASIS_TYPE_DEFINED
-typedef struct godot_basis {
- uint8_t _dont_touch_that[36];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_BASIS_SIZE];
} godot_basis;
#endif
-#include "../godot.h"
-#include "godot_vector3.h"
+#include "gdnative.h"
+#include "quat.h"
+#include "vector3.h"
void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis);
void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi);
diff --git a/modules/gdnative/godot/godot_color.cpp b/modules/gdnative/godot/color.cpp
index 6dedf2ab10..eac966ca1f 100644
--- a/modules/gdnative/godot/godot_color.cpp
+++ b/modules/gdnative/godot/color.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_color.cpp */
+/* color.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_color.h"
+#include "color.h"
#include "core/variant.h"
#include "core/color.h"
diff --git a/modules/gdnative/godot/godot_color.h b/modules/gdnative/godot/color.h
index 10dc228b1c..77e709fbe3 100644
--- a/modules/gdnative/godot/godot_color.h
+++ b/modules/gdnative/godot/color.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_color.h */
+/* color.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,17 @@ extern "C" {
#include <stdint.h>
+#define GODOT_COLOR_SIZE 16
+
#ifndef GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_COLOR_TYPE_DEFINED
-typedef struct godot_color {
- uint8_t _dont_touch_that[16];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_COLOR_SIZE];
} godot_color;
#endif
-#include "../godot.h"
-#include "godot_string.h"
+#include "gdnative.h"
+#include "string.h"
void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a);
void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b);
diff --git a/modules/gdnative/godot/godot_dictionary.cpp b/modules/gdnative/godot/dictionary.cpp
index a14a86248b..1c0761edfd 100644
--- a/modules/gdnative/godot/godot_dictionary.cpp
+++ b/modules/gdnative/godot/dictionary.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_dictionary.cpp */
+/* dictionary.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_dictionary.h"
+#include "dictionary.h"
#include "core/variant.h"
#include "core/dictionary.h"
diff --git a/modules/gdnative/godot/godot_dictionary.h b/modules/gdnative/godot/dictionary.h
index 4ded0d38da..a08deb27df 100644
--- a/modules/gdnative/godot/godot_dictionary.h
+++ b/modules/gdnative/godot/dictionary.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_dictionary.h */
+/* dictionary.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,16 +36,18 @@ extern "C" {
#include <stdint.h>
+#define GODOT_DICTIONARY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_DICTIONARY_TYPE_DEFINED
-typedef struct godot_dictionary {
- uint8_t _dont_touch_that[8];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_DICTIONARY_SIZE];
} godot_dictionary;
#endif
-#include "../godot.h"
-#include "godot_array.h"
-#include "godot_variant.h"
+#include "array.h"
+#include "gdnative.h"
+#include "variant.h"
void GDAPI godot_dictionary_new(godot_dictionary *r_dest);
void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src);
diff --git a/modules/gdnative/godot/gdnative.cpp b/modules/gdnative/godot/gdnative.cpp
new file mode 100644
index 0000000000..7b94b75a52
--- /dev/null
+++ b/modules/gdnative/godot/gdnative.cpp
@@ -0,0 +1,185 @@
+/*************************************************************************/
+/* gdnative.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 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. */
+/*************************************************************************/
+#include "gdnative.h"
+
+#include "class_db.h"
+#include "error_macros.h"
+#include "gdnative.h"
+#include "global_constants.h"
+#include "project_settings.h"
+#include "variant.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern "C" void _string_api_anchor();
+extern "C" void _vector2_api_anchor();
+extern "C" void _rect2_api_anchor();
+extern "C" void _vector3_api_anchor();
+extern "C" void _transform2d_api_anchor();
+extern "C" void _plane_api_anchor();
+extern "C" void _quat_api_anchor();
+extern "C" void _basis_api_anchor();
+extern "C" void _rect3_api_anchor();
+extern "C" void _transform_api_anchor();
+extern "C" void _color_api_anchor();
+extern "C" void _node_path_api_anchor();
+extern "C" void _rid_api_anchor();
+extern "C" void _dictionary_api_anchor();
+extern "C" void _array_api_anchor();
+extern "C" void _pool_arrays_api_anchor();
+extern "C" void _variant_api_anchor();
+
+void _api_anchor() {
+
+ _string_api_anchor();
+ _vector2_api_anchor();
+ _rect2_api_anchor();
+ _vector3_api_anchor();
+ _transform2d_api_anchor();
+ _plane_api_anchor();
+ _quat_api_anchor();
+ _rect3_api_anchor();
+ _basis_api_anchor();
+ _transform_api_anchor();
+ _color_api_anchor();
+ _node_path_api_anchor();
+ _rid_api_anchor();
+ _dictionary_api_anchor();
+ _array_api_anchor();
+ _pool_arrays_api_anchor();
+ _variant_api_anchor();
+}
+
+void GDAPI godot_object_destroy(godot_object *p_o) {
+ memdelete((Object *)p_o);
+}
+
+// Singleton API
+
+godot_object GDAPI *godot_global_get_singleton(char *p_name) {
+ return (godot_object *)ProjectSettings::get_singleton()->get_singleton_object(String(p_name));
+} // result shouldn't be freed
+
+// MethodBind API
+
+godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname) {
+
+ MethodBind *mb = ClassDB::get_method(StringName(p_classname), StringName(p_methodname));
+ // MethodBind *mb = ClassDB::get_method("Node", "get_name");
+ return (godot_method_bind *)mb;
+}
+
+void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret) {
+
+ MethodBind *mb = (MethodBind *)p_method_bind;
+ Object *o = (Object *)p_instance;
+ mb->ptrcall(o, p_args, p_ret);
+}
+
+godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error) {
+ MethodBind *mb = (MethodBind *)p_method_bind;
+ Object *o = (Object *)p_instance;
+ const Variant **args = (const Variant **)p_args;
+
+ godot_variant ret;
+ godot_variant_new_nil(&ret);
+
+ Variant *ret_val = (Variant *)&ret;
+
+ Variant::CallError r_error;
+ *ret_val = mb->call(o, args, p_arg_count, r_error);
+
+ if (p_call_error) {
+ p_call_error->error = (godot_variant_call_error_error)r_error.error;
+ p_call_error->argument = r_error.argument;
+ p_call_error->expected = (godot_variant_type)r_error.expected;
+ }
+
+ return ret;
+}
+
+// @Todo
+/*
+void GDAPI godot_method_bind_varcall(godot_method_bind *p_method_bind)
+{
+
+}
+*/
+
+godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) {
+ ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname));
+ if (class_info)
+ return (godot_class_constructor)class_info->creation_func;
+ return NULL;
+}
+
+godot_dictionary GDAPI godot_get_global_constants() {
+ godot_dictionary constants;
+ godot_dictionary_new(&constants);
+ Dictionary *p_constants = (Dictionary *)&constants;
+ const int constants_count = GlobalConstants::get_global_constant_count();
+ for (int i = 0; i < constants_count; ++i) {
+ const char *name = GlobalConstants::get_global_constant_name(i);
+ int value = GlobalConstants::get_global_constant_value(i);
+ (*p_constants)[name] = value;
+ }
+ return constants;
+}
+
+// System functions
+void GDAPI *godot_alloc(int p_bytes) {
+ return memalloc(p_bytes);
+}
+
+void GDAPI *godot_realloc(void *p_ptr, int p_bytes) {
+ return memrealloc(p_ptr, p_bytes);
+}
+
+void GDAPI godot_free(void *p_ptr) {
+ memfree(p_ptr);
+}
+
+void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line) {
+ _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_ERROR);
+}
+
+void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line) {
+ _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_WARNING);
+}
+
+void GDAPI godot_print(const godot_string *p_message) {
+ print_line(*(String *)p_message);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/modules/gdnative/godot/gdnative.h b/modules/gdnative/godot/gdnative.h
new file mode 100644
index 0000000000..4b79706b52
--- /dev/null
+++ b/modules/gdnative/godot/gdnative.h
@@ -0,0 +1,298 @@
+/*************************************************************************/
+/* gdnative.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 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_GDNATIVE_H
+#define GODOT_GDNATIVE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef GDAPI_BUILT_IN
+#define GDAPI_EXPORT
+#endif
+
+#ifdef _WIN32
+#if defined(GDAPI_EXPORT)
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllexport) GDCALLINGCONV
+#else
+#define GDCALLINGCONV
+#define GDAPI __declspec(dllimport) GDCALLINGCONV
+#endif
+#elif defined(__APPLE__)
+#include "TargetConditionals.h"
+#if TARGET_OS_IPHONE
+#define GDCALLINGCONV
+#define GDAPI
+#elif TARGET_OS_MAC
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+#else
+#define GDCALLINGCONV __attribute__((sysv_abi))
+#define GDAPI GDCALLINGCONV
+#endif
+
+// This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!!
+#ifdef _WIN32
+#define GDN_EXPORT __declspec(dllexport)
+#else
+#define GDN_EXPORT
+#endif
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#define GODOT_API_VERSION 1
+
+////// Error
+
+typedef enum {
+ GODOT_OK,
+ GODOT_FAILED, ///< Generic fail error
+ GODOT_ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable
+ GODOT_ERR_UNCONFIGURED, ///< The object being used hasnt been properly set up yet
+ GODOT_ERR_UNAUTHORIZED, ///< Missing credentials for requested resource
+ GODOT_ERR_PARAMETER_RANGE_ERROR, ///< Parameter given out of range (5)
+ GODOT_ERR_OUT_OF_MEMORY, ///< Out of memory
+ GODOT_ERR_FILE_NOT_FOUND,
+ GODOT_ERR_FILE_BAD_DRIVE,
+ GODOT_ERR_FILE_BAD_PATH,
+ GODOT_ERR_FILE_NO_PERMISSION, // (10)
+ GODOT_ERR_FILE_ALREADY_IN_USE,
+ GODOT_ERR_FILE_CANT_OPEN,
+ GODOT_ERR_FILE_CANT_WRITE,
+ GODOT_ERR_FILE_CANT_READ,
+ GODOT_ERR_FILE_UNRECOGNIZED, // (15)
+ GODOT_ERR_FILE_CORRUPT,
+ GODOT_ERR_FILE_MISSING_DEPENDENCIES,
+ GODOT_ERR_FILE_EOF,
+ GODOT_ERR_CANT_OPEN, ///< Can't open a resource/socket/file
+ GODOT_ERR_CANT_CREATE, // (20)
+ GODOT_ERR_QUERY_FAILED,
+ GODOT_ERR_ALREADY_IN_USE,
+ GODOT_ERR_LOCKED, ///< resource is locked
+ GODOT_ERR_TIMEOUT,
+ GODOT_ERR_CANT_CONNECT, // (25)
+ GODOT_ERR_CANT_RESOLVE,
+ GODOT_ERR_CONNECTION_ERROR,
+ GODOT_ERR_CANT_AQUIRE_RESOURCE,
+ GODOT_ERR_CANT_FORK,
+ GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30)
+ GODOT_ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
+ GODOT_ERR_ALREADY_EXISTS, ///< When adding, item already exists
+ GODOT_ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
+ GODOT_ERR_DATABASE_CANT_READ, ///< database is full
+ GODOT_ERR_DATABASE_CANT_WRITE, ///< database is full (35)
+ GODOT_ERR_COMPILATION_FAILED,
+ GODOT_ERR_METHOD_NOT_FOUND,
+ GODOT_ERR_LINK_FAILED,
+ GODOT_ERR_SCRIPT_FAILED,
+ GODOT_ERR_CYCLIC_LINK, // (40)
+ GODOT_ERR_INVALID_DECLARATION,
+ GODOT_ERR_DUPLICATE_SYMBOL,
+ GODOT_ERR_PARSE_ERROR,
+ GODOT_ERR_BUSY,
+ GODOT_ERR_SKIP, // (45)
+ GODOT_ERR_HELP, ///< user requested help!!
+ GODOT_ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
+ GODOT_ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
+ GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though
+ GODOT_ERR_WTF = GODOT_ERR_OMFG_THIS_IS_VERY_VERY_BAD ///< short version of the above
+} godot_error;
+
+////// bool
+
+typedef bool godot_bool;
+
+#define GODOT_TRUE 1
+#define GODOT_FALSE 0
+
+/////// int
+
+typedef int godot_int;
+
+/////// real
+
+typedef float godot_real;
+
+/////// Object (forward declared)
+typedef void godot_object;
+
+/////// Brute force forward declarations for the rest
+/*
+typedef struct godot_variant godot_variant;
+typedef struct godot_string godot_string;
+typedef struct godot_vector2 godot_vector2;
+typedef struct godot_rect2 godot_rect2;
+typedef struct godot_vector3 godot_vector3;
+typedef struct godot_transform2d godot_transform2d;
+typedef struct godot_plane godot_plane;
+typedef struct godot_quat godot_quat;
+typedef struct godot_rect3 godot_rect3;
+typedef struct godot_basis godot_basis;
+typedef struct godot_transform godot_transform;
+typedef struct godot_color godot_color;
+typedef struct godot_node_path godot_node_path;
+typedef struct godot_rid godot_rid;
+typedef struct godot_dictionary godot_dictionary;
+typedef struct godot_array godot_array;
+typedef struct godot_pool_byte_array godot_pool_byte_array;
+typedef struct godot_pool_int_array godot_pool_int_array;
+typedef struct godot_pool_real_array godot_pool_real_array;
+typedef struct godot_pool_string_array godot_pool_string_array;
+typedef struct godot_pool_vector2_array godot_pool_vector2_array;
+typedef struct godot_pool_vector3_array godot_pool_vector3_array;
+typedef struct godot_pool_color_array godot_pool_color_array;
+*/
+/////// String
+
+#include "string.h"
+
+////// Vector2
+
+#include "vector2.h"
+
+////// Rect2
+
+#include "rect2.h"
+
+////// Vector3
+
+#include "vector3.h"
+
+////// Transform2D
+
+#include "transform2d.h"
+
+/////// Plane
+
+#include "plane.h"
+
+/////// Quat
+
+#include "quat.h"
+
+/////// Rect3
+
+#include "rect3.h"
+
+/////// Basis
+
+#include "basis.h"
+
+/////// Transform
+
+#include "transform.h"
+
+/////// Color
+
+#include "color.h"
+
+/////// NodePath
+
+#include "node_path.h"
+
+/////// RID
+
+#include "rid.h"
+
+/////// Dictionary
+
+#include "dictionary.h"
+
+/////// Array
+
+#include "array.h"
+
+// single API file for Pool*Array
+#include "pool_arrays.h"
+
+void GDAPI godot_object_destroy(godot_object *p_o);
+
+////// Variant
+
+#include "variant.h"
+
+////// Singleton API
+
+godot_object GDAPI *godot_global_get_singleton(char *p_name); // result shouldn't be freed
+
+////// MethodBind API
+
+typedef struct {
+ uint8_t _dont_touch_that[1]; // TODO
+} godot_method_bind;
+
+godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname);
+void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret);
+godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, godot_object *p_instance, const godot_variant **p_args, const int p_arg_count, godot_variant_call_error *p_call_error);
+////// Script API
+
+typedef struct {
+ godot_bool in_editor;
+ uint64_t core_api_hash;
+ uint64_t editor_api_hash;
+ uint64_t no_api_hash;
+} godot_gdnative_init_options;
+
+typedef struct {
+ godot_bool in_editor;
+} godot_gdnative_terminate_options;
+
+// Calling convention?
+typedef godot_object *(*godot_class_constructor)();
+
+godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname);
+
+godot_dictionary GDAPI godot_get_global_constants();
+
+////// GDNative procedure types
+typedef void (*godot_gdnative_init_fn)(godot_gdnative_init_options *);
+typedef void (*godot_gdnative_terminate_fn)(godot_gdnative_terminate_options *);
+typedef godot_variant (*godot_gdnative_procedure_fn)(void *, godot_array *);
+
+////// System Functions
+
+//using these will help Godot track how much memory is in use in debug mode
+void GDAPI *godot_alloc(int p_bytes);
+void GDAPI *godot_realloc(void *p_ptr, int p_bytes);
+void GDAPI godot_free(void *p_ptr);
+
+//print using Godot's error handler list
+void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line);
+void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line);
+void GDAPI godot_print(const godot_string *p_message);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // GODOT_C_H
diff --git a/modules/gdnative/godot/icon.png.import b/modules/gdnative/godot/icon.png.import
new file mode 100644
index 0000000000..27920124f9
--- /dev/null
+++ b/modules/gdnative/godot/icon.png.import
@@ -0,0 +1,23 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/icon.png-aa47d037a37fb38b3b7e7828e4eec407.stex"
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+stream=false
+size_limit=0
+detect_3d=true
diff --git a/modules/gdnative/godot/godot_node_path.cpp b/modules/gdnative/godot/node_path.cpp
index c8eacd05af..a9edbc8352 100644
--- a/modules/gdnative/godot/godot_node_path.cpp
+++ b/modules/gdnative/godot/node_path.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_node_path.cpp */
+/* node_path.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_node_path.h"
+#include "node_path.h"
#include "core/variant.h"
#include "core/path_db.h"
diff --git a/modules/gdnative/godot/godot_node_path.h b/modules/gdnative/godot/node_path.h
index b0c9d44859..06955a052e 100644
--- a/modules/gdnative/godot/godot_node_path.h
+++ b/modules/gdnative/godot/node_path.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_node_path.h */
+/* node_path.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,17 @@ extern "C" {
#include <stdint.h>
+#define GODOT_NODE_PATH_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_NODE_PATH_TYPE_DEFINED
-typedef struct godot_node_path {
- uint8_t _dont_touch_that[8];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_NODE_PATH_SIZE];
} godot_node_path;
#endif
-#include "../godot.h"
-#include "godot_string.h"
+#include "gdnative.h"
+#include "string.h"
void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from);
void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src);
diff --git a/modules/gdnative/godot/godot_plane.cpp b/modules/gdnative/godot/plane.cpp
index 68adbd4a98..e9e659e5da 100644
--- a/modules/gdnative/godot/godot_plane.cpp
+++ b/modules/gdnative/godot/plane.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_plane.cpp */
+/* plane.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_plane.h"
+#include "plane.h"
#include "core/variant.h"
#include "core/math/plane.h"
diff --git a/modules/gdnative/godot/godot_plane.h b/modules/gdnative/godot/plane.h
index cfc955f277..e9e3b71e03 100644
--- a/modules/gdnative/godot/godot_plane.h
+++ b/modules/gdnative/godot/plane.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_plane.h */
+/* plane.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,17 @@ extern "C" {
#include <stdint.h>
+#define GODOT_PLANE_SIZE 16
+
#ifndef GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_PLANE_TYPE_DEFINED
-typedef struct godot_plane {
- uint8_t _dont_touch_that[16];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_PLANE_SIZE];
} godot_plane;
#endif
-#include "../godot.h"
-#include "godot_vector3.h"
+#include "gdnative.h"
+#include "vector3.h"
void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d);
void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3);
diff --git a/modules/gdnative/godot/godot_pool_arrays.cpp b/modules/gdnative/godot/pool_arrays.cpp
index ea9aceea81..6a6ee0f126 100644
--- a/modules/gdnative/godot/godot_pool_arrays.cpp
+++ b/modules/gdnative/godot/pool_arrays.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_pool_arrays.cpp */
+/* pool_arrays.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,11 +27,15 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_pool_arrays.h"
+#include "pool_arrays.h"
#include "array.h"
+#include "core/variant.h"
#include "dvector.h"
-#include "variant.h"
+
+#include "core/color.h"
+#include "core/math/math_2d.h"
+#include "core/math/vector3.h"
#ifdef __cplusplus
extern "C" {
diff --git a/modules/gdnative/godot/godot_pool_arrays.h b/modules/gdnative/godot/pool_arrays.h
index a794d03f01..1e2916cea9 100644
--- a/modules/gdnative/godot/godot_pool_arrays.h
+++ b/modules/gdnative/godot/pool_arrays.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_pool_arrays.h */
+/* pool_arrays.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -38,66 +38,87 @@ extern "C" {
/////// PoolByteArray
+#define GODOT_POOL_BYTE_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_byte_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_BYTE_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_BYTE_ARRAY_SIZE];
} godot_pool_byte_array;
#endif
/////// PoolIntArray
+#define GODOT_POOL_INT_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_int_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_INT_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_INT_ARRAY_SIZE];
} godot_pool_int_array;
#endif
/////// PoolRealArray
+#define GODOT_POOL_REAL_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_real_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_REAL_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_REAL_ARRAY_SIZE];
} godot_pool_real_array;
#endif
/////// PoolStringArray
+#define GODOT_POOL_STRING_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_string_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_STRING_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_STRING_ARRAY_SIZE];
} godot_pool_string_array;
#endif
/////// PoolVector2Array
+#define GODOT_POOL_VECTOR2_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_vector2_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_VECTOR2_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_VECTOR2_ARRAY_SIZE];
} godot_pool_vector2_array;
#endif
/////// PoolVector3Array
+#define GODOT_POOL_VECTOR3_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_vector3_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_VECTOR3_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_VECTOR3_ARRAY_SIZE];
} godot_pool_vector3_array;
#endif
/////// PoolColorArray
+#define GODOT_POOL_COLOR_ARRAY_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
-typedef struct godot_pool_color_array {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_POOL_COLOR_ARRAY_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_POOL_COLOR_ARRAY_SIZE];
} godot_pool_color_array;
#endif
-#include "godot_array.h"
-#include "godot_color.h"
-#include "godot_vector2.h"
-#include "godot_vector3.h"
+#include "array.h"
+#include "color.h"
+#include "vector2.h"
+#include "vector3.h"
-#include "../godot.h"
+#include "gdnative.h"
// byte
diff --git a/modules/gdnative/godot/godot_quat.cpp b/modules/gdnative/godot/quat.cpp
index 7235e4fcec..6800f7fc7e 100644
--- a/modules/gdnative/godot/godot_quat.cpp
+++ b/modules/gdnative/godot/quat.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_quat.cpp */
+/* quat.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_quat.h"
+#include "quat.h"
#include "core/variant.h"
#include "core/math/quat.h"
diff --git a/modules/gdnative/godot/godot_quat.h b/modules/gdnative/godot/quat.h
index 2289b6cbab..b86cbacc62 100644
--- a/modules/gdnative/godot/godot_quat.h
+++ b/modules/gdnative/godot/quat.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_quat.h */
+/* quat.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,17 @@ extern "C" {
#include <stdint.h>
+#define GODOT_QUAT_SIZE 16
+
#ifndef GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_QUAT_TYPE_DEFINED
-typedef struct godot_quat {
- uint8_t _dont_touch_that[16];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_QUAT_SIZE];
} godot_quat;
#endif
-#include "../godot.h"
-#include "godot_vector3.h"
+#include "gdnative.h"
+#include "vector3.h"
void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w);
void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle);
diff --git a/modules/gdnative/godot/godot_rect2.cpp b/modules/gdnative/godot/rect2.cpp
index 0e456ea3ba..830d7bb496 100644
--- a/modules/gdnative/godot/godot_rect2.cpp
+++ b/modules/gdnative/godot/rect2.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rect2.cpp */
+/* rect2.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_rect2.h"
+#include "rect2.h"
#include "core/variant.h"
#include "core/math/math_2d.h"
diff --git a/modules/gdnative/godot/godot_rect2.h b/modules/gdnative/godot/rect2.h
index 488a1204f7..7b6613d9dd 100644
--- a/modules/gdnative/godot/godot_rect2.h
+++ b/modules/gdnative/godot/rect2.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rect2.h */
+/* rect2.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -43,8 +43,8 @@ typedef struct godot_rect2 {
} godot_rect2;
#endif
-#include "../godot.h"
-#include "godot_vector2.h"
+#include "gdnative.h"
+#include "vector2.h"
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);
diff --git a/modules/gdnative/godot/godot_rect3.cpp b/modules/gdnative/godot/rect3.cpp
index e524fa8463..0fabba5b7b 100644
--- a/modules/gdnative/godot/godot_rect3.cpp
+++ b/modules/gdnative/godot/rect3.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rect3.cpp */
+/* rect3.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_rect3.h"
+#include "rect3.h"
#include "core/variant.h"
#include "core/math/rect3.h"
diff --git a/modules/gdnative/godot/godot_rect3.h b/modules/gdnative/godot/rect3.h
index 9e9a49ac27..638d89f76f 100644
--- a/modules/gdnative/godot/godot_rect3.h
+++ b/modules/gdnative/godot/rect3.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rect3.h */
+/* rect3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,16 +36,18 @@ extern "C" {
#include <stdint.h>
+#define GODOT_RECT3_SIZE 24
+
#ifndef GODOT_CORE_API_GODOT_RECT3_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_RECT3_TYPE_DEFINED
-typedef struct godot_rect3 {
- uint8_t _dont_touch_that[24];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_RECT3_SIZE];
} godot_rect3;
#endif
-#include "../godot.h"
-#include "godot_plane.h"
-#include "godot_vector3.h"
+#include "gdnative.h"
+#include "plane.h"
+#include "vector3.h"
void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size);
diff --git a/modules/gdnative/godot/godot_rid.cpp b/modules/gdnative/godot/rid.cpp
index 343c004bff..2b724e554d 100644
--- a/modules/gdnative/godot/godot_rid.cpp
+++ b/modules/gdnative/godot/rid.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rid.cpp */
+/* rid.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_rid.h"
+#include "rid.h"
#include "core/variant.h"
#include "core/resource.h"
diff --git a/modules/gdnative/godot/godot_rid.h b/modules/gdnative/godot/rid.h
index 25dc8d965e..92e101fd2e 100644
--- a/modules/gdnative/godot/godot_rid.h
+++ b/modules/gdnative/godot/rid.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_rid.h */
+/* rid.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,14 +36,16 @@ extern "C" {
#include <stdint.h>
+#define GODOT_RID_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_RID_TYPE_DEFINED
-typedef struct godot_rid {
- uint8_t _dont_touch_that[8];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_RID_SIZE];
} godot_rid;
#endif
-#include "../godot.h"
+#include "gdnative.h"
void GDAPI godot_rid_new(godot_rid *r_dest);
diff --git a/modules/gdnative/godot/godot_string.cpp b/modules/gdnative/godot/string.cpp
index 679011e715..e54ef3655f 100644
--- a/modules/gdnative/godot/godot_string.cpp
+++ b/modules/gdnative/godot/string.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_string.cpp */
+/* string.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_string.h"
+#include "string.h"
#include "string_db.h"
#include "ustring.h"
diff --git a/modules/gdnative/godot/godot_string.h b/modules/gdnative/godot/string.h
index df848abb76..d4d6d6c1d0 100644
--- a/modules/gdnative/godot/godot_string.h
+++ b/modules/gdnative/godot/string.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_string.h */
+/* string.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -37,13 +37,16 @@ extern "C" {
#include <stdint.h>
#include <wchar.h>
+#define GODOT_STRING_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
-typedef struct godot_string {
- uint8_t _dont_touch_that[8];
+#define GODOT_CORE_API_GODOT_STRING_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_STRING_SIZE];
} godot_string;
#endif
-#include "../godot.h"
+#include "gdnative.h"
void GDAPI godot_string_new(godot_string *r_dest);
void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src);
diff --git a/modules/gdnative/godot/godot_transform.cpp b/modules/gdnative/godot/transform.cpp
index eb9e1e207b..e566ed0b6e 100644
--- a/modules/gdnative/godot/godot_transform.cpp
+++ b/modules/gdnative/godot/transform.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_transform.cpp */
+/* transform.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_transform.h"
+#include "transform.h"
#include "core/variant.h"
#include "core/math/transform.h"
diff --git a/modules/gdnative/godot/godot_transform.h b/modules/gdnative/godot/transform.h
index ee87e1d33f..d14190ec49 100644
--- a/modules/gdnative/godot/godot_transform.h
+++ b/modules/gdnative/godot/transform.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_transform.h */
+/* transform.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,17 +36,19 @@ extern "C" {
#include <stdint.h>
+#define GODOT_TRANSFORM_SIZE 48
+
#ifndef GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_TRANSFORM_TYPE_DEFINED
-typedef struct godot_transform {
- uint8_t _dont_touch_that[48];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_TRANSFORM_SIZE];
} godot_transform;
#endif
-#include "../godot.h"
-#include "godot_basis.h"
-#include "godot_variant.h"
-#include "godot_vector3.h"
+#include "basis.h"
+#include "gdnative.h"
+#include "variant.h"
+#include "vector3.h"
void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin);
void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin);
diff --git a/modules/gdnative/godot/godot_transform2d.cpp b/modules/gdnative/godot/transform2d.cpp
index bdb5476f7d..01db3f7ae0 100644
--- a/modules/gdnative/godot/godot_transform2d.cpp
+++ b/modules/gdnative/godot/transform2d.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_transform2d.cpp */
+/* transform2d.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_transform2d.h"
+#include "transform2d.h"
#include "core/variant.h"
#include "core/math/math_2d.h"
diff --git a/modules/gdnative/godot/godot_transform2d.h b/modules/gdnative/godot/transform2d.h
index c375e90af7..7171e528f2 100644
--- a/modules/gdnative/godot/godot_transform2d.h
+++ b/modules/gdnative/godot/transform2d.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_transform2d.h */
+/* transform2d.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,16 +36,18 @@ extern "C" {
#include <stdint.h>
+#define GODOT_TRANSFORM2D_SIZE 24
+
#ifndef GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_TRANSFORM2D_TYPE_DEFINED
-typedef struct godot_transform2d {
- uint8_t _dont_touch_that[24];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_TRANSFORM2D_SIZE];
} godot_transform2d;
#endif
-#include "../godot.h"
-#include "godot_variant.h"
-#include "godot_vector2.h"
+#include "gdnative.h"
+#include "variant.h"
+#include "vector2.h"
void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos);
void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin);
diff --git a/modules/gdnative/godot/godot_variant.cpp b/modules/gdnative/godot/variant.cpp
index c9607fb21a..3469058cfd 100644
--- a/modules/gdnative/godot/godot_variant.cpp
+++ b/modules/gdnative/godot/variant.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_variant.cpp */
+/* variant.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_variant.h"
+#include "variant.h"
#include "core/variant.h"
#ifdef __cplusplus
diff --git a/modules/gdnative/godot/godot_variant.h b/modules/gdnative/godot/variant.h
index 9b6d287249..b56d5824fa 100644
--- a/modules/gdnative/godot/godot_variant.h
+++ b/modules/gdnative/godot/variant.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_variant.h */
+/* variant.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,9 +36,12 @@ extern "C" {
#include <stdint.h>
+#define GODOT_VARIANT_SIZE 24
+
#ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
-typedef struct godot_variant {
- uint8_t _dont_touch_that[24];
+#define GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VARIANT_SIZE];
} godot_variant;
#endif
@@ -96,25 +99,25 @@ typedef struct godot_variant_call_error {
godot_variant_type expected;
} godot_variant_call_error;
-#include "godot_array.h"
-#include "godot_basis.h"
-#include "godot_color.h"
-#include "godot_dictionary.h"
-#include "godot_node_path.h"
-#include "godot_plane.h"
-#include "godot_pool_arrays.h"
-#include "godot_quat.h"
-#include "godot_rect2.h"
-#include "godot_rect3.h"
-#include "godot_rid.h"
-#include "godot_string.h"
-#include "godot_transform.h"
-#include "godot_transform2d.h"
-#include "godot_variant.h"
-#include "godot_vector2.h"
-#include "godot_vector3.h"
-
-#include "../godot.h"
+#include "array.h"
+#include "basis.h"
+#include "color.h"
+#include "dictionary.h"
+#include "node_path.h"
+#include "plane.h"
+#include "pool_arrays.h"
+#include "quat.h"
+#include "rect2.h"
+#include "rect3.h"
+#include "rid.h"
+#include "string.h"
+#include "transform.h"
+#include "transform2d.h"
+#include "variant.h"
+#include "vector2.h"
+#include "vector3.h"
+
+#include "gdnative.h"
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
diff --git a/modules/gdnative/godot/godot_vector2.cpp b/modules/gdnative/godot/vector2.cpp
index 0ced800872..6b40e31a89 100644
--- a/modules/gdnative/godot/godot_vector2.cpp
+++ b/modules/gdnative/godot/vector2.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_vector2.cpp */
+/* vector2.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_vector2.h"
+#include "vector2.h"
#include "core/variant.h"
#include "core/math/math_2d.h"
diff --git a/modules/gdnative/godot/godot_vector2.h b/modules/gdnative/godot/vector2.h
index 9c7590fedf..9934ddadbb 100644
--- a/modules/gdnative/godot/godot_vector2.h
+++ b/modules/gdnative/godot/vector2.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_vector2.h */
+/* vector2.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,14 +36,16 @@ extern "C" {
#include <stdint.h>
+#define GODOT_VECTOR2_SIZE 8
+
#ifndef GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR2_TYPE_DEFINED
-typedef struct godot_vector2 {
- uint8_t _dont_touch_that[8];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VECTOR2_SIZE];
} godot_vector2;
#endif
-#include "../godot.h"
+#include "gdnative.h"
void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y);
diff --git a/modules/gdnative/godot/godot_vector3.cpp b/modules/gdnative/godot/vector3.cpp
index adca0d1e2a..904cdad9d0 100644
--- a/modules/gdnative/godot/godot_vector3.cpp
+++ b/modules/gdnative/godot/vector3.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_vector3.cpp */
+/* vector3.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "godot_vector3.h"
+#include "vector3.h"
#include "core/variant.h"
#include "core/vector.h"
diff --git a/modules/gdnative/godot/godot_vector3.h b/modules/gdnative/godot/vector3.h
index 98d9ddf6ac..b5f8d0f49a 100644
--- a/modules/gdnative/godot/godot_vector3.h
+++ b/modules/gdnative/godot/vector3.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* godot_vector3.h */
+/* vector3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -36,15 +36,17 @@ extern "C" {
#include <stdint.h>
+#define GODOT_VECTOR3_SIZE 12
+
#ifndef GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
-typedef struct godot_vector3 {
- uint8_t _dont_touch_that[12];
+typedef struct {
+ uint8_t _dont_touch_that[GODOT_VECTOR3_SIZE];
} godot_vector3;
#endif
-#include "../godot.h"
-#include "godot_basis.h"
+#include "basis.h"
+#include "gdnative.h"
typedef enum {
GODOT_VECTOR3_AXIS_X,