More cleanups.

This commit is contained in:
Relintai 2023-05-25 21:54:24 +02:00
parent 6f9dd799d0
commit b2f4bb8314
51 changed files with 121 additions and 176 deletions

9
SCsub
View File

@ -1,9 +1,14 @@
#!/usr/bin/env python
import os
Import("env")
Import("env_modules")
env_gdnative = env_modules.Clone()
env_gdnative.Prepend(CPPPATH=[os.path.normpath(os.path.abspath("./include/"))])
env_gdnative.add_source_files(env.modules_sources, "gdnative.cpp")
env_gdnative.add_source_files(env.modules_sources, "register_types.cpp")
env_gdnative.add_source_files(env.modules_sources, "android/*.cpp")
@ -12,8 +17,6 @@ env_gdnative.add_source_files(env.modules_sources, "nativescript/*.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
env_gdnative.Prepend(CPPPATH=["./include/"])
Export("env_gdnative")
SConscript("net/SCsub")
@ -43,7 +46,7 @@ if get_cmdline_bool("gdnative_wrapper", False):
)
gd_wrapper_env = env.Clone()
gd_wrapper_env.Prepend(CPPPATH=["#modules/gdnative/include/"])
gd_wrapper_env.Prepend(CPPPATH=[os.path.normpath(os.path.abspath("./include/"))])
if gd_wrapper_env["use_lto"]:
if not env.msvc:

View File

@ -36,7 +36,7 @@
#include "core/os/thread_safe.h"
#include "core/object/resource.h"
#include "include/gdnative/gdnative.h"
#include "include/gdn/gdnative.h"
#include "include/gdnative_api_struct.gen.h"
#include "core/io/config_file.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/aabb.h"
#include "gdn/aabb.h"
#include "core/math/aabb.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/array.h"
#include "gdn/array.h"
#include "core/variant/array.h"
#include "core/os/memory.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/basis.h"
#include "gdn/basis.h"
#include "core/math/basis.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/color.h"
#include "gdn/color.h"
#include "core/math/color.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/dictionary.h"
#include "gdn/dictionary.h"
#include "core/variant/variant.h"
// core/variant.h before to avoid compile errors with MSVC

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/gdnative.h"
#include "gdn/gdnative.h"
#include "core/object/class_db.h"
#include "core/config/engine.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/node_path.h"
#include "gdn/node_path.h"
#include "core/string/node_path.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/plane.h"
#include "gdn/plane.h"
#include "core/math/plane.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/pool_arrays.h"
#include "gdn/pool_arrays.h"
#include "core/variant/array.h"
#include "core/containers/pool_vector.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/quaternion.h"
#include "gdn/quaternion.h"
#include "core/math/quaternion.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/rect2.h"
#include "gdn/rect2.h"
#include "core/math/transform_2d.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/rid.h"
#include "gdn/rid.h"
#include "core/object/resource.h"
#include "core/containers/rid.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/string.h"
#include "gdn/string.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/string_name.h"
#include "gdn/string_name.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/transform.h"
#include "gdn/transform.h"
#include "core/math/transform.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/transform2d.h"
#include "gdn/transform2d.h"
#include "core/math/transform_2d.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/variant.h"
#include "gdn/variant.h"
#include "core/object/reference.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/vector2.h"
#include "gdn/vector2.h"
#include "core/math/vector2.h"
#include "core/variant/variant.h"

View File

@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#include "gdnative/vector3.h"
#include "gdn/vector3.h"
#include "core/variant/variant.h"
#include "core/containers/vector.h"

View File

@ -5076,7 +5076,7 @@
},
{
"name": "godot_string_operator_index",
"return_type": "const wchar_t *",
"return_type": "const char32_t *",
"arguments": [
["godot_string *", "p_self"],
["const godot_int", "p_idx"]
@ -5084,7 +5084,7 @@
},
{
"name": "godot_string_operator_index_const",
"return_type": "wchar_t",
"return_type": "char32_t",
"arguments": [
["const godot_string *", "p_self"],
["const godot_int", "p_idx"]
@ -5092,7 +5092,7 @@
},
{
"name": "godot_string_wide_str",
"return_type": "const wchar_t *",
"return_type": "const char32_t *",
"arguments": [
["const godot_string *", "p_self"]
]

View File

@ -42,7 +42,7 @@ def _build_gdnative_api_struct_header(api):
"#ifndef GODOT_GDNATIVE_API_STRUCT_H",
"#define GODOT_GDNATIVE_API_STRUCT_H",
"",
"#include <gdnative/gdnative.h>",
"#include <gdn/gdnative.h>",
"#include <android/godot_android.h>",
"#include <nativescript/godot_nativescript.h>",
"#include <net/godot_net.h>",
@ -282,7 +282,7 @@ def _build_gdnative_wrapper_code(api):
out = [
"/* THIS FILE IS GENERATED DO NOT EDIT */",
"",
"#include <gdnative/gdnative.h>",
"#include <gdn/gdnative.h>",
"#include <nativescript/godot_nativescript.h>",
"#include <pluginscript/godot_pluginscript.h>",
"#include <videodecoder/godot_videodecoder.h>",

View File

@ -31,7 +31,7 @@
#ifndef GODOT_ANDROID_H
#define GODOT_ANDROID_H
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __ANDROID__
#include <jni.h>

View File

@ -51,9 +51,9 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/plane.h>
#include <gdnative/vector3.h>
#include <gdn/gdnative.h>
#include <gdn/plane.h>
#include <gdn/vector3.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,10 +51,10 @@ typedef struct {
}
#endif
#include <gdnative/pool_arrays.h>
#include <gdnative/variant.h>
#include <gdn/pool_arrays.h>
#include <gdn/variant.h>
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,9 +51,9 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/quaternion.h>
#include <gdnative/vector3.h>
#include <gdn/gdnative.h>
#include <gdn/quaternion.h>
#include <gdn/vector3.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,8 +51,8 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/string.h>
#include <gdn/gdnative.h>
#include <gdn/string.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,9 +51,9 @@ typedef struct {
}
#endif
#include <gdnative/array.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdn/array.h>
#include <gdn/gdnative.h>
#include <gdn/variant.h>
#ifdef __cplusplus
extern "C" {

View File

@ -142,76 +142,76 @@ typedef void godot_object;
/////// String
#include <gdnative/string.h>
#include <gdn/string.h>
/////// String name
#include <gdnative/string_name.h>
#include <gdn/string_name.h>
////// Vector2
#include <gdnative/vector2.h>
#include <gdn/vector2.h>
////// Rect2
#include <gdnative/rect2.h>
#include <gdn/rect2.h>
////// Vector3
#include <gdnative/vector3.h>
#include <gdn/vector3.h>
////// Transform2D
#include <gdnative/transform2d.h>
#include <gdn/transform2d.h>
/////// Plane
#include <gdnative/plane.h>
#include <gdn/plane.h>
/////// Quaternion
#include <gdnative/quaternion.h>
#include <gdn/quaternion.h>
/////// AABB
#include <gdnative/aabb.h>
#include <gdn/aabb.h>
/////// Basis
#include <gdnative/basis.h>
#include <gdn/basis.h>
/////// Transform
#include <gdnative/transform.h>
#include <gdn/transform.h>
/////// Color
#include <gdnative/color.h>
#include <gdn/color.h>
/////// NodePath
#include <gdnative/node_path.h>
#include <gdn/node_path.h>
/////// RID
#include <gdnative/rid.h>
#include <gdn/rid.h>
/////// Dictionary
#include <gdnative/dictionary.h>
#include <gdn/dictionary.h>
/////// Array
#include <gdnative/array.h>
#include <gdn/array.h>
// single API file for Pool*Array
#include <gdnative/pool_arrays.h>
#include <gdn/pool_arrays.h>
void GDAPI godot_object_destroy(godot_object *p_o);
////// Variant
#include <gdnative/variant.h>
#include <gdn/variant.h>
////// Singleton API

View File

@ -51,8 +51,8 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/string.h>
#include <gdn/gdnative.h>
#include <gdn/string.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,8 +51,8 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#include <gdn/gdnative.h>
#include <gdn/vector3.h>
#ifdef __cplusplus
extern "C" {

View File

@ -151,12 +151,12 @@ typedef struct {
}
#endif
#include <gdnative/array.h>
#include <gdnative/color.h>
#include <gdnative/vector2.h>
#include <gdnative/vector3.h>
#include <gdn/array.h>
#include <gdn/color.h>
#include <gdn/vector2.h>
#include <gdn/vector3.h>
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,8 +51,8 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector3.h>
#include <gdn/gdnative.h>
#include <gdn/vector3.h>
#ifdef __cplusplus
extern "C" {

View File

@ -49,8 +49,8 @@ typedef struct godot_rect2 {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/vector2.h>
#include <gdn/gdnative.h>
#include <gdn/vector2.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,7 +51,7 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -64,9 +64,9 @@ typedef struct {
}
#endif
#include <gdnative/array.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdn/array.h>
#include <gdn/gdnative.h>
#include <gdn/variant.h>
#ifdef __cplusplus
extern "C" {

View File

@ -52,7 +52,7 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,10 +51,10 @@ typedef struct {
}
#endif
#include <gdnative/basis.h>
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdnative/vector3.h>
#include <gdn/basis.h>
#include <gdn/gdnative.h>
#include <gdn/variant.h>
#include <gdn/vector3.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,9 +51,9 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdnative/variant.h>
#include <gdnative/vector2.h>
#include <gdn/gdnative.h>
#include <gdn/variant.h>
#include <gdn/vector2.h>
#ifdef __cplusplus
extern "C" {

View File

@ -144,25 +144,25 @@ typedef enum godot_variant_operator {
}
#endif
#include <gdnative/aabb.h>
#include <gdnative/array.h>
#include <gdnative/basis.h>
#include <gdnative/color.h>
#include <gdnative/dictionary.h>
#include <gdnative/node_path.h>
#include <gdnative/plane.h>
#include <gdnative/pool_arrays.h>
#include <gdnative/quaternion.h>
#include <gdnative/rect2.h>
#include <gdnative/rid.h>
#include <gdnative/string.h>
#include <gdnative/transform.h>
#include <gdnative/transform2d.h>
#include <gdnative/variant.h>
#include <gdnative/vector2.h>
#include <gdnative/vector3.h>
#include <gdn/aabb.h>
#include <gdn/array.h>
#include <gdn/basis.h>
#include <gdn/color.h>
#include <gdn/dictionary.h>
#include <gdn/node_path.h>
#include <gdn/plane.h>
#include <gdn/pool_arrays.h>
#include <gdn/quaternion.h>
#include <gdn/rect2.h>
#include <gdn/rid.h>
#include <gdn/string.h>
#include <gdn/transform.h>
#include <gdn/transform2d.h>
#include <gdn/variant.h>
#include <gdn/vector2.h>
#include <gdn/vector3.h>
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,7 +51,7 @@ typedef struct {
}
#endif
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -51,8 +51,8 @@ typedef struct {
}
#endif
#include <gdnative/basis.h>
#include <gdnative/gdnative.h>
#include <gdn/basis.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -31,7 +31,7 @@
#ifndef GODOT_NATIVESCRIPT_H
#define GODOT_NATIVESCRIPT_H
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -31,7 +31,7 @@
#ifndef GODOT_NET_H
#define GODOT_NET_H
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -31,7 +31,7 @@
#ifndef GODOT_PLUGINSCRIPT_H
#define GODOT_PLUGINSCRIPT_H
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#include <nativescript/godot_nativescript.h>
#ifdef __cplusplus

View File

@ -31,7 +31,7 @@
#ifndef GODOT_VIDEODECODER_H
#define GODOT_VIDEODECODER_H
#include <gdnative/gdnative.h>
#include <gdn/gdnative.h>
#ifdef __cplusplus
extern "C" {

View File

@ -33,8 +33,8 @@
#include "core/io/networked_multiplayer_peer.h"
#include "../include/gdnative/gdnative.h"
#include "../include/net/godot_net.h"
#include "gdn/gdnative.h"
#include "net/godot_net.h"
class MultiplayerPeerGDNative : public NetworkedMultiplayerPeer {
GDCLASS(MultiplayerPeerGDNative, NetworkedMultiplayerPeer);

View File

@ -33,8 +33,8 @@
#include "core/io/packet_peer.h"
#include "../include/gdnative/gdnative.h"
#include "../include/net/godot_net.h"
#include "gdn/gdnative.h"
#include "net/godot_net.h"
class PacketPeerGDNative : public PacketPeer {
GDCLASS(PacketPeerGDNative, PacketPeer);

View File

@ -1,60 +0,0 @@
/**************************************************************************/
/* webrtc_gdnative.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 "../include/net/godot_net.h"
#ifdef WEBRTC_GDNATIVE_ENABLED
#include "webrtc/webrtc_data_channel_gdnative.h"
#include "webrtc/webrtc_peer_connection_gdnative.h"
#endif
extern "C" {
void GDAPI godot_net_bind_webrtc_peer_connection(godot_object *p_obj, const godot_net_webrtc_peer_connection *p_impl) {
#ifdef WEBRTC_GDNATIVE_ENABLED
((WebRTCPeerConnectionGDNative *)p_obj)->set_native_webrtc_peer_connection(p_impl);
#endif
}
void GDAPI godot_net_bind_webrtc_data_channel(godot_object *p_obj, const godot_net_webrtc_data_channel *p_impl) {
#ifdef WEBRTC_GDNATIVE_ENABLED
((WebRTCDataChannelGDNative *)p_obj)->set_native_webrtc_data_channel(p_impl);
#endif
}
godot_error GDAPI godot_net_set_webrtc_library(const godot_net_webrtc_library *p_lib) {
#ifdef WEBRTC_GDNATIVE_ENABLED
return (godot_error)WebRTCPeerConnectionGDNative::set_default_library(p_lib);
#else
return (godot_error)ERR_UNAVAILABLE;
#endif
}
}

View File

@ -1,9 +1,11 @@
#!/usr/bin/env python
import os
Import("env")
Import("env_modules")
env_vsdecoder_gdnative = env_modules.Clone()
env_vsdecoder_gdnative.Prepend(CPPPATH=["#modules/gdnative/include/"])
env_vsdecoder_gdnative.Prepend(CPPPATH=[os.path.normpath(os.path.abspath("../include/"))])
env_vsdecoder_gdnative.add_source_files(env.modules_sources, "*.cpp")