From 7878329e6fc828dc7ca0a8300ebdbaa0674a769c Mon Sep 17 00:00:00 2001 From: Karroffel Date: Sun, 3 Sep 2017 12:40:41 +0200 Subject: [PATCH] merged gdnative and nativescript module --- modules/gdnative/SCsub | 12 ++-- modules/gdnative/gdnative.h | 2 +- .../gdnative/{godot => gdnative}/array.cpp | 2 +- .../gdnative/{godot => gdnative}/basis.cpp | 2 +- .../gdnative/{godot => gdnative}/color.cpp | 2 +- .../{godot => gdnative}/dictionary.cpp | 2 +- .../gdnative/{godot => gdnative}/gdnative.cpp | 3 +- .../{godot => gdnative}/node_path.cpp | 2 +- .../gdnative/{godot => gdnative}/plane.cpp | 2 +- .../{godot => gdnative}/pool_arrays.cpp | 2 +- modules/gdnative/{godot => gdnative}/quat.cpp | 2 +- .../gdnative/{godot => gdnative}/rect2.cpp | 2 +- .../gdnative/{godot => gdnative}/rect3.cpp | 2 +- modules/gdnative/{godot => gdnative}/rid.cpp | 2 +- .../gdnative/{godot => gdnative}/string.cpp | 2 +- .../{godot => gdnative}/transform.cpp | 2 +- .../{godot => gdnative}/transform2d.cpp | 2 +- .../gdnative/{godot => gdnative}/variant.cpp | 2 +- .../gdnative/{godot => gdnative}/vector2.cpp | 2 +- .../gdnative/{godot => gdnative}/vector3.cpp | 2 +- modules/gdnative/godot/icon.png.import | 23 ------- .../{godot => include/gdnative}/array.h | 6 +- .../{godot => include/gdnative}/basis.h | 6 +- .../{godot => include/gdnative}/color.h | 4 +- .../{godot => include/gdnative}/dictionary.h | 6 +- .../{godot => include/gdnative}/gdnative.h | 60 ++++++------------- .../{godot => include/gdnative}/node_path.h | 4 +- .../{godot => include/gdnative}/plane.h | 4 +- .../{godot => include/gdnative}/pool_arrays.h | 10 ++-- .../{godot => include/gdnative}/quat.h | 4 +- .../{godot => include/gdnative}/rect2.h | 4 +- .../{godot => include/gdnative}/rect3.h | 6 +- .../{godot => include/gdnative}/rid.h | 2 +- .../{godot => include/gdnative}/string.h | 4 +- .../{godot => include/gdnative}/transform.h | 8 +-- .../{godot => include/gdnative}/transform2d.h | 6 +- .../{godot => include/gdnative}/variant.h | 36 +++++------ .../{godot => include/gdnative}/vector2.h | 2 +- .../{godot => include/gdnative}/vector3.h | 4 +- .../nativescript/godot_nativescript.h | 2 +- modules/{ => gdnative}/nativescript/SCsub | 0 .../nativescript/api_generator.cpp | 0 .../nativescript/api_generator.h | 0 .../nativescript/godot_nativescript.cpp | 8 +-- .../nativescript/nativescript.cpp | 2 +- .../nativescript/nativescript.h | 2 +- .../nativescript/register_types.cpp | 0 .../nativescript/register_types.h | 0 modules/gdnative/register_types.cpp | 9 +++ modules/nativescript/config.py | 8 --- 50 files changed, 118 insertions(+), 163 deletions(-) rename modules/gdnative/{godot => gdnative}/array.cpp (99%) rename modules/gdnative/{godot => gdnative}/basis.cpp (99%) rename modules/gdnative/{godot => gdnative}/color.cpp (99%) rename modules/gdnative/{godot => gdnative}/dictionary.cpp (99%) rename modules/gdnative/{godot => gdnative}/gdnative.cpp (99%) rename modules/gdnative/{godot => gdnative}/node_path.cpp (99%) rename modules/gdnative/{godot => gdnative}/plane.cpp (99%) rename modules/gdnative/{godot => gdnative}/pool_arrays.cpp (99%) rename modules/gdnative/{godot => gdnative}/quat.cpp (99%) rename modules/gdnative/{godot => gdnative}/rect2.cpp (99%) rename modules/gdnative/{godot => gdnative}/rect3.cpp (99%) rename modules/gdnative/{godot => gdnative}/rid.cpp (99%) rename modules/gdnative/{godot => gdnative}/string.cpp (99%) rename modules/gdnative/{godot => gdnative}/transform.cpp (99%) rename modules/gdnative/{godot => gdnative}/transform2d.cpp (99%) rename modules/gdnative/{godot => gdnative}/variant.cpp (99%) rename modules/gdnative/{godot => gdnative}/vector2.cpp (99%) rename modules/gdnative/{godot => gdnative}/vector3.cpp (99%) delete mode 100644 modules/gdnative/godot/icon.png.import rename modules/gdnative/{godot => include/gdnative}/array.h (98%) rename modules/gdnative/{godot => include/gdnative}/basis.h (98%) rename modules/gdnative/{godot => include/gdnative}/color.h (98%) rename modules/gdnative/{godot => include/gdnative}/dictionary.h (97%) rename modules/gdnative/{godot => include/gdnative}/gdnative.h (83%) rename modules/gdnative/{godot => include/gdnative}/node_path.h (98%) rename modules/gdnative/{godot => include/gdnative}/plane.h (98%) rename modules/gdnative/{godot => include/gdnative}/pool_arrays.h (98%) rename modules/gdnative/{godot => include/gdnative}/quat.h (98%) rename modules/gdnative/{godot => include/gdnative}/rect2.h (98%) rename modules/gdnative/{godot => include/gdnative}/rect3.h (98%) rename modules/gdnative/{godot => include/gdnative}/rid.h (98%) rename modules/gdnative/{godot => include/gdnative}/string.h (99%) rename modules/gdnative/{godot => include/gdnative}/transform.h (97%) rename modules/gdnative/{godot => include/gdnative}/transform2d.h (98%) rename modules/gdnative/{godot => include/gdnative}/variant.h (94%) rename modules/gdnative/{godot => include/gdnative}/vector2.h (99%) rename modules/gdnative/{godot => include/gdnative}/vector3.h (99%) rename modules/{ => gdnative/include}/nativescript/godot_nativescript.h (99%) rename modules/{ => gdnative}/nativescript/SCsub (100%) rename modules/{ => gdnative}/nativescript/api_generator.cpp (100%) rename modules/{ => gdnative}/nativescript/api_generator.h (100%) rename modules/{ => gdnative}/nativescript/godot_nativescript.cpp (98%) rename modules/{ => gdnative}/nativescript/nativescript.cpp (99%) rename modules/{ => gdnative}/nativescript/nativescript.h (99%) rename modules/{ => gdnative}/nativescript/register_types.cpp (100%) rename modules/{ => gdnative}/nativescript/register_types.h (100%) delete mode 100644 modules/nativescript/config.py diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 65970d48c13..f386f2b5424 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -2,12 +2,16 @@ Import('env') -env.add_source_files(env.modules_sources, "*.cpp") -env.add_source_files(env.modules_sources, "godot/*.cpp") +gdn_env = env.Clone() -env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) -env.Append(CPPPATH=['#modules/gdnative/']) +gdn_env.add_source_files(env.modules_sources, "*.cpp") +gdn_env.add_source_files(env.modules_sources, "gdnative/*.cpp") +gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp") + +gdn_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) +gdn_env.Append(CPPPATH=['#modules/gdnative/include/']) if "platform" in env and env["platform"] == "x11": # there has to be a better solution? env.Append(LINKFLAGS=["-rdynamic"]) + env.use_ptrcall = True diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index dc1c3507ec4..38a480925bc 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -35,7 +35,7 @@ #include "os/thread_safe.h" #include "resource.h" -#include +#include "gdnative/gdnative.h" class GDNativeLibrary : public Resource { GDCLASS(GDNativeLibrary, Resource) diff --git a/modules/gdnative/godot/array.cpp b/modules/gdnative/gdnative/array.cpp similarity index 99% rename from modules/gdnative/godot/array.cpp rename to modules/gdnative/gdnative/array.cpp index c3fde0e954d..51c023981fc 100644 --- a/modules/gdnative/godot/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -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 +#include "gdnative/array.h" #include "core/array.h" #include "core/os/memory.h" diff --git a/modules/gdnative/godot/basis.cpp b/modules/gdnative/gdnative/basis.cpp similarity index 99% rename from modules/gdnative/godot/basis.cpp rename to modules/gdnative/gdnative/basis.cpp index 1d7aa18a70e..b1327cdaef2 100644 --- a/modules/gdnative/godot/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -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 +#include "gdnative/basis.h" #include "core/math/matrix3.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/color.cpp b/modules/gdnative/gdnative/color.cpp similarity index 99% rename from modules/gdnative/godot/color.cpp rename to modules/gdnative/gdnative/color.cpp index 3677fdc265a..3f8912d8966 100644 --- a/modules/gdnative/godot/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -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 +#include "gdnative/color.h" #include "core/color.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp similarity index 99% rename from modules/gdnative/godot/dictionary.cpp rename to modules/gdnative/gdnative/dictionary.cpp index 2996cc78a32..ed98cdbb00b 100644 --- a/modules/gdnative/godot/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -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 +#include "gdnative/dictionary.h" #include "core/variant.h" // core/variant.h before to avoid compile errors with MSVC diff --git a/modules/gdnative/godot/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp similarity index 99% rename from modules/gdnative/godot/gdnative.cpp rename to modules/gdnative/gdnative/gdnative.cpp index 7cd52da34d3..cf1f6a4f16d 100644 --- a/modules/gdnative/godot/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -27,11 +27,10 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include +#include "gdnative/gdnative.h" #include "class_db.h" #include "error_macros.h" -#include "gdnative.h" #include "global_constants.h" #include "os/os.h" #include "project_settings.h" diff --git a/modules/gdnative/godot/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp similarity index 99% rename from modules/gdnative/godot/node_path.cpp rename to modules/gdnative/gdnative/node_path.cpp index 2309588a811..50fade5b94d 100644 --- a/modules/gdnative/godot/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -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 +#include "gdnative/node_path.h" #include "core/node_path.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/plane.cpp b/modules/gdnative/gdnative/plane.cpp similarity index 99% rename from modules/gdnative/godot/plane.cpp rename to modules/gdnative/gdnative/plane.cpp index f3d4b6971ec..a5e05ffa6b8 100644 --- a/modules/gdnative/godot/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -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 +#include "gdnative/plane.h" #include "core/math/plane.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp similarity index 99% rename from modules/gdnative/godot/pool_arrays.cpp rename to modules/gdnative/gdnative/pool_arrays.cpp index 49bf8510515..1393374da20 100644 --- a/modules/gdnative/godot/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -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 +#include "gdnative/pool_arrays.h" #include "array.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/quat.cpp b/modules/gdnative/gdnative/quat.cpp similarity index 99% rename from modules/gdnative/godot/quat.cpp rename to modules/gdnative/gdnative/quat.cpp index e6bea78b604..7db7847da1c 100644 --- a/modules/gdnative/godot/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -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 +#include "gdnative/quat.h" #include "core/math/quat.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp similarity index 99% rename from modules/gdnative/godot/rect2.cpp rename to modules/gdnative/gdnative/rect2.cpp index 98e7855dc9c..ecd8cce9ca8 100644 --- a/modules/gdnative/godot/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -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 +#include "gdnative/rect2.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rect3.cpp b/modules/gdnative/gdnative/rect3.cpp similarity index 99% rename from modules/gdnative/godot/rect3.cpp rename to modules/gdnative/gdnative/rect3.cpp index 88952ab49c0..d34d964db9b 100644 --- a/modules/gdnative/godot/rect3.cpp +++ b/modules/gdnative/gdnative/rect3.cpp @@ -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 +#include "gdnative/rect3.h" #include "core/math/rect3.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rid.cpp b/modules/gdnative/gdnative/rid.cpp similarity index 99% rename from modules/gdnative/godot/rid.cpp rename to modules/gdnative/gdnative/rid.cpp index 51c8aaa1b3c..f05c39906cb 100644 --- a/modules/gdnative/godot/rid.cpp +++ b/modules/gdnative/gdnative/rid.cpp @@ -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 +#include "gdnative/rid.h" #include "core/resource.h" #include "core/rid.h" diff --git a/modules/gdnative/godot/string.cpp b/modules/gdnative/gdnative/string.cpp similarity index 99% rename from modules/gdnative/godot/string.cpp rename to modules/gdnative/gdnative/string.cpp index 1282cf95e5f..9b715ce36a4 100644 --- a/modules/gdnative/godot/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -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 +#include "gdnative/string.h" #include "core/variant.h" #include "string_db.h" diff --git a/modules/gdnative/godot/transform.cpp b/modules/gdnative/gdnative/transform.cpp similarity index 99% rename from modules/gdnative/godot/transform.cpp rename to modules/gdnative/gdnative/transform.cpp index a965067b77e..d7a3e78d3f6 100644 --- a/modules/gdnative/godot/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -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 +#include "gdnative/transform.h" #include "core/math/transform.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/transform2d.cpp b/modules/gdnative/gdnative/transform2d.cpp similarity index 99% rename from modules/gdnative/godot/transform2d.cpp rename to modules/gdnative/gdnative/transform2d.cpp index 9fc44ecdfa0..dcb54f7a539 100644 --- a/modules/gdnative/godot/transform2d.cpp +++ b/modules/gdnative/gdnative/transform2d.cpp @@ -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 +#include "gdnative/transform2d.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/variant.cpp b/modules/gdnative/gdnative/variant.cpp similarity index 99% rename from modules/gdnative/godot/variant.cpp rename to modules/gdnative/gdnative/variant.cpp index 582544b3a0b..b61f80b1f90 100644 --- a/modules/gdnative/godot/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -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 +#include "gdnative/variant.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp similarity index 99% rename from modules/gdnative/godot/vector2.cpp rename to modules/gdnative/gdnative/vector2.cpp index 78ed5f06a98..67f858997f6 100644 --- a/modules/gdnative/godot/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -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 +#include "gdnative/vector2.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp similarity index 99% rename from modules/gdnative/godot/vector3.cpp rename to modules/gdnative/gdnative/vector3.cpp index 5faeac28648..c85a3f1c080 100644 --- a/modules/gdnative/godot/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -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 +#include "gdnative/vector3.h" #include "core/variant.h" #include "core/vector.h" diff --git a/modules/gdnative/godot/icon.png.import b/modules/gdnative/godot/icon.png.import deleted file mode 100644 index 27920124f9a..00000000000 --- a/modules/gdnative/godot/icon.png.import +++ /dev/null @@ -1,23 +0,0 @@ -[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/array.h b/modules/gdnative/include/gdnative/array.h similarity index 98% rename from modules/gdnative/godot/array.h rename to modules/gdnative/include/gdnative/array.h index 08f73c87853..edab028cba1 100644 --- a/modules/gdnative/godot/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -46,10 +46,10 @@ typedef struct { } godot_array; #endif -#include -#include +#include +#include -#include +#include 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/basis.h b/modules/gdnative/include/gdnative/basis.h similarity index 98% rename from modules/gdnative/godot/basis.h rename to modules/gdnative/include/gdnative/basis.h index f36d2199deb..8ff6a6f5412 100644 --- a/modules/gdnative/godot/basis.h +++ b/modules/gdnative/include/gdnative/basis.h @@ -45,9 +45,9 @@ typedef struct { } godot_basis; #endif -#include -#include -#include +#include +#include +#include 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/color.h b/modules/gdnative/include/gdnative/color.h similarity index 98% rename from modules/gdnative/godot/color.h rename to modules/gdnative/include/gdnative/color.h index 5d550e40b3c..90dccf75aab 100644 --- a/modules/gdnative/godot/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -45,8 +45,8 @@ typedef struct { } godot_color; #endif -#include -#include +#include +#include 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/dictionary.h b/modules/gdnative/include/gdnative/dictionary.h similarity index 97% rename from modules/gdnative/godot/dictionary.h rename to modules/gdnative/include/gdnative/dictionary.h index 10d580af086..c85c3f38302 100644 --- a/modules/gdnative/godot/dictionary.h +++ b/modules/gdnative/include/gdnative/dictionary.h @@ -45,9 +45,9 @@ typedef struct { } godot_dictionary; #endif -#include -#include -#include +#include +#include +#include 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.h b/modules/gdnative/include/gdnative/gdnative.h similarity index 83% rename from modules/gdnative/godot/gdnative.h rename to modules/gdnative/include/gdnative/gdnative.h index c71a7ae1ef1..c574c56d5a4 100644 --- a/modules/gdnative/godot/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -146,100 +146,74 @@ 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 +#include ////// Vector2 -#include +#include ////// Rect2 -#include +#include ////// Vector3 -#include +#include ////// Transform2D -#include +#include /////// Plane -#include +#include /////// Quat -#include +#include /////// Rect3 -#include +#include /////// Basis -#include +#include /////// Transform -#include +#include /////// Color -#include +#include /////// NodePath -#include +#include /////// RID -#include +#include /////// Dictionary -#include +#include /////// Array -#include +#include // single API file for Pool*Array -#include +#include void GDAPI godot_object_destroy(godot_object *p_o); ////// Variant -#include +#include ////// Singleton API diff --git a/modules/gdnative/godot/node_path.h b/modules/gdnative/include/gdnative/node_path.h similarity index 98% rename from modules/gdnative/godot/node_path.h rename to modules/gdnative/include/gdnative/node_path.h index 2f71ddd59dc..0cfdbc1127d 100644 --- a/modules/gdnative/godot/node_path.h +++ b/modules/gdnative/include/gdnative/node_path.h @@ -45,8 +45,8 @@ typedef struct { } godot_node_path; #endif -#include -#include +#include +#include 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/plane.h b/modules/gdnative/include/gdnative/plane.h similarity index 98% rename from modules/gdnative/godot/plane.h rename to modules/gdnative/include/gdnative/plane.h index 27548c8b0c7..6a8915e08bc 100644 --- a/modules/gdnative/godot/plane.h +++ b/modules/gdnative/include/gdnative/plane.h @@ -45,8 +45,8 @@ typedef struct { } godot_plane; #endif -#include -#include +#include +#include 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/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h similarity index 98% rename from modules/gdnative/godot/pool_arrays.h rename to modules/gdnative/include/gdnative/pool_arrays.h index 1b51dca38c5..cb1095ee8ce 100644 --- a/modules/gdnative/godot/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -113,12 +113,12 @@ typedef struct { } godot_pool_color_array; #endif -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include // byte diff --git a/modules/gdnative/godot/quat.h b/modules/gdnative/include/gdnative/quat.h similarity index 98% rename from modules/gdnative/godot/quat.h rename to modules/gdnative/include/gdnative/quat.h index 9a3238a337d..4ffb96eb26d 100644 --- a/modules/gdnative/godot/quat.h +++ b/modules/gdnative/include/gdnative/quat.h @@ -45,8 +45,8 @@ typedef struct { } godot_quat; #endif -#include -#include +#include +#include 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/rect2.h b/modules/gdnative/include/gdnative/rect2.h similarity index 98% rename from modules/gdnative/godot/rect2.h rename to modules/gdnative/include/gdnative/rect2.h index 8ceeddf1b4e..9e6cf603429 100644 --- a/modules/gdnative/godot/rect2.h +++ b/modules/gdnative/include/gdnative/rect2.h @@ -43,8 +43,8 @@ typedef struct godot_rect2 { } godot_rect2; #endif -#include -#include +#include +#include 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/rect3.h b/modules/gdnative/include/gdnative/rect3.h similarity index 98% rename from modules/gdnative/godot/rect3.h rename to modules/gdnative/include/gdnative/rect3.h index ca96aadd5c4..f94b6fea256 100644 --- a/modules/gdnative/godot/rect3.h +++ b/modules/gdnative/include/gdnative/rect3.h @@ -45,9 +45,9 @@ typedef struct { } godot_rect3; #endif -#include -#include -#include +#include +#include +#include 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/rid.h b/modules/gdnative/include/gdnative/rid.h similarity index 98% rename from modules/gdnative/godot/rid.h rename to modules/gdnative/include/gdnative/rid.h index c56ff387351..d9b5336fc9a 100644 --- a/modules/gdnative/godot/rid.h +++ b/modules/gdnative/include/gdnative/rid.h @@ -45,7 +45,7 @@ typedef struct { } godot_rid; #endif -#include +#include void GDAPI godot_rid_new(godot_rid *r_dest); diff --git a/modules/gdnative/godot/string.h b/modules/gdnative/include/gdnative/string.h similarity index 99% rename from modules/gdnative/godot/string.h rename to modules/gdnative/include/gdnative/string.h index 128448e64e1..aca23a81d85 100644 --- a/modules/gdnative/godot/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -46,8 +46,8 @@ typedef struct { } godot_string; #endif -#include -#include +#include +#include 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/transform.h b/modules/gdnative/include/gdnative/transform.h similarity index 97% rename from modules/gdnative/godot/transform.h rename to modules/gdnative/include/gdnative/transform.h index 60788e3d575..656afae1296 100644 --- a/modules/gdnative/godot/transform.h +++ b/modules/gdnative/include/gdnative/transform.h @@ -45,10 +45,10 @@ typedef struct { } godot_transform; #endif -#include -#include -#include -#include +#include +#include +#include +#include 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/transform2d.h b/modules/gdnative/include/gdnative/transform2d.h similarity index 98% rename from modules/gdnative/godot/transform2d.h rename to modules/gdnative/include/gdnative/transform2d.h index c0f5725eed4..a945868b17e 100644 --- a/modules/gdnative/godot/transform2d.h +++ b/modules/gdnative/include/gdnative/transform2d.h @@ -45,9 +45,9 @@ typedef struct { } godot_transform2d; #endif -#include -#include -#include +#include +#include +#include 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/variant.h b/modules/gdnative/include/gdnative/variant.h similarity index 94% rename from modules/gdnative/godot/variant.h rename to modules/gdnative/include/gdnative/variant.h index 849ba8bda6f..969506585dd 100644 --- a/modules/gdnative/godot/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -99,25 +99,25 @@ typedef struct godot_variant_call_error { godot_variant_type expected; } godot_variant_call_error; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v); diff --git a/modules/gdnative/godot/vector2.h b/modules/gdnative/include/gdnative/vector2.h similarity index 99% rename from modules/gdnative/godot/vector2.h rename to modules/gdnative/include/gdnative/vector2.h index 98e9700e321..0af4abae275 100644 --- a/modules/gdnative/godot/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -45,7 +45,7 @@ typedef struct { } godot_vector2; #endif -#include +#include 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/vector3.h b/modules/gdnative/include/gdnative/vector3.h similarity index 99% rename from modules/gdnative/godot/vector3.h rename to modules/gdnative/include/gdnative/vector3.h index b76ca11a9c4..a27d516ec5f 100644 --- a/modules/gdnative/godot/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -45,8 +45,8 @@ typedef struct { } godot_vector3; #endif -#include -#include +#include +#include typedef enum { GODOT_VECTOR3_AXIS_X, diff --git a/modules/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h similarity index 99% rename from modules/nativescript/godot_nativescript.h rename to modules/gdnative/include/nativescript/godot_nativescript.h index d1cbf221ec6..96f213ead7c 100644 --- a/modules/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -30,7 +30,7 @@ #ifndef GODOT_NATIVESCRIPT_H #define GODOT_NATIVESCRIPT_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/modules/nativescript/SCsub b/modules/gdnative/nativescript/SCsub similarity index 100% rename from modules/nativescript/SCsub rename to modules/gdnative/nativescript/SCsub diff --git a/modules/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp similarity index 100% rename from modules/nativescript/api_generator.cpp rename to modules/gdnative/nativescript/api_generator.cpp diff --git a/modules/nativescript/api_generator.h b/modules/gdnative/nativescript/api_generator.h similarity index 100% rename from modules/nativescript/api_generator.h rename to modules/gdnative/nativescript/api_generator.h diff --git a/modules/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp similarity index 98% rename from modules/nativescript/godot_nativescript.cpp rename to modules/gdnative/nativescript/godot_nativescript.cpp index 926b3261b2c..61ac13b7969 100644 --- a/modules/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -27,17 +27,17 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "godot_nativescript.h" - -#include "nativescript.h" +#include "nativescript/godot_nativescript.h" #include "class_db.h" #include "error_macros.h" -#include "gdnative.h" +#include "gdnative/gdnative.h" #include "global_constants.h" #include "project_settings.h" #include "variant.h" +#include "nativescript.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/modules/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp similarity index 99% rename from modules/nativescript/nativescript.cpp rename to modules/gdnative/nativescript/nativescript.cpp index e1410806873..724b8390da3 100644 --- a/modules/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "nativescript.h" -#include "modules/gdnative/godot/gdnative.h" +#include "gdnative/gdnative.h" #include "global_constants.h" #include "io/file_access_encrypted.h" diff --git a/modules/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h similarity index 99% rename from modules/nativescript/nativescript.h rename to modules/gdnative/nativescript/nativescript.h index 571a3c9cc7f..6c55e3e327f 100644 --- a/modules/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -38,8 +38,8 @@ #include "script_language.h" #include "self_list.h" -#include "godot_nativescript.h" #include "modules/gdnative/gdnative.h" +#include #ifndef NO_THREADS #include "os/mutex.h" diff --git a/modules/nativescript/register_types.cpp b/modules/gdnative/nativescript/register_types.cpp similarity index 100% rename from modules/nativescript/register_types.cpp rename to modules/gdnative/nativescript/register_types.cpp diff --git a/modules/nativescript/register_types.h b/modules/gdnative/nativescript/register_types.h similarity index 100% rename from modules/nativescript/register_types.h rename to modules/gdnative/nativescript/register_types.h diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 9ad05b71941..a63bf0c0a9a 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -28,11 +28,15 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_types.h" +#include "gdnative/gdnative.h" + #include "gdnative.h" #include "io/resource_loader.h" #include "io/resource_saver.h" +#include "nativescript/register_types.h" + #include "core/os/os.h" godot_variant cb_standard_varcall(void *handle, godot_string *p_procedure, godot_array *p_args) { @@ -72,9 +76,14 @@ void register_gdnative_types() { GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry); GDNativeCallRegistry::singleton->register_native_call_type("standard_varcall", cb_standard_varcall); + + register_nativescript_types(); } void unregister_gdnative_types() { + + unregister_nativescript_types(); + memdelete(GDNativeCallRegistry::singleton); // This is for printing out the sizes of the core types diff --git a/modules/nativescript/config.py b/modules/nativescript/config.py deleted file mode 100644 index 9f57b9bb740..00000000000 --- a/modules/nativescript/config.py +++ /dev/null @@ -1,8 +0,0 @@ - - -def can_build(platform): - return True - - -def configure(env): - env.use_ptrcall = True