diff options
Diffstat (limited to 'modules')
204 files changed, 615 insertions, 626 deletions
diff --git a/modules/assimp/editor_scene_importer_assimp.h b/modules/assimp/editor_scene_importer_assimp.h index 7be80c4ad0..80bba6ad66 100644 --- a/modules/assimp/editor_scene_importer_assimp.h +++ b/modules/assimp/editor_scene_importer_assimp.h @@ -32,9 +32,9 @@ #define EDITOR_SCENE_IMPORTER_ASSIMP_H #ifdef TOOLS_ENABLED -#include "core/bind/core_bind.h" +#include "core/core_bind.h" #include "core/io/resource_importer.h" -#include "core/vector.h" +#include "core/templates/vector.h" #include "editor/import/resource_importer_scene.h" #include "editor/project_settings_editor.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/modules/assimp/import_state.h b/modules/assimp/import_state.h index ee22800ac4..a1cce6968b 100644 --- a/modules/assimp/import_state.h +++ b/modules/assimp/import_state.h @@ -31,9 +31,9 @@ #ifndef EDITOR_SCENE_IMPORT_STATE_H #define EDITOR_SCENE_IMPORT_STATE_H -#include "core/bind/core_bind.h" +#include "core/core_bind.h" #include "core/io/resource_importer.h" -#include "core/vector.h" +#include "core/templates/vector.h" #include "editor/import/resource_importer_scene.h" #include "editor/project_settings_editor.h" #include "scene/3d/mesh_instance_3d.h" diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index 757afeb9e3..b08970d110 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -30,6 +30,8 @@ #include "image_loader_bmp.h" +#include "core/io/file_access_memory.h" + Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const uint8_t *p_color_buffer, @@ -293,9 +295,21 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, return err; } -void ImageLoaderBMP::get_recognized_extensions( - List<String> *p_extensions) const { +void ImageLoaderBMP::get_recognized_extensions(List<String> *p_extensions) const { p_extensions->push_back("bmp"); } -ImageLoaderBMP::ImageLoaderBMP() {} +static Ref<Image> _bmp_mem_loader_func(const uint8_t *p_bmp, int p_size) { + FileAccessMemory memfile; + Error open_memfile_error = memfile.open_custom(p_bmp, p_size); + ERR_FAIL_COND_V_MSG(open_memfile_error, Ref<Image>(), "Could not create memfile for BMP image buffer."); + Ref<Image> img; + img.instance(); + Error load_error = ImageLoaderBMP().load_image(img, &memfile, false, 1.0f); + ERR_FAIL_COND_V_MSG(load_error, Ref<Image>(), "Failed to load BMP image."); + return img; +} + +ImageLoaderBMP::ImageLoaderBMP() { + Image::_bmp_mem_loader_func = _bmp_mem_loader_func; +} diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h index c0bcc858fe..152fd785c0 100644 --- a/modules/bullet/area_bullet.h +++ b/modules/bullet/area_bullet.h @@ -32,7 +32,7 @@ #define AREABULLET_H #include "collision_object_bullet.h" -#include "core/vector.h" +#include "core/templates/vector.h" #include "servers/physics_server_3d.h" #include "space_bullet.h" diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 8f64c11867..f7290666ad 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -32,9 +32,9 @@ #include "bullet_utilities.h" #include "cone_twist_joint_bullet.h" -#include "core/class_db.h" -#include "core/error_macros.h" -#include "core/ustring.h" +#include "core/error/error_macros.h" +#include "core/object/class_db.h" +#include "core/string/ustring.h" #include "generic_6dof_joint_bullet.h" #include "hinge_joint_bullet.h" #include "pin_joint_bullet.h" diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h index 6078babaf8..02ba5458d8 100644 --- a/modules/bullet/bullet_physics_server.h +++ b/modules/bullet/bullet_physics_server.h @@ -32,8 +32,8 @@ #define BULLET_PHYSICS_SERVER_H #include "area_bullet.h" -#include "core/rid.h" -#include "core/rid_owner.h" +#include "core/templates/rid.h" +#include "core/templates/rid_owner.h" #include "joint_bullet.h" #include "rigid_body_bullet.h" #include "servers/physics_server_3d.h" diff --git a/modules/bullet/collision_object_bullet.h b/modules/bullet/collision_object_bullet.h index 36b3a9550c..e2d05f2c38 100644 --- a/modules/bullet/collision_object_bullet.h +++ b/modules/bullet/collision_object_bullet.h @@ -31,10 +31,10 @@ #ifndef COLLISION_OBJECT_BULLET_H #define COLLISION_OBJECT_BULLET_H -#include "core/class_db.h" #include "core/math/transform.h" #include "core/math/vector3.h" -#include "core/vset.h" +#include "core/object/class_db.h" +#include "core/templates/vset.h" #include "shape_owner_bullet.h" #include <LinearMath/btTransform.h> diff --git a/modules/bullet/godot_collision_dispatcher.h b/modules/bullet/godot_collision_dispatcher.h index 5a96268ee9..13e7255abf 100644 --- a/modules/bullet/godot_collision_dispatcher.h +++ b/modules/bullet/godot_collision_dispatcher.h @@ -31,7 +31,7 @@ #ifndef GODOT_COLLISION_DISPATCHER_H #define GODOT_COLLISION_DISPATCHER_H -#include "core/int_types.h" +#include <cstdint> #include <btBulletDynamicsCommon.h> diff --git a/modules/bullet/register_types.cpp b/modules/bullet/register_types.cpp index 009d0dff63..d29b699ecd 100644 --- a/modules/bullet/register_types.cpp +++ b/modules/bullet/register_types.cpp @@ -31,8 +31,8 @@ #include "register_types.h" #include "bullet_physics_server.h" -#include "core/class_db.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" +#include "core/object/class_db.h" /** @author AndreaCatania diff --git a/modules/bullet/rid_bullet.h b/modules/bullet/rid_bullet.h index 3551ca05f9..0db09b2b78 100644 --- a/modules/bullet/rid_bullet.h +++ b/modules/bullet/rid_bullet.h @@ -31,7 +31,7 @@ #ifndef RID_BULLET_H #define RID_BULLET_H -#include "core/rid.h" +#include "core/templates/rid.h" /** @author AndreaCatania diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index fdc2944dad..c7b761e92a 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -34,7 +34,7 @@ #include "bullet_physics_server.h" #include "bullet_types_converter.h" #include "bullet_utilities.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "shape_owner_bullet.h" #include <BulletCollision/CollisionDispatch/btInternalEdgeUtility.h> diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h index a35a1d8a18..1c29dc1b1f 100644 --- a/modules/bullet/shape_bullet.h +++ b/modules/bullet/shape_bullet.h @@ -32,7 +32,7 @@ #define SHAPE_BULLET_H #include "core/math/geometry_3d.h" -#include "core/variant.h" +#include "core/variant/variant.h" #include "rid_bullet.h" #include "servers/physics_server_3d.h" diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index c581d1804e..abad1beacb 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -34,8 +34,8 @@ #include "bullet_types_converter.h" #include "bullet_utilities.h" #include "constraint_bullet.h" -#include "core/project_settings.h" -#include "core/ustring.h" +#include "core/config/project_settings.h" +#include "core/string/ustring.h" #include "godot_collision_configuration.h" #include "godot_collision_dispatcher.h" #include "rigid_body_bullet.h" diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h index de281064af..e362f27d39 100644 --- a/modules/bullet/space_bullet.h +++ b/modules/bullet/space_bullet.h @@ -31,8 +31,8 @@ #ifndef SPACE_BULLET_H #define SPACE_BULLET_H -#include "core/variant.h" -#include "core/vector.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" #include "godot_result_callbacks.h" #include "rid_bullet.h" #include "servers/physics_server_3d.h" diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index 47982d519a..04e1c4de35 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -32,7 +32,7 @@ #include "core/math/geometry_2d.h" #include "core/math/math_funcs.h" -#include "core/sort_array.h" +#include "core/templates/sort_array.h" // Static helper functions. diff --git a/modules/csg/csg.h b/modules/csg/csg.h index 34ee239c17..ef1103e1ac 100644 --- a/modules/csg/csg.h +++ b/modules/csg/csg.h @@ -31,16 +31,16 @@ #ifndef CSG_H #define CSG_H -#include "core/list.h" -#include "core/map.h" #include "core/math/aabb.h" #include "core/math/plane.h" #include "core/math/transform.h" #include "core/math/vector2.h" #include "core/math/vector3.h" -#include "core/oa_hash_map.h" -#include "core/reference.h" -#include "core/vector.h" +#include "core/object/reference.h" +#include "core/templates/list.h" +#include "core/templates/map.h" +#include "core/templates/oa_hash_map.h" +#include "core/templates/vector.h" #include "scene/resources/material.h" struct CSGBrush { diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp index 2a4f836478..5d97164dbf 100644 --- a/modules/cvtt/image_compress_cvtt.cpp +++ b/modules/cvtt/image_compress_cvtt.cpp @@ -32,7 +32,7 @@ #include "core/os/os.h" #include "core/os/thread.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include <ConvectionKernels.h> diff --git a/modules/cvtt/image_compress_cvtt.h b/modules/cvtt/image_compress_cvtt.h index c1772199af..483fb876a6 100644 --- a/modules/cvtt/image_compress_cvtt.h +++ b/modules/cvtt/image_compress_cvtt.h @@ -31,7 +31,7 @@ #ifndef IMAGE_COMPRESS_CVTT_H #define IMAGE_COMPRESS_CVTT_H -#include "core/image.h" +#include "core/io/image.h" void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChannels p_channels); void image_decompress_cvtt(Image *p_image); diff --git a/modules/denoise/lightmap_denoiser.h b/modules/denoise/lightmap_denoiser.h index 74a9d8af86..f4e4335d9b 100644 --- a/modules/denoise/lightmap_denoiser.h +++ b/modules/denoise/lightmap_denoiser.h @@ -31,7 +31,7 @@ #ifndef LIGHTMAP_DENOISER_H #define LIGHTMAP_DENOISER_H -#include "core/class_db.h" +#include "core/object/class_db.h" #include "scene/3d/lightmapper.h" struct OIDNDeviceImpl; diff --git a/modules/denoise/register_types.cpp b/modules/denoise/register_types.cpp index b78734a531..552495ed87 100644 --- a/modules/denoise/register_types.cpp +++ b/modules/denoise/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "lightmap_denoiser.h" void register_denoise_types() { diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp index 18051f756a..2683f3155b 100644 --- a/modules/enet/register_types.cpp +++ b/modules/enet/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "core/error_macros.h" +#include "core/error/error_macros.h" #include "networked_multiplayer_enet.h" static bool enet_ok = false; diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index d1ba3dc355..6cac2458f9 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -31,10 +31,10 @@ #include "image_etc.h" #include "Etc.h" #include "EtcFilter.h" -#include "core/image.h" +#include "core/io/image.h" #include "core/os/copymem.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" static Image::Format _get_etc2_mode(Image::UsedChannels format) { switch (format) { diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index bb2da70c3a..f397ee96c5 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -30,11 +30,11 @@ #include "gdnative.h" -#include "core/global_constants.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" #include "core/io/file_access_encrypted.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/main/scene_tree.h" diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index 6d26c2141d..bba2c04a2a 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -31,10 +31,10 @@ #ifndef GDNATIVE_H #define GDNATIVE_H +#include "core/io/resource.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/os/thread_safe.h" -#include "core/resource.h" #include "gdnative/gdnative.h" #include "gdnative_api_struct.gen.h" diff --git a/modules/gdnative/gdnative/aabb.cpp b/modules/gdnative/gdnative/aabb.cpp index d5970e8004..dc1b79b9e5 100644 --- a/modules/gdnative/gdnative/aabb.cpp +++ b/modules/gdnative/gdnative/aabb.cpp @@ -31,7 +31,7 @@ #include "gdnative/aabb.h" #include "core/math/aabb.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 59953f5182..a5567f1e6b 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -30,12 +30,12 @@ #include "gdnative/array.h" -#include "core/array.h" #include "core/os/memory.h" +#include "core/variant/array.h" -#include "core/color.h" +#include "core/math/color.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 990fd3795d..e5891562a1 100644 --- a/modules/gdnative/gdnative/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -31,7 +31,7 @@ #include "gdnative/basis.h" #include "core/math/basis.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/callable.cpp b/modules/gdnative/gdnative/callable.cpp index 868b324227..f200e9f171 100644 --- a/modules/gdnative/gdnative/callable.cpp +++ b/modules/gdnative/gdnative/callable.cpp @@ -30,9 +30,9 @@ #include "gdnative/callable.h" -#include "core/callable.h" -#include "core/resource.h" -#include "core/variant.h" +#include "core/io/resource.h" +#include "core/variant/callable.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/color.cpp b/modules/gdnative/gdnative/color.cpp index c75e74daba..a93181e142 100644 --- a/modules/gdnative/gdnative/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -30,8 +30,8 @@ #include "gdnative/color.h" -#include "core/color.h" -#include "core/variant.h" +#include "core/math/color.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { @@ -148,13 +148,6 @@ godot_color GDAPI godot_color_inverted(const godot_color *p_self) { return dest; } -godot_color GDAPI godot_color_contrasted(const godot_color *p_self) { - godot_color dest; - const Color *self = (const Color *)p_self; - *((Color *)&dest) = self->contrasted(); - return dest; -} - godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) { godot_color dest; const Color *self = (const Color *)p_self; diff --git a/modules/gdnative/gdnative/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index a126974815..b6900b28bb 100644 --- a/modules/gdnative/gdnative/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -30,10 +30,10 @@ #include "gdnative/dictionary.h" -#include "core/variant.h" -// core/variant.h before to avoid compile errors with MSVC -#include "core/dictionary.h" +#include "core/variant/variant.h" +// core/variant/variant.h before to avoid compile errors with MSVC #include "core/io/json.h" +#include "core/variant/dictionary.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index e94190b07b..4142ea892b 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -30,12 +30,12 @@ #include "gdnative/gdnative.h" -#include "core/class_db.h" -#include "core/engine.h" -#include "core/error_macros.h" -#include "core/global_constants.h" +#include "core/config/engine.h" +#include "core/core_constants.h" +#include "core/error/error_macros.h" +#include "core/object/class_db.h" #include "core/os/os.h" -#include "core/variant.h" +#include "core/variant/variant.h" #include "modules/gdnative/gdnative.h" @@ -101,10 +101,10 @@ 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(); + const int constants_count = CoreConstants::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); + const char *name = CoreConstants::get_global_constant_name(i); + int value = CoreConstants::get_global_constant_value(i); (*p_constants)[name] = value; } return constants; diff --git a/modules/gdnative/gdnative/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 88ed650ebe..c031498612 100644 --- a/modules/gdnative/gdnative/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -30,8 +30,8 @@ #include "gdnative/node_path.h" -#include "core/node_path.h" -#include "core/variant.h" +#include "core/string/node_path.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/packed_arrays.cpp b/modules/gdnative/gdnative/packed_arrays.cpp index de93c1d9b3..9139fd89a1 100644 --- a/modules/gdnative/gdnative/packed_arrays.cpp +++ b/modules/gdnative/gdnative/packed_arrays.cpp @@ -30,11 +30,11 @@ #include "gdnative/packed_arrays.h" -#include "core/array.h" +#include "core/variant/array.h" -#include "core/variant.h" +#include "core/variant/variant.h" -#include "core/color.h" +#include "core/math/color.h" #include "core/math/vector2.h" #include "core/math/vector3.h" diff --git a/modules/gdnative/gdnative/plane.cpp b/modules/gdnative/gdnative/plane.cpp index d4ed8d00f4..99fb5ff10a 100644 --- a/modules/gdnative/gdnative/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -31,7 +31,7 @@ #include "gdnative/plane.h" #include "core/math/plane.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/quat.cpp b/modules/gdnative/gdnative/quat.cpp index de6308ad2a..a41886e780 100644 --- a/modules/gdnative/gdnative/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -31,7 +31,7 @@ #include "gdnative/quat.h" #include "core/math/quat.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index 516f4d75ce..bacefced5d 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -31,7 +31,7 @@ #include "gdnative/rect2.h" #include "core/math/transform_2d.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/rid.cpp b/modules/gdnative/gdnative/rid.cpp index d7a63f33a7..24af04558b 100644 --- a/modules/gdnative/gdnative/rid.cpp +++ b/modules/gdnative/gdnative/rid.cpp @@ -30,9 +30,9 @@ #include "gdnative/rid.h" -#include "core/resource.h" -#include "core/rid.h" -#include "core/variant.h" +#include "core/io/resource.h" +#include "core/templates/rid.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 1fa19f4ff5..47c7f7b6e7 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -30,9 +30,9 @@ #include "gdnative/string.h" -#include "core/string_name.h" -#include "core/ustring.h" -#include "core/variant.h" +#include "core/string/string_name.h" +#include "core/string/ustring.h" +#include "core/variant/variant.h" #include <string.h> diff --git a/modules/gdnative/gdnative/string_name.cpp b/modules/gdnative/gdnative/string_name.cpp index 7bbaaeeaa0..a840d74e18 100644 --- a/modules/gdnative/gdnative/string_name.cpp +++ b/modules/gdnative/gdnative/string_name.cpp @@ -30,8 +30,8 @@ #include "gdnative/string_name.h" -#include "core/string_name.h" -#include "core/ustring.h" +#include "core/string/string_name.h" +#include "core/string/ustring.h" #include <string.h> diff --git a/modules/gdnative/gdnative/transform.cpp b/modules/gdnative/gdnative/transform.cpp index d19de93e9b..b17d6f8d4c 100644 --- a/modules/gdnative/gdnative/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -31,7 +31,7 @@ #include "gdnative/transform.h" #include "core/math/transform.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/transform2d.cpp b/modules/gdnative/gdnative/transform2d.cpp index c0f7878eb0..3c1105e323 100644 --- a/modules/gdnative/gdnative/transform2d.cpp +++ b/modules/gdnative/gdnative/transform2d.cpp @@ -31,7 +31,7 @@ #include "gdnative/transform2d.h" #include "core/math/transform_2d.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index dac4feb0e5..8e30eaae4d 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -30,8 +30,8 @@ #include "gdnative/variant.h" -#include "core/reference.h" -#include "core/variant.h" +#include "core/object/reference.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 1ee716df86..1ba846d315 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -31,7 +31,7 @@ #include "gdnative/vector2.h" #include "core/math/vector2.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 32cad30c17..3284afdc31 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -30,8 +30,8 @@ #include "gdnative/vector3.h" -#include "core/variant.h" -#include "core/vector.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" #ifdef __cplusplus extern "C" { diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 82bfbd23de..40d0f75871 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -1255,13 +1255,6 @@ ] }, { - "name": "godot_color_contrasted", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { "name": "godot_color_lerp", "return_type": "godot_color", "arguments": [ diff --git a/modules/gdnative/include/gdnative/color.h b/modules/gdnative/include/gdnative/color.h index e7737bf8e1..e64097ef57 100644 --- a/modules/gdnative/include/gdnative/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -93,8 +93,6 @@ godot_int GDAPI godot_color_to_argb32(const godot_color *p_self); godot_color GDAPI godot_color_inverted(const godot_color *p_self); -godot_color GDAPI godot_color_contrasted(const godot_color *p_self); - godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over); diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 8dbaec4e75..6f2f9bfea9 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -32,11 +32,11 @@ #ifdef TOOLS_ENABLED -#include "core/class_db.h" -#include "core/engine.h" -#include "core/global_constants.h" +#include "core/config/engine.h" +#include "core/core_constants.h" +#include "core/object/class_db.h" #include "core/os/file_access.h" -#include "core/pair.h" +#include "core/templates/pair.h" // helper stuff @@ -173,19 +173,19 @@ List<ClassAPI> generate_c_api_classes() { ClassDB::get_class_list(&classes); classes.sort_custom<StringName::AlphCompare>(); - // Register global constants as a fake GlobalConstants singleton class + // Register global constants as a fake CoreConstants singleton class { ClassAPI global_constants_api; - global_constants_api.class_name = "GlobalConstants"; + global_constants_api.class_name = "CoreConstants"; global_constants_api.api_type = ClassDB::API_CORE; global_constants_api.is_singleton = true; - global_constants_api.singleton_name = "GlobalConstants"; + global_constants_api.singleton_name = "CoreConstants"; global_constants_api.is_instanciable = false; - const int constants_count = GlobalConstants::get_global_constant_count(); + const int constants_count = CoreConstants::get_global_constant_count(); for (int i = 0; i < constants_count; ++i) { ConstantAPI constant_api; - constant_api.constant_name = GlobalConstants::get_global_constant_name(i); - constant_api.constant_value = GlobalConstants::get_global_constant_value(i); + constant_api.constant_name = CoreConstants::get_global_constant_name(i); + constant_api.constant_value = CoreConstants::get_global_constant_value(i); global_constants_api.constants.push_back(constant_api); } global_constants_api.constants.sort_custom<ConstantAPIComparator>(); diff --git a/modules/gdnative/nativescript/api_generator.h b/modules/gdnative/nativescript/api_generator.h index edbb1d1f23..8555af5215 100644 --- a/modules/gdnative/nativescript/api_generator.h +++ b/modules/gdnative/nativescript/api_generator.h @@ -31,8 +31,8 @@ #ifndef API_GENERATOR_H #define API_GENERATOR_H +#include "core/string/ustring.h" #include "core/typedefs.h" -#include "core/ustring.h" Error generate_c_api(const String &p_path); diff --git a/modules/gdnative/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp index e47548f3e9..411acbe1ad 100644 --- a/modules/gdnative/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -30,11 +30,11 @@ #include "nativescript/godot_nativescript.h" -#include "core/class_db.h" -#include "core/error_macros.h" -#include "core/global_constants.h" -#include "core/project_settings.h" -#include "core/variant.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" +#include "core/error/error_macros.h" +#include "core/object/class_db.h" +#include "core/variant/variant.h" #include "gdnative/gdnative.h" #include <stdint.h> diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 632f4e5fee..0939cfd06a 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -34,12 +34,12 @@ #include "gdnative/gdnative.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" #include "core/core_string_names.h" -#include "core/global_constants.h" #include "core/io/file_access_encrypted.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/main/scene_tree.h" #include "scene/resources/resource_format_text.h" diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 145bf7dcb6..2aaa4be325 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -31,15 +31,15 @@ #ifndef NATIVE_SCRIPT_H #define NATIVE_SCRIPT_H +#include "core/io/resource.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/oa_hash_map.h" -#include "core/ordered_hash_map.h" +#include "core/object/script_language.h" #include "core/os/mutex.h" #include "core/os/thread_safe.h" -#include "core/resource.h" -#include "core/script_language.h" -#include "core/self_list.h" +#include "core/templates/oa_hash_map.h" +#include "core/templates/ordered_hash_map.h" +#include "core/templates/self_list.h" #include "scene/main/node.h" #include "modules/gdnative/gdnative.h" diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp index 7d17a7d5ab..0942fb40a8 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.cpp +++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp @@ -32,7 +32,7 @@ // Godot imports #include "core/os/os.h" -#include "core/variant.h" +#include "core/variant/variant.h" // PluginScript imports #include "pluginscript_language.h" diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h index 690d1a0432..76ff9f7097 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.h +++ b/modules/gdnative/pluginscript/pluginscript_instance.h @@ -32,7 +32,7 @@ #define PLUGINSCRIPT_INSTANCE_H // Godot imports -#include "core/script_language.h" +#include "core/object/script_language.h" // PluginScript imports #include <pluginscript/godot_pluginscript.h> diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index bccbe95033..fc9c4ebd77 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -29,9 +29,9 @@ /*************************************************************************/ // Godot imports +#include "core/config/project_settings.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" // PluginScript imports #include "pluginscript_language.h" #include "pluginscript_script.h" diff --git a/modules/gdnative/pluginscript/pluginscript_language.h b/modules/gdnative/pluginscript/pluginscript_language.h index dd6758713f..53e1e3ae9b 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.h +++ b/modules/gdnative/pluginscript/pluginscript_language.h @@ -34,9 +34,9 @@ // Godot imports #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/map.h" -#include "core/script_language.h" -#include "core/self_list.h" +#include "core/object/script_language.h" +#include "core/templates/map.h" +#include "core/templates/self_list.h" // PluginScript imports #include "pluginscript_loader.h" #include <pluginscript/godot_pluginscript.h> diff --git a/modules/gdnative/pluginscript/pluginscript_loader.h b/modules/gdnative/pluginscript/pluginscript_loader.h index 35fc79c2ca..7d80f4c733 100644 --- a/modules/gdnative/pluginscript/pluginscript_loader.h +++ b/modules/gdnative/pluginscript/pluginscript_loader.h @@ -34,7 +34,7 @@ // Godot imports #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/script_language.h" +#include "core/object/script_language.h" class PluginScriptLanguage; diff --git a/modules/gdnative/pluginscript/pluginscript_script.h b/modules/gdnative/pluginscript/pluginscript_script.h index 9cd38cd4b4..150de05e74 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.h +++ b/modules/gdnative/pluginscript/pluginscript_script.h @@ -32,7 +32,7 @@ #define PLUGINSCRIPT_SCRIPT_H // Godot imports -#include "core/script_language.h" +#include "core/object/script_language.h" // PluginScript imports #include "pluginscript_language.h" #include <pluginscript/godot_pluginscript.h> diff --git a/modules/gdnative/pluginscript/register_types.cpp b/modules/gdnative/pluginscript/register_types.cpp index 97a48b0e89..b354c23a9e 100644 --- a/modules/gdnative/pluginscript/register_types.cpp +++ b/modules/gdnative/pluginscript/register_types.cpp @@ -30,11 +30,11 @@ #include "register_types.h" +#include "core/config/project_settings.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/os/dir_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/main/scene_tree.h" #include "pluginscript_language.h" diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 3a2d0b09a3..b88bf58256 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -40,11 +40,11 @@ #include "videodecoder/register_types.h" #include "xr/register_types.h" -#include "core/engine.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/os/os.h" -#include "core/project_settings.h" #ifdef TOOLS_ENABLED #include "editor/editor_export.h" diff --git a/modules/gdnative/videodecoder/register_types.cpp b/modules/gdnative/videodecoder/register_types.cpp index 4181d8813f..8ee1c8d183 100644 --- a/modules/gdnative/videodecoder/register_types.cpp +++ b/modules/gdnative/videodecoder/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/class_db.h" +#include "core/object/class_db.h" #include "video_stream_gdnative.h" static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative; diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index fe7c10cad9..61e882f2fe 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -30,7 +30,7 @@ #include "video_stream_gdnative.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "servers/audio_server.h" VideoDecoderServer *VideoDecoderServer::instance = nullptr; diff --git a/modules/gdnavigation/gd_navigation_server.h b/modules/gdnavigation/gd_navigation_server.h index e3e02f3d7c..c00d60ced7 100644 --- a/modules/gdnavigation/gd_navigation_server.h +++ b/modules/gdnavigation/gd_navigation_server.h @@ -31,8 +31,8 @@ #ifndef GD_NAVIGATION_SERVER_H #define GD_NAVIGATION_SERVER_H -#include "core/rid.h" -#include "core/rid_owner.h" +#include "core/templates/rid.h" +#include "core/templates/rid_owner.h" #include "servers/navigation_server_3d.h" #include "nav_map.h" diff --git a/modules/gdnavigation/nav_rid.h b/modules/gdnavigation/nav_rid.h index c119ecc5e0..b727fceb04 100644 --- a/modules/gdnavigation/nav_rid.h +++ b/modules/gdnavigation/nav_rid.h @@ -31,7 +31,7 @@ #ifndef NAV_RID_H #define NAV_RID_H -#include "core/rid.h" +#include "core/templates/rid.h" /** @author AndreaCatania diff --git a/modules/gdnavigation/register_types.cpp b/modules/gdnavigation/register_types.cpp index 088b26bf17..1ae19ebe47 100644 --- a/modules/gdnavigation/register_types.cpp +++ b/modules/gdnavigation/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "gd_navigation_server.h" #include "servers/navigation_server_3d.h" diff --git a/modules/gdnavigation/rvo_agent.h b/modules/gdnavigation/rvo_agent.h index 1ad9d3ed76..de36508edb 100644 --- a/modules/gdnavigation/rvo_agent.h +++ b/modules/gdnavigation/rvo_agent.h @@ -31,7 +31,7 @@ #ifndef RVO_AGENT_H #define RVO_AGENT_H -#include "core/class_db.h" +#include "core/object/class_db.h" #include "nav_rid.h" #include <Agent.h> diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index e170667a30..60051499a5 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -386,24 +386,6 @@ [/codeblock] </description> </method> - <method name="funcref"> - <return type="FuncRef"> - </return> - <argument index="0" name="instance" type="Object"> - </argument> - <argument index="1" name="funcname" type="String"> - </argument> - <description> - Returns a reference to the specified function [code]funcname[/code] in the [code]instance[/code] node. As functions aren't first-class objects in GDscript, use [code]funcref[/code] to store a [FuncRef] in a variable and call it later. - [codeblock] - func foo(): - return("bar") - - a = funcref(self, "foo") - print(a.call_func()) # Prints bar - [/codeblock] - </description> - </method> <method name="get_stack"> <return type="Array"> </return> @@ -921,20 +903,6 @@ [/codeblock] </description> </method> - <method name="rand_range"> - <return type="float"> - </return> - <argument index="0" name="from" type="float"> - </argument> - <argument index="1" name="to" type="float"> - </argument> - <description> - Random range, any floating point value between [code]from[/code] and [code]to[/code]. - [codeblock] - prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 - [/codeblock] - </description> - </method> <method name="rand_seed"> <return type="Array"> </return> @@ -954,6 +922,20 @@ [/codeblock] </description> </method> + <method name="randf_range"> + <return type="float"> + </return> + <argument index="0" name="from" type="float"> + </argument> + <argument index="1" name="to" type="float"> + </argument> + <description> + Random range, any floating point value between [code]from[/code] and [code]to[/code]. + [codeblock] + prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 + [/codeblock] + </description> + </method> <method name="randi"> <return type="int"> </return> @@ -967,6 +949,21 @@ [/codeblock] </description> </method> + <method name="randi_range"> + <return type="int"> + </return> + <argument index="0" name="from" type="int"> + </argument> + <argument index="1" name="to" type="int"> + </argument> + <description> + Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped. + [codeblock] + print(randi_range(0, 1)) # Prints 0 or 1 + print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 + [/codeblock] + </description> + </method> <method name="randomize"> <return type="void"> </return> diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h index 5ea416d4cc..d763df01f5 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h @@ -31,7 +31,7 @@ #ifndef GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H #define GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H -#include "core/set.h" +#include "core/templates/set.h" #include "editor/editor_translation_parser.h" #include "modules/gdscript/gdscript_parser.h" #include "modules/regex/regex.h" diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e70e3f7272..53602f7a9b 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -32,13 +32,13 @@ #include <stdint.h> +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" #include "core/core_string_names.h" -#include "core/engine.h" -#include "core/global_constants.h" #include "core/io/file_access_encrypted.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "gdscript_analyzer.h" #include "gdscript_cache.h" #include "gdscript_compiler.h" @@ -1092,7 +1092,8 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) { // Try conversion Callable::CallError ce; const Variant *value = &p_value; - Variant converted = Variant::construct(member->data_type.builtin_type, &value, 1, ce); + Variant converted; + Variant::construct(member->data_type.builtin_type, converted, &value, 1, ce); if (ce.error == Callable::CallError::CALL_OK) { members.write[member->index] = converted; return true; @@ -1500,9 +1501,9 @@ void GDScriptLanguage::remove_named_global_constant(const StringName &p_name) { void GDScriptLanguage::init() { //populate global constants - int gcc = GlobalConstants::get_global_constant_count(); + int gcc = CoreConstants::get_global_constant_count(); for (int i = 0; i < gcc; i++) { - _add_global(StaticCString::create(GlobalConstants::get_global_constant_name(i)), GlobalConstants::get_global_constant_value(i)); + _add_global(StaticCString::create(CoreConstants::get_global_constant_name(i)), CoreConstants::get_global_constant_value(i)); } _add_global(StaticCString::create("PI"), Math_PI); diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 79317ff846..b69a6e39c0 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -35,7 +35,7 @@ #include "core/debugger/script_debugger.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/script_language.h" +#include "core/object/script_language.h" #include "gdscript_function.h" class GDScriptNativeClass : public Reference { diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index ab4edb04b9..6b23ab1616 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -30,12 +30,12 @@ #include "gdscript_analyzer.h" -#include "core/class_db.h" -#include "core/hash_map.h" +#include "core/config/project_settings.h" #include "core/io/resource_loader.h" +#include "core/object/class_db.h" +#include "core/object/script_language.h" #include "core/os/file_access.h" -#include "core/project_settings.h" -#include "core/script_language.h" +#include "core/templates/hash_map.h" #include "gdscript.h" // TODO: Move this to a central location (maybe core?). @@ -1711,7 +1711,8 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool is_awa } Callable::CallError err; - Variant value = Variant::construct(builtin_type, (const Variant **)args.ptr(), args.size(), err); + Variant value; + Variant::construct(builtin_type, value, (const Variant **)args.ptr(), args.size(), err); switch (err.error) { case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: @@ -2075,7 +2076,8 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod } default: { Callable::CallError temp; - Variant dummy = Variant::construct(base.builtin_type, nullptr, 0, temp); + Variant dummy; + Variant::construct(base.builtin_type, dummy, nullptr, 0, temp); List<PropertyInfo> properties; dummy.get_property_list(&properties); for (const List<PropertyInfo>::Element *E = properties.front(); E != nullptr; E = E->next()) { @@ -2438,7 +2440,7 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri if (p_subscript->base->is_constant) { // Just try to get it. bool valid = false; - Variant value = p_subscript->base->reduced_value.get_named(p_subscript->attribute->name, &valid); + Variant value = p_subscript->base->reduced_value.get_named(p_subscript->attribute->name, valid); if (!valid) { push_error(vformat(R"(Cannot get member "%s" from "%s".)", p_subscript->attribute->name, p_subscript->base->reduced_value), p_subscript->index); } else { @@ -2539,7 +2541,7 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::STRING; break; // Don't support indexing, but we will check it later. - case Variant::_RID: + case Variant::RID: case Variant::BOOL: case Variant::CALLABLE: case Variant::FLOAT: @@ -2572,7 +2574,7 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri switch (base_type.builtin_type) { // Can't index at all. - case Variant::_RID: + case Variant::RID: case Variant::BOOL: case Variant::CALLABLE: case Variant::FLOAT: @@ -2869,7 +2871,8 @@ bool GDScriptAnalyzer::get_function_signature(GDScriptParser::Node *p_source, GD if (p_base_type.kind == GDScriptParser::DataType::BUILTIN) { // Construct a base type to get methods. Callable::CallError err; - Variant dummy = Variant::construct(p_base_type.builtin_type, nullptr, 0, err); + Variant dummy; + Variant::construct(p_base_type.builtin_type, dummy, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { ERR_FAIL_V_MSG(false, "Could not construct base Variant type."); } @@ -3095,7 +3098,7 @@ GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator a = a_ref; } else { Callable::CallError err; - a = Variant::construct(a_type, nullptr, 0, err); + Variant::construct(a_type, a, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { r_valid = false; ERR_FAIL_V_MSG(result, vformat("Could not construct value of type %s", Variant::get_type_name(a_type))); @@ -3108,7 +3111,7 @@ GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator b = b_ref; } else { Callable::CallError err; - b = Variant::construct(b_type, nullptr, 0, err); + Variant::construct(b_type, b, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { r_valid = false; ERR_FAIL_V_MSG(result, vformat("Could not construct value of type %s", Variant::get_type_name(b_type))); diff --git a/modules/gdscript/gdscript_analyzer.h b/modules/gdscript/gdscript_analyzer.h index f3cbb320b7..0a952cc621 100644 --- a/modules/gdscript/gdscript_analyzer.h +++ b/modules/gdscript/gdscript_analyzer.h @@ -31,9 +31,9 @@ #ifndef GDSCRIPT_ANALYZER_H #define GDSCRIPT_ANALYZER_H -#include "core/object.h" -#include "core/reference.h" -#include "core/set.h" +#include "core/object/object.h" +#include "core/object/reference.h" +#include "core/templates/set.h" #include "gdscript_cache.h" #include "gdscript_parser.h" diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 57b95f5b21..95d24a8b08 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -31,7 +31,7 @@ #include "gdscript_cache.h" #include "core/os/file_access.h" -#include "core/vector.h" +#include "core/templates/vector.h" #include "gdscript.h" #include "gdscript_analyzer.h" #include "gdscript_parser.h" diff --git a/modules/gdscript/gdscript_cache.h b/modules/gdscript/gdscript_cache.h index 865df34051..90c5884985 100644 --- a/modules/gdscript/gdscript_cache.h +++ b/modules/gdscript/gdscript_cache.h @@ -31,10 +31,10 @@ #ifndef GDSCRIPT_CACHE_H #define GDSCRIPT_CACHE_H -#include "core/hash_map.h" +#include "core/object/reference.h" #include "core/os/mutex.h" -#include "core/reference.h" -#include "core/set.h" +#include "core/templates/hash_map.h" +#include "core/templates/set.h" #include "gdscript.h" class GDScriptAnalyzer; diff --git a/modules/gdscript/gdscript_codegen.h b/modules/gdscript/gdscript_codegen.h index 31e1e6ba23..9872a61423 100644 --- a/modules/gdscript/gdscript_codegen.h +++ b/modules/gdscript/gdscript_codegen.h @@ -32,8 +32,8 @@ #define GDSCRIPT_CODEGEN #include "core/io/multiplayer_api.h" -#include "core/string_name.h" -#include "core/variant.h" +#include "core/string/string_name.h" +#include "core/variant/variant.h" #include "gdscript_function.h" #include "gdscript_functions.h" diff --git a/modules/gdscript/gdscript_compiler.h b/modules/gdscript/gdscript_compiler.h index fe34d6cba3..157c801f56 100644 --- a/modules/gdscript/gdscript_compiler.h +++ b/modules/gdscript/gdscript_compiler.h @@ -31,7 +31,7 @@ #ifndef GDSCRIPT_COMPILER_H #define GDSCRIPT_COMPILER_H -#include "core/set.h" +#include "core/templates/set.h" #include "gdscript.h" #include "gdscript_codegen.h" #include "gdscript_function.h" diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index aec05b6771..d0acc14a04 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -30,8 +30,8 @@ #include "gdscript.h" -#include "core/engine.h" -#include "core/global_constants.h" +#include "core/config/engine.h" +#include "core/core_constants.h" #include "core/os/file_access.h" #include "gdscript_analyzer.h" #include "gdscript_compiler.h" @@ -39,7 +39,7 @@ #include "gdscript_tokenizer.h" #ifdef TOOLS_ENABLED -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "editor/editor_file_system.h" #include "editor/editor_settings.h" #endif @@ -383,8 +383,8 @@ void GDScriptLanguage::debug_get_globals(List<String> *p_globals, List<Variant> } bool skip = false; - for (int i = 0; i < GlobalConstants::get_global_constant_count(); i++) { - if (E->key() == GlobalConstants::get_global_constant_name(i)) { + for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) { + if (E->key() == CoreConstants::get_global_constant_name(i)) { skip = true; break; } @@ -973,7 +973,8 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base } break; case GDScriptParser::DataType::BUILTIN: { Callable::CallError err; - Variant tmp = Variant::construct(base_type.builtin_type, nullptr, 0, err); + Variant tmp; + Variant::construct(base_type.builtin_type, tmp, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { return; } @@ -1523,7 +1524,8 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, found = _guess_identifier_type_from_base(c, base, id, r_type); } else if (!found && index.type.kind == GDScriptParser::DataType::BUILTIN) { Callable::CallError err; - Variant base_val = Variant::construct(base.type.builtin_type, nullptr, 0, err); + Variant base_val; + Variant::construct(base.type.builtin_type, base_val, nullptr, 0, err); bool valid = false; Variant res = base_val.get(index.value, &valid); if (valid) { @@ -1560,9 +1562,14 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, Callable::CallError ce; bool v1_use_value = p1.value.get_type() != Variant::NIL && p1.value.get_type() != Variant::OBJECT; - Variant v1 = (v1_use_value) ? p1.value : Variant::construct(p1.type.builtin_type, nullptr, 0, ce); + Variant d1; + Variant::construct(p1.type.builtin_type, d1, nullptr, 0, ce); + Variant d2; + Variant::construct(p2.type.builtin_type, d2, nullptr, 0, ce); + + Variant v1 = (v1_use_value) ? p1.value : d1; bool v2_use_value = p2.value.get_type() != Variant::NIL && p2.value.get_type() != Variant::OBJECT; - Variant v2 = (v2_use_value) ? p2.value : Variant::construct(p2.type.builtin_type, nullptr, 0, ce); + Variant v2 = (v2_use_value) ? p2.value : d2; // avoid potential invalid ops if ((op->variant_op == Variant::OP_DIVIDE || op->variant_op == Variant::OP_MODULE) && v2.get_type() == Variant::INT) { v2 = 1; @@ -1952,7 +1959,8 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & } break; case GDScriptParser::DataType::BUILTIN: { Callable::CallError err; - Variant tmp = Variant::construct(base_type.builtin_type, nullptr, 0, err); + Variant tmp; + Variant::construct(base_type.builtin_type, tmp, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { return false; @@ -2102,7 +2110,8 @@ static bool _guess_method_return_type_from_base(GDScriptParser::CompletionContex } break; case GDScriptParser::DataType::BUILTIN: { Callable::CallError err; - Variant tmp = Variant::construct(base_type.builtin_type, nullptr, 0, err); + Variant tmp; + Variant::construct(base_type.builtin_type, tmp, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { return false; } @@ -2139,9 +2148,9 @@ static void _find_enumeration_candidates(GDScriptParser::CompletionContext &p_co r_result.insert(option.display, option); } } else { - for (int i = 0; i < GlobalConstants::get_global_constant_count(); i++) { - if (GlobalConstants::get_global_constant_enum(i) == current_enum) { - ScriptCodeCompletionOption option(GlobalConstants::get_global_constant_name(i), ScriptCodeCompletionOption::KIND_ENUM); + for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) { + if (CoreConstants::get_global_constant_enum(i) == current_enum) { + ScriptCodeCompletionOption option(CoreConstants::get_global_constant_name(i), ScriptCodeCompletionOption::KIND_ENUM); r_result.insert(option.display, option); } } @@ -2257,7 +2266,7 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c case GDScriptParser::DataType::BUILTIN: { if (base.get_type() == Variant::NIL) { Callable::CallError err; - base = Variant::construct(base_type.builtin_type, nullptr, 0, err); + Variant::construct(base_type.builtin_type, base, nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK) { return; } @@ -2883,7 +2892,7 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co v = v_ref; } else { Callable::CallError err; - v = Variant::construct(base_type.builtin_type, NULL, 0, err); + Variant::construct(base_type.builtin_type, v, NULL, 0, err); if (err.error != Callable::CallError::CALL_OK) { break; } diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 1da0e7b4c6..59f3deb736 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -35,7 +35,7 @@ #include "gdscript_functions.h" #ifdef DEBUG_ENABLED -#include "core/string_builder.h" +#include "core/string/string_builder.h" #endif Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_instance, GDScript *p_script, Variant &self, Variant &static_ref, Variant *p_stack, String &r_error) const { @@ -331,7 +331,8 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a return Variant(); } if (argument_types[i].kind == GDScriptDataType::BUILTIN) { - Variant arg = Variant::construct(argument_types[i].builtin_type, &p_args[i], 1, r_err); + Variant arg; + Variant::construct(argument_types[i].builtin_type, arg, &p_args[i], 1, r_err); memnew_placement(&stack[i], Variant(arg)); } else { memnew_placement(&stack[i], Variant(*p_args[i])); @@ -620,7 +621,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a const StringName *index = &_global_names_ptr[indexname]; bool valid; - dst->set_named(*index, *value, &valid); + dst->set_named(*index, *value, valid); #ifdef DEBUG_ENABLED if (!valid) { @@ -647,10 +648,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a bool valid; #ifdef DEBUG_ENABLED //allow better error message in cases where src and dst are the same stack position - Variant ret = src->get_named(*index, &valid); + Variant ret = src->get_named(*index, valid); #else - *dst = src->get_named(*index, &valid); + *dst = src->get_named(*index, valid); #endif #ifdef DEBUG_ENABLED if (!valid) { @@ -755,7 +756,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a if (Variant::can_convert_strict(src->get_type(), var_type)) { #endif // DEBUG_ENABLED Callable::CallError ce; - *dst = Variant::construct(var_type, const_cast<const Variant **>(&src), 1, ce); + Variant::construct(var_type, *dst, const_cast<const Variant **>(&src), 1, ce); } else { #ifdef DEBUG_ENABLED err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) + @@ -857,7 +858,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a GD_ERR_BREAK(to_type < 0 || to_type >= Variant::VARIANT_MAX); Callable::CallError err; - *dst = Variant::construct(to_type, (const Variant **)&src, 1, err); + Variant::construct(to_type, *dst, (const Variant **)&src, 1, err); #ifdef DEBUG_ENABLED if (err.error != Callable::CallError::CALL_OK) { @@ -955,7 +956,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a GET_VARIANT_PTR(dst, 3 + argc); Callable::CallError err; - *dst = Variant::construct(t, (const Variant **)argptrs, argc, err); + Variant::construct(t, *dst, (const Variant **)argptrs, argc, err); #ifdef DEBUG_ENABLED if (err.error != Callable::CallError::CALL_OK) { diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index c98ac09310..50eadcaf86 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -31,13 +31,13 @@ #ifndef GDSCRIPT_FUNCTION_H #define GDSCRIPT_FUNCTION_H +#include "core/object/reference.h" +#include "core/object/script_language.h" #include "core/os/thread.h" -#include "core/pair.h" -#include "core/reference.h" -#include "core/script_language.h" -#include "core/self_list.h" -#include "core/string_name.h" -#include "core/variant.h" +#include "core/string/string_name.h" +#include "core/templates/pair.h" +#include "core/templates/self_list.h" +#include "core/variant/variant.h" class GDScriptInstance; class GDScript; diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp index 31ce63bc6e..0942552ba8 100644 --- a/modules/gdscript/gdscript_functions.cpp +++ b/modules/gdscript/gdscript_functions.cpp @@ -30,14 +30,13 @@ #include "gdscript_functions.h" -#include "core/class_db.h" -#include "core/func_ref.h" #include "core/io/json.h" #include "core/io/marshalls.h" #include "core/math/math_funcs.h" +#include "core/object/class_db.h" +#include "core/object/reference.h" #include "core/os/os.h" -#include "core/reference.h" -#include "core/variant_parser.h" +#include "core/variant/variant_parser.h" #include "gdscript.h" const char *GDScriptFunctions::get_func_name(Function p_func) { @@ -83,7 +82,8 @@ const char *GDScriptFunctions::get_func_name(Function p_func) { "randomize", "randi", "randf", - "rand_range", + "randf_range", + "randi_range", "seed", "rand_seed", "deg2rad", @@ -99,7 +99,6 @@ const char *GDScriptFunctions::get_func_name(Function p_func) { "clamp", "nearest_po2", "weakref", - "funcref", "convert", "typeof", "type_exists", @@ -419,7 +418,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ Math::randomize(); r_ret = Variant(); } break; - case MATH_RAND: { + case MATH_RANDI: { VALIDATE_ARG_COUNT(0); r_ret = Math::rand(); } break; @@ -427,12 +426,18 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ VALIDATE_ARG_COUNT(0); r_ret = Math::randf(); } break; - case MATH_RANDOM: { + case MATH_RANDF_RANGE: { VALIDATE_ARG_COUNT(2); VALIDATE_ARG_NUM(0); VALIDATE_ARG_NUM(1); r_ret = Math::random((double)*p_args[0], (double)*p_args[1]); } break; + case MATH_RANDI_RANGE: { + VALIDATE_ARG_COUNT(2); + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + r_ret = Math::random((int)*p_args[0], (int)*p_args[1]); + } break; case MATH_SEED: { VALIDATE_ARG_COUNT(1); VALIDATE_ARG_NUM(0); @@ -582,31 +587,6 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ return; } } break; - case FUNC_FUNCREF: { - VALIDATE_ARG_COUNT(2); - if (p_args[0]->get_type() != Variant::OBJECT) { - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_error.argument = 0; - r_error.expected = Variant::OBJECT; - r_ret = Variant(); - return; - } - if (p_args[1]->get_type() != Variant::STRING && p_args[1]->get_type() != Variant::NODE_PATH) { - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_error.argument = 1; - r_error.expected = Variant::STRING; - r_ret = Variant(); - return; - } - - Ref<FuncRef> fr = memnew(FuncRef); - - fr->set_instance(*p_args[0]); - fr->set_function(*p_args[1]); - - r_ret = fr; - - } break; case TYPE_CONVERT: { VALIDATE_ARG_COUNT(2); VALIDATE_ARG_NUM(1); @@ -619,7 +599,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_ return; } else { - r_ret = Variant::construct(Variant::Type(type), p_args, 1, r_error); + Variant::construct(Variant::Type(type), r_ret, p_args, 1, r_error); } } break; case TYPE_OF: { @@ -1655,7 +1635,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { mi.return_val.type = Variant::NIL; return mi; } break; - case MATH_RAND: { + case MATH_RANDI: { MethodInfo mi("randi"); mi.return_val.type = Variant::INT; return mi; @@ -1665,11 +1645,16 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { mi.return_val.type = Variant::FLOAT; return mi; } break; - case MATH_RANDOM: { - MethodInfo mi("rand_range", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to")); + case MATH_RANDF_RANGE: { + MethodInfo mi("randf_range", PropertyInfo(Variant::FLOAT, "from"), PropertyInfo(Variant::FLOAT, "to")); mi.return_val.type = Variant::FLOAT; return mi; } break; + case MATH_RANDI_RANGE: { + MethodInfo mi("randi_range", PropertyInfo(Variant::INT, "from"), PropertyInfo(Variant::INT, "to")); + mi.return_val.type = Variant::INT; + return mi; + } break; case MATH_SEED: { MethodInfo mi("seed", PropertyInfo(Variant::INT, "seed")); mi.return_val.type = Variant::NIL; @@ -1749,13 +1734,6 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) { return mi; } break; - case FUNC_FUNCREF: { - MethodInfo mi("funcref", PropertyInfo(Variant::OBJECT, "instance"), PropertyInfo(Variant::STRING, "funcname")); - mi.return_val.type = Variant::OBJECT; - mi.return_val.class_name = "FuncRef"; - return mi; - - } break; case TYPE_CONVERT: { MethodInfo mi("convert", PropertyInfo(Variant::NIL, "what", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT), PropertyInfo(Variant::INT, "type")); mi.return_val.type = Variant::NIL; diff --git a/modules/gdscript/gdscript_functions.h b/modules/gdscript/gdscript_functions.h index 2c6dc02913..005b49c5da 100644 --- a/modules/gdscript/gdscript_functions.h +++ b/modules/gdscript/gdscript_functions.h @@ -31,7 +31,7 @@ #ifndef GDSCRIPT_FUNCTIONS_H #define GDSCRIPT_FUNCTIONS_H -#include "core/variant.h" +#include "core/variant/variant.h" class GDScriptFunctions { public: @@ -73,9 +73,10 @@ public: MATH_MOVE_TOWARD, MATH_DECTIME, MATH_RANDOMIZE, - MATH_RAND, + MATH_RANDI, MATH_RANDF, - MATH_RANDOM, + MATH_RANDF_RANGE, + MATH_RANDI_RANGE, MATH_SEED, MATH_RANDSEED, MATH_DEG2RAD, @@ -91,7 +92,6 @@ public: LOGIC_CLAMP, LOGIC_NEAREST_PO2, OBJ_WEAKREF, - FUNC_FUNCREF, TYPE_CONVERT, TYPE_OF, TYPE_EXISTS, diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 2a69db130b..1eb3846319 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -30,15 +30,15 @@ #include "gdscript_parser.h" +#include "core/config/project_settings.h" #include "core/io/resource_loader.h" #include "core/math/math_defs.h" #include "core/os/file_access.h" -#include "core/project_settings.h" #include "gdscript.h" #ifdef DEBUG_ENABLED #include "core/os/os.h" -#include "core/string_builder.h" +#include "core/string/string_builder.h" #endif // DEBUG_ENABLED #ifdef TOOLS_ENABLED @@ -65,7 +65,7 @@ Variant::Type GDScriptParser::get_builtin_type(const StringName &p_type) { builtin_types["Basis"] = Variant::BASIS; builtin_types["Transform"] = Variant::TRANSFORM; builtin_types["Color"] = Variant::COLOR; - builtin_types["RID"] = Variant::_RID; + builtin_types["RID"] = Variant::RID; builtin_types["Object"] = Variant::OBJECT; builtin_types["StringName"] = Variant::STRING_NAME; builtin_types["NodePath"] = Variant::NODE_PATH; @@ -2802,7 +2802,9 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation) Callable::CallError error; Vector<Variant> args = varray(string->name); const Variant *name = args.ptr(); - p_annotation->resolved_arguments.push_back(Variant::construct(parameter.type, &(name), 1, error)); + Variant r; + Variant::construct(parameter.type, r, &(name), 1, error); + p_annotation->resolved_arguments.push_back(r); if (error.error != Callable::CallError::CALL_OK) { push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name)); p_annotation->resolved_arguments.remove(p_annotation->resolved_arguments.size() - 1); @@ -2824,7 +2826,9 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation) } Callable::CallError error; const Variant *args = &value; - p_annotation->resolved_arguments.push_back(Variant::construct(parameter.type, &(args), 1, error)); + Variant r; + Variant::construct(parameter.type, r, &(args), 1, error); + p_annotation->resolved_arguments.push_back(r); if (error.error != Callable::CallError::CALL_OK) { push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name)); p_annotation->resolved_arguments.remove(p_annotation->resolved_arguments.size() - 1); diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 4c9473c7bd..b24acc4778 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -31,23 +31,23 @@ #ifndef GDSCRIPT_PARSER_H #define GDSCRIPT_PARSER_H -#include "core/hash_map.h" #include "core/io/multiplayer_api.h" -#include "core/list.h" -#include "core/map.h" -#include "core/reference.h" -#include "core/resource.h" -#include "core/script_language.h" -#include "core/string_name.h" -#include "core/ustring.h" -#include "core/variant.h" -#include "core/vector.h" +#include "core/io/resource.h" +#include "core/object/reference.h" +#include "core/object/script_language.h" +#include "core/string/string_name.h" +#include "core/string/ustring.h" +#include "core/templates/hash_map.h" +#include "core/templates/list.h" +#include "core/templates/map.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" #include "gdscript_cache.h" #include "gdscript_functions.h" #include "gdscript_tokenizer.h" #ifdef DEBUG_ENABLED -#include "core/string_builder.h" +#include "core/string/string_builder.h" #include "gdscript_warning.h" #endif // DEBUG_ENABLED diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 9a40aa50ac..b91777ede1 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -30,7 +30,7 @@ #include "gdscript_tokenizer.h" -#include "core/error_macros.h" +#include "core/error/error_macros.h" #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h index 4453982d08..d51f1f250f 100644 --- a/modules/gdscript/gdscript_tokenizer.h +++ b/modules/gdscript/gdscript_tokenizer.h @@ -31,10 +31,10 @@ #ifndef GDSCRIPT_TOKENIZER_H #define GDSCRIPT_TOKENIZER_H -#include "core/list.h" -#include "core/set.h" -#include "core/variant.h" -#include "core/vector.h" +#include "core/templates/list.h" +#include "core/templates/set.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" class GDScriptTokenizer { public: diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp index 105facd9d0..56704d3e0a 100644 --- a/modules/gdscript/gdscript_warning.cpp +++ b/modules/gdscript/gdscript_warning.cpp @@ -30,7 +30,7 @@ #include "gdscript_warning.h" -#include "core/variant.h" +#include "core/variant/variant.h" #ifdef DEBUG_ENABLED diff --git a/modules/gdscript/gdscript_warning.h b/modules/gdscript/gdscript_warning.h index e183d6f302..e0857703d8 100644 --- a/modules/gdscript/gdscript_warning.h +++ b/modules/gdscript/gdscript_warning.h @@ -33,8 +33,8 @@ #ifdef DEBUG_ENABLED -#include "core/ustring.h" -#include "core/vector.h" +#include "core/string/ustring.h" +#include "core/templates/vector.h" class GDScriptWarning { public: diff --git a/modules/gdscript/language_server/gdscript_extend_parser.h b/modules/gdscript/language_server/gdscript_extend_parser.h index 0c031d7883..bb02d3dc99 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.h +++ b/modules/gdscript/language_server/gdscript_extend_parser.h @@ -32,7 +32,7 @@ #define GDSCRIPT_EXTEND_PARSER_H #include "../gdscript_parser.h" -#include "core/variant.h" +#include "core/variant/variant.h" #include "lsp.hpp" #ifndef LINE_NUMBER_TO_INDEX diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 2a67d2ff4f..6ddb0d149e 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -30,9 +30,9 @@ #include "gdscript_language_protocol.h" +#include "core/config/project_settings.h" #include "core/io/json.h" #include "core/os/copymem.h" -#include "core/project_settings.h" #include "editor/editor_log.h" #include "editor/editor_node.h" diff --git a/modules/gdscript/language_server/gdscript_text_document.h b/modules/gdscript/language_server/gdscript_text_document.h index b2fd0c31f9..2a5755bec6 100644 --- a/modules/gdscript/language_server/gdscript_text_document.h +++ b/modules/gdscript/language_server/gdscript_text_document.h @@ -31,8 +31,8 @@ #ifndef GDSCRIPT_TEXT_DOCUMENT_H #define GDSCRIPT_TEXT_DOCUMENT_H +#include "core/object/reference.h" #include "core/os/file_access.h" -#include "core/reference.h" #include "lsp.hpp" class GDScriptTextDocument : public Reference { diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 776193e37c..f6643d07f9 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -32,8 +32,8 @@ #include "../gdscript.h" #include "../gdscript_parser.h" -#include "core/project_settings.h" -#include "core/script_language.h" +#include "core/config/project_settings.h" +#include "core/object/script_language.h" #include "editor/editor_file_system.h" #include "editor/editor_help.h" #include "editor/editor_node.h" diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h index e45b06747d..fc244c6357 100644 --- a/modules/gdscript/language_server/gdscript_workspace.h +++ b/modules/gdscript/language_server/gdscript_workspace.h @@ -32,7 +32,7 @@ #define GDSCRIPT_WORKSPACE_H #include "../gdscript_parser.h" -#include "core/variant.h" +#include "core/variant/variant.h" #include "editor/editor_file_system.h" #include "gdscript_extend_parser.h" #include "lsp.hpp" diff --git a/modules/gdscript/language_server/lsp.hpp b/modules/gdscript/language_server/lsp.hpp index cf27a1578c..bf32c1c978 100644 --- a/modules/gdscript/language_server/lsp.hpp +++ b/modules/gdscript/language_server/lsp.hpp @@ -31,8 +31,8 @@ #ifndef GODOT_LSP_H #define GODOT_LSP_H -#include "core/class_db.h" -#include "core/list.h" +#include "core/object/class_db.h" +#include "core/templates/list.h" #include "editor/doc_data.h" namespace lsp { diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index da4cbe34c7..065f01e654 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -59,7 +59,7 @@ GDScriptCache *gdscript_cache = nullptr; #include "editor/gdscript_translation_parser_plugin.h" #ifndef GDSCRIPT_NO_LSP -#include "core/engine.h" +#include "core/config/engine.h" #include "language_server/gdscript_language_server.h" #endif // !GDSCRIPT_NO_LSP diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index 931b683a44..50b3783388 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -30,12 +30,12 @@ #include "test_gdscript.h" +#include "core/config/project_settings.h" #include "core/io/file_access_pack.h" #include "core/os/file_access.h" #include "core/os/main_loop.h" #include "core/os/os.h" -#include "core/project_settings.h" -#include "core/string_builder.h" +#include "core/string/string_builder.h" #include "scene/resources/packed_scene.h" #include "modules/gdscript/gdscript_analyzer.h" diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 21fa83278b..633b209f0f 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -31,7 +31,7 @@ #include "grid_map.h" #include "core/io/marshalls.h" -#include "core/message_queue.h" +#include "core/object/message_queue.h" #include "scene/3d/light_3d.h" #include "scene/resources/mesh_library.h" #include "scene/resources/surface_tool.h" diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp index 906e506b62..ab384fa942 100644 --- a/modules/gridmap/register_types.cpp +++ b/modules/gridmap/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" #ifndef _3D_DISABLED -#include "core/class_db.h" +#include "core/object/class_db.h" #include "grid_map.h" #include "grid_map_editor_plugin.h" #endif diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp index 333b1cf377..af3741bae9 100644 --- a/modules/hdr/image_loader_hdr.cpp +++ b/modules/hdr/image_loader_hdr.cpp @@ -31,7 +31,7 @@ #include "image_loader_hdr.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { String header = f->get_token(); diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index 9c7ace5cf2..e5f041c618 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -31,7 +31,7 @@ #include "image_loader_jpegd.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include <jpgd.h> #include <string.h> diff --git a/modules/jsonrpc/jsonrpc.h b/modules/jsonrpc/jsonrpc.h index 6f3f8003e0..c2acf84515 100644 --- a/modules/jsonrpc/jsonrpc.h +++ b/modules/jsonrpc/jsonrpc.h @@ -31,8 +31,8 @@ #ifndef GODOT_JSON_RPC_H #define GODOT_JSON_RPC_H -#include "core/class_db.h" -#include "core/variant.h" +#include "core/object/class_db.h" +#include "core/variant/variant.h" class JSONRPC : public Object { GDCLASS(JSONRPC, Object) diff --git a/modules/jsonrpc/register_types.cpp b/modules/jsonrpc/register_types.cpp index 0d3e446e3e..e6affaee41 100644 --- a/modules/jsonrpc/register_types.cpp +++ b/modules/jsonrpc/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "core/class_db.h" +#include "core/object/class_db.h" #include "jsonrpc.h" void register_jsonrpc_types() { diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index 4de523baa0..1ef991841b 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "lightmapper_rd.h" +#include "core/config/project_settings.h" #include "core/math/geometry_2d.h" -#include "core/project_settings.h" #include "lm_blendseams.glsl.gen.h" #include "lm_compute.glsl.gen.h" #include "lm_raster.glsl.gen.h" diff --git a/modules/lightmapper_rd/lightmapper_rd.h b/modules/lightmapper_rd/lightmapper_rd.h index cd000414cf..e17b5473a8 100644 --- a/modules/lightmapper_rd/lightmapper_rd.h +++ b/modules/lightmapper_rd/lightmapper_rd.h @@ -31,7 +31,7 @@ #ifndef LIGHTMAPPER_RD_H #define LIGHTMAPPER_RD_H -#include "core/local_vector.h" +#include "core/templates/local_vector.h" #include "scene/3d/lightmapper.h" #include "scene/resources/mesh.h" #include "servers/rendering/rendering_device.h" diff --git a/modules/lightmapper_rd/register_types.cpp b/modules/lightmapper_rd/register_types.cpp index 0e6d7590cc..b16adaf5d6 100644 --- a/modules/lightmapper_rd/register_types.cpp +++ b/modules/lightmapper_rd/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "lightmapper_rd.h" #include "scene/3d/lightmapper.h" diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp index 12a982df6e..bec792450a 100644 --- a/modules/mbedtls/crypto_mbedtls.cpp +++ b/modules/mbedtls/crypto_mbedtls.cpp @@ -32,10 +32,10 @@ #include "core/os/file_access.h" -#include "core/engine.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" #include "core/io/certs_compressed.gen.h" #include "core/io/compression.h" -#include "core/project_settings.h" #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h index 2a446f9d48..e40ca08643 100644 --- a/modules/mbedtls/crypto_mbedtls.h +++ b/modules/mbedtls/crypto_mbedtls.h @@ -32,7 +32,7 @@ #define CRYPTO_MBEDTLS_H #include "core/crypto/crypto.h" -#include "core/resource.h" +#include "core/io/resource.h" #include <mbedtls/ctr_drbg.h> #include <mbedtls/entropy.h> diff --git a/modules/mbedtls/ssl_context_mbedtls.h b/modules/mbedtls/ssl_context_mbedtls.h index baaeb6eb85..96703a7eb7 100644 --- a/modules/mbedtls/ssl_context_mbedtls.h +++ b/modules/mbedtls/ssl_context_mbedtls.h @@ -35,7 +35,7 @@ #include "core/os/file_access.h" -#include "core/reference.h" +#include "core/object/reference.h" #include <mbedtls/config.h> #include <mbedtls/ctr_drbg.h> diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp index d7b2028204..e3119a8da7 100644 --- a/modules/mono/class_db_api_json.cpp +++ b/modules/mono/class_db_api_json.cpp @@ -32,9 +32,9 @@ #ifdef DEBUG_METHODS_ENABLED +#include "core/config/project_settings.h" #include "core/io/json.h" #include "core/os/file_access.h" -#include "core/project_settings.h" #include "core/version.h" void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) { diff --git a/modules/mono/class_db_api_json.h b/modules/mono/class_db_api_json.h index 7f016ac3d6..6b7f5a4d88 100644 --- a/modules/mono/class_db_api_json.h +++ b/modules/mono/class_db_api_json.h @@ -31,13 +31,13 @@ #ifndef CLASS_DB_API_JSON_H #define CLASS_DB_API_JSON_H -// 'core/method_bind.h' defines DEBUG_METHODS_ENABLED, but it looks like we -// cannot include it here. That's why we include it through 'core/class_db.h'. -#include "core/class_db.h" +// 'core/object/method_bind.h' defines DEBUG_METHODS_ENABLED, but it looks like we +// cannot include it here. That's why we include it through 'core/object/class_db.h'. +#include "core/object/class_db.h" #ifdef DEBUG_METHODS_ENABLED -#include "core/ustring.h" +#include "core/string/ustring.h" void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 8928b6e5e3..b4537f531d 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -33,6 +33,7 @@ #include <mono/metadata/threads.h> #include <stdint.h> +#include "core/config/project_settings.h" #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" #include "core/io/json.h" @@ -40,7 +41,6 @@ #include "core/os/mutex.h" #include "core/os/os.h" #include "core/os/thread.h" -#include "core/project_settings.h" #ifdef TOOLS_ENABLED #include "editor/bindings_generator.h" @@ -477,7 +477,7 @@ static String variant_type_to_managed_name(const String &p_var_type_name) { Variant::COLOR, Variant::STRING_NAME, Variant::NODE_PATH, - Variant::_RID, + Variant::RID, Variant::CALLABLE }; diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 316fd78f2a..3e4e6c3f86 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -33,8 +33,8 @@ #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" -#include "core/script_language.h" -#include "core/self_list.h" +#include "core/object/script_language.h" +#include "core/templates/self_list.h" #include "mono_gc_handle.h" #include "mono_gd/gd_mono.h" diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 4c137a2ba4..ff3122a77f 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -32,13 +32,13 @@ #if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) -#include "core/engine.h" -#include "core/global_constants.h" +#include "core/config/engine.h" +#include "core/core_constants.h" #include "core/io/compression.h" #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/ucaps.h" +#include "core/string/ucaps.h" #include "../glue/cs_glue_version.gen.h" #include "../godotsharp_defs.h" @@ -2426,7 +2426,7 @@ bool BindingsGenerator::_arg_default_value_is_assignable_to_type(const Variant & case Variant::VECTOR2: case Variant::RECT2: case Variant::VECTOR3: - case Variant::_RID: + case Variant::RID: case Variant::ARRAY: case Variant::DICTIONARY: case Variant::PACKED_BYTE_ARRAY: @@ -2979,7 +2979,7 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar r_iarg.default_argument = "new %s()"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_REF; break; - case Variant::_RID: + case Variant::RID: ERR_FAIL_COND_V_MSG(r_iarg.type.cname != name_cache.type_RID, false, "Parameter of type '" + String(r_iarg.type.cname) + "' cannot have a default value of type '" + String(name_cache.type_RID) + "'."); @@ -3399,7 +3399,7 @@ void BindingsGenerator::_populate_builtin_type_interfaces() { } void BindingsGenerator::_populate_global_constants() { - int global_constants_count = GlobalConstants::get_global_constant_count(); + int global_constants_count = CoreConstants::get_global_constant_count(); if (global_constants_count > 0) { Map<String, DocData::ClassDoc>::Element *match = EditorHelp::get_doc_data()->class_list.find("@GlobalScope"); @@ -3409,7 +3409,7 @@ void BindingsGenerator::_populate_global_constants() { const DocData::ClassDoc &global_scope_doc = match->value(); for (int i = 0; i < global_constants_count; i++) { - String constant_name = GlobalConstants::get_global_constant_name(i); + String constant_name = CoreConstants::get_global_constant_name(i); const DocData::ConstantDoc *const_doc = nullptr; for (int j = 0; j < global_scope_doc.constants.size(); j++) { @@ -3421,8 +3421,8 @@ void BindingsGenerator::_populate_global_constants() { } } - int constant_value = GlobalConstants::get_global_constant_value(i); - StringName enum_name = GlobalConstants::get_global_constant_enum(i); + int constant_value = CoreConstants::get_global_constant_value(i); + StringName enum_name = CoreConstants::get_global_constant_enum(i); ConstantInterface iconstant(constant_name, snake_to_pascal_case(constant_name, true), constant_value); iconstant.const_doc = const_doc; diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 90c1c9f3ee..eeab518954 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -31,14 +31,14 @@ #ifndef BINDINGS_GENERATOR_H #define BINDINGS_GENERATOR_H -#include "core/class_db.h" -#include "core/string_builder.h" +#include "core/object/class_db.h" +#include "core/string/string_builder.h" #include "editor/doc_data.h" #include "editor/editor_help.h" #if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) -#include "core/ustring.h" +#include "core/string/ustring.h" class BindingsGenerator { struct ConstantInterface { diff --git a/modules/mono/editor/code_completion.cpp b/modules/mono/editor/code_completion.cpp index 942c6d26a6..9defd65190 100644 --- a/modules/mono/editor/code_completion.cpp +++ b/modules/mono/editor/code_completion.cpp @@ -30,7 +30,7 @@ #include "code_completion.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "editor/editor_file_system.h" #include "editor/editor_settings.h" #include "scene/gui/control.h" diff --git a/modules/mono/editor/code_completion.h b/modules/mono/editor/code_completion.h index 77673b766f..b9d22de0b3 100644 --- a/modules/mono/editor/code_completion.h +++ b/modules/mono/editor/code_completion.h @@ -31,8 +31,8 @@ #ifndef CODE_COMPLETION_H #define CODE_COMPLETION_H -#include "core/ustring.h" -#include "core/variant.h" +#include "core/string/ustring.h" +#include "core/variant/variant.h" namespace gdmono { diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp index 2edd8c87dc..4fa753ab8b 100644 --- a/modules/mono/editor/godotsharp_export.cpp +++ b/modules/mono/editor/godotsharp_export.cpp @@ -32,9 +32,9 @@ #include <mono/metadata/image.h> +#include "core/config/project_settings.h" #include "core/io/file_access_pack.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "../mono_gd/gd_mono.h" #include "../mono_gd/gd_mono_assembly.h" diff --git a/modules/mono/editor/godotsharp_export.h b/modules/mono/editor/godotsharp_export.h index 9ab57755de..bd0f86a74b 100644 --- a/modules/mono/editor/godotsharp_export.h +++ b/modules/mono/editor/godotsharp_export.h @@ -31,9 +31,9 @@ #ifndef GODOTSHARP_EXPORT_H #define GODOTSHARP_EXPORT_H -#include "core/dictionary.h" -#include "core/error_list.h" -#include "core/ustring.h" +#include "core/error/error_list.h" +#include "core/string/ustring.h" +#include "core/variant/dictionary.h" #include "../mono_gd/gd_mono_header.h" diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp index f7d6e7e302..70940c279e 100644 --- a/modules/mono/editor/script_class_parser.cpp +++ b/modules/mono/editor/script_class_parser.cpp @@ -30,8 +30,8 @@ #include "script_class_parser.h" -#include "core/map.h" #include "core/os/os.h" +#include "core/templates/map.h" #include "../utils/string_utils.h" diff --git a/modules/mono/editor/script_class_parser.h b/modules/mono/editor/script_class_parser.h index d611e8fb74..3c55fa07a7 100644 --- a/modules/mono/editor/script_class_parser.h +++ b/modules/mono/editor/script_class_parser.h @@ -31,9 +31,9 @@ #ifndef SCRIPT_CLASS_PARSER_H #define SCRIPT_CLASS_PARSER_H -#include "core/ustring.h" -#include "core/variant.h" -#include "core/vector.h" +#include "core/string/ustring.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" class ScriptClassParser { public: diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs index f77d3052f4..ce613f7ef9 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs @@ -81,6 +81,11 @@ namespace Godot.Collections return godot_icall_Array_Resize(GetPtr(), newSize); } + public void Shuffle() + { + godot_icall_Array_Shuffle(GetPtr()); + } + public static Array operator +(Array left, Array right) { return new Array(godot_icall_Array_Concatenate(left.GetPtr(), right.GetPtr())); @@ -220,6 +225,9 @@ namespace Godot.Collections internal extern static Error godot_icall_Array_Resize(IntPtr ptr, int newSize); [MethodImpl(MethodImplOptions.InternalCall)] + internal extern static Error godot_icall_Array_Shuffle(IntPtr ptr); + + [MethodImpl(MethodImplOptions.InternalCall)] internal extern static void godot_icall_Array_Generic_GetElementTypeInfo(Type elemType, out int elemTypeEncoding, out IntPtr elemTypeClass); [MethodImpl(MethodImplOptions.InternalCall)] @@ -295,6 +303,11 @@ namespace Godot.Collections return objectArray.Resize(newSize); } + public void Shuffle() + { + objectArray.Shuffle(); + } + public static Array<T> operator +(Array<T> left, Array<T> right) { return new Array<T>(left.objectArray + right.objectArray); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs index 3700a6194f..d0add835c0 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs @@ -257,20 +257,6 @@ namespace Godot } /// <summary> - /// Returns the most contrasting color. - /// </summary> - /// <returns>The most contrasting color</returns> - public Color Contrasted() - { - return new Color( - (r + 0.5f) % 1.0f, - (g + 0.5f) % 1.0f, - (b + 0.5f) % 1.0f, - a - ); - } - - /// <summary> /// Returns a new color resulting from making this color darker /// by the specified ratio (on the range of 0 to 1). /// </summary> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs index e050d1fdd1..7f4777777c 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs @@ -129,7 +129,12 @@ namespace Godot public static double RandRange(double from, double to) { - return godot_icall_GD_rand_range(from, to); + return godot_icall_GD_randf_range(from, to); + } + + public static int RandRange(int from, int to) + { + return godot_icall_GD_randi_range(from, to); } public static uint RandSeed(ulong seed, out ulong newSeed) @@ -238,9 +243,11 @@ namespace Godot [MethodImpl(MethodImplOptions.InternalCall)] internal extern static void godot_icall_GD_randomize(); + [MethodImpl(MethodImplOptions.InternalCall)] + internal extern static double godot_icall_GD_randf_range(double from, double to); [MethodImpl(MethodImplOptions.InternalCall)] - internal extern static double godot_icall_GD_rand_range(double from, double to); + internal extern static int godot_icall_GD_randi_range(int from, int to); [MethodImpl(MethodImplOptions.InternalCall)] internal extern static uint godot_icall_GD_rand_seed(ulong seed, out ulong newSeed); diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp index 439fb1ab0a..544f414cba 100644 --- a/modules/mono/glue/base_object_glue.cpp +++ b/modules/mono/glue/base_object_glue.cpp @@ -30,9 +30,9 @@ #ifdef MONO_GLUE_ENABLED -#include "core/class_db.h" -#include "core/reference.h" -#include "core/string_name.h" +#include "core/object/class_db.h" +#include "core/object/reference.h" +#include "core/string/string_name.h" #include "../csharp_script.h" #include "../mono_gd/gd_mono_cache.h" diff --git a/modules/mono/glue/collections_glue.cpp b/modules/mono/glue/collections_glue.cpp index 3313e8cb77..bb3ea0f730 100644 --- a/modules/mono/glue/collections_glue.cpp +++ b/modules/mono/glue/collections_glue.cpp @@ -32,7 +32,7 @@ #include <mono/metadata/exception.h> -#include "core/array.h" +#include "core/variant/array.h" #include "../mono_gd/gd_mono_cache.h" #include "../mono_gd/gd_mono_class.h" @@ -162,6 +162,10 @@ Error godot_icall_Array_Resize(Array *ptr, int new_size) { return ptr->resize(new_size); } +void godot_icall_Array_Shuffle(Array *ptr) { + ptr->shuffle(); +} + void godot_icall_Array_Generic_GetElementTypeInfo(MonoReflectionType *refltype, uint32_t *type_encoding, GDMonoClass **type_class) { MonoType *elem_type = mono_reflection_type_get_type(refltype); @@ -322,6 +326,7 @@ void godot_register_collections_icalls() { mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Remove", (void *)godot_icall_Array_Remove); mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_RemoveAt", (void *)godot_icall_Array_RemoveAt); mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Resize", (void *)godot_icall_Array_Resize); + mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Shuffle", (void *)godot_icall_Array_Shuffle); mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_Generic_GetElementTypeInfo", (void *)godot_icall_Array_Generic_GetElementTypeInfo); mono_add_internal_call("Godot.Collections.Array::godot_icall_Array_ToString", (void *)godot_icall_Array_ToString); diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp index 5e892b616b..4c1df529fc 100644 --- a/modules/mono/glue/gd_glue.cpp +++ b/modules/mono/glue/gd_glue.cpp @@ -30,12 +30,12 @@ #ifdef MONO_GLUE_ENABLED -#include "core/array.h" #include "core/io/marshalls.h" #include "core/os/os.h" -#include "core/ustring.h" -#include "core/variant.h" -#include "core/variant_parser.h" +#include "core/string/ustring.h" +#include "core/variant/array.h" +#include "core/variant/variant.h" +#include "core/variant/variant_parser.h" #include "../mono_gd/gd_mono_cache.h" #include "../mono_gd/gd_mono_marshal.h" @@ -193,7 +193,11 @@ void godot_icall_GD_randomize() { Math::randomize(); } -double godot_icall_GD_rand_range(double from, double to) { +double godot_icall_GD_randf_range(double from, double to) { + return Math::random(from, to); +} + +int32_t godot_icall_GD_randi_range(int32_t from, int32_t to) { return Math::random(from, to); } @@ -298,7 +302,8 @@ void godot_register_gd_icalls() { mono_add_internal_call("Godot.GD::godot_icall_GD_randf", (void *)godot_icall_GD_randf); mono_add_internal_call("Godot.GD::godot_icall_GD_randi", (void *)godot_icall_GD_randi); mono_add_internal_call("Godot.GD::godot_icall_GD_randomize", (void *)godot_icall_GD_randomize); - mono_add_internal_call("Godot.GD::godot_icall_GD_rand_range", (void *)godot_icall_GD_rand_range); + mono_add_internal_call("Godot.GD::godot_icall_GD_randf_range", (void *)godot_icall_GD_randf_range); + mono_add_internal_call("Godot.GD::godot_icall_GD_randi_range", (void *)godot_icall_GD_randi_range); mono_add_internal_call("Godot.GD::godot_icall_GD_rand_seed", (void *)godot_icall_GD_rand_seed); mono_add_internal_call("Godot.GD::godot_icall_GD_seed", (void *)godot_icall_GD_seed); mono_add_internal_call("Godot.GD::godot_icall_GD_str", (void *)godot_icall_GD_str); diff --git a/modules/mono/glue/glue_header.h b/modules/mono/glue/glue_header.h index dc3bf47838..f4263e286e 100644 --- a/modules/mono/glue/glue_header.h +++ b/modules/mono/glue/glue_header.h @@ -58,15 +58,15 @@ void godot_register_glue_header_icalls() { // Used by the generated glue -#include "core/array.h" -#include "core/class_db.h" -#include "core/dictionary.h" -#include "core/engine.h" -#include "core/method_bind.h" -#include "core/node_path.h" -#include "core/reference.h" +#include "core/config/engine.h" +#include "core/object/class_db.h" +#include "core/object/method_bind.h" +#include "core/object/reference.h" +#include "core/string/node_path.h" +#include "core/string/ustring.h" #include "core/typedefs.h" -#include "core/ustring.h" +#include "core/variant/array.h" +#include "core/variant/dictionary.h" #include "../mono_gd/gd_mono_class.h" #include "../mono_gd/gd_mono_internals.h" diff --git a/modules/mono/glue/nodepath_glue.cpp b/modules/mono/glue/nodepath_glue.cpp index 2aa75dd309..09c6d8f482 100644 --- a/modules/mono/glue/nodepath_glue.cpp +++ b/modules/mono/glue/nodepath_glue.cpp @@ -30,8 +30,8 @@ #ifdef MONO_GLUE_ENABLED -#include "core/node_path.h" -#include "core/ustring.h" +#include "core/string/node_path.h" +#include "core/string/ustring.h" #include "../mono_gd/gd_mono_marshal.h" diff --git a/modules/mono/glue/rid_glue.cpp b/modules/mono/glue/rid_glue.cpp index a7b18c36dd..cb4f26511f 100644 --- a/modules/mono/glue/rid_glue.cpp +++ b/modules/mono/glue/rid_glue.cpp @@ -30,9 +30,9 @@ #ifdef MONO_GLUE_ENABLED -#include "core/class_db.h" -#include "core/resource.h" -#include "core/rid.h" +#include "core/io/resource.h" +#include "core/object/class_db.h" +#include "core/templates/rid.h" #include "../mono_gd/gd_mono_marshal.h" diff --git a/modules/mono/glue/scene_tree_glue.cpp b/modules/mono/glue/scene_tree_glue.cpp index b43daccc1b..53d6c1436d 100644 --- a/modules/mono/glue/scene_tree_glue.cpp +++ b/modules/mono/glue/scene_tree_glue.cpp @@ -30,9 +30,9 @@ #ifdef MONO_GLUE_ENABLED -#include "core/array.h" -#include "core/class_db.h" -#include "core/string_name.h" +#include "core/object/class_db.h" +#include "core/string/string_name.h" +#include "core/variant/array.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" diff --git a/modules/mono/glue/string_glue.cpp b/modules/mono/glue/string_glue.cpp index 595b8d71f1..9271731573 100644 --- a/modules/mono/glue/string_glue.cpp +++ b/modules/mono/glue/string_glue.cpp @@ -30,9 +30,9 @@ #ifdef MONO_GLUE_ENABLED -#include "core/ustring.h" -#include "core/variant.h" -#include "core/vector.h" +#include "core/string/ustring.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" #include "../mono_gd/gd_mono_marshal.h" diff --git a/modules/mono/glue/string_name_glue.cpp b/modules/mono/glue/string_name_glue.cpp index 4b2e88569b..9323e3bbb3 100644 --- a/modules/mono/glue/string_name_glue.cpp +++ b/modules/mono/glue/string_name_glue.cpp @@ -30,8 +30,8 @@ #ifdef MONO_GLUE_ENABLED -#include "core/string_name.h" -#include "core/ustring.h" +#include "core/string/string_name.h" +#include "core/string/ustring.h" #include "../mono_gd/gd_mono_marshal.h" diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index df31823deb..4233732bff 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -30,9 +30,9 @@ #include "godotsharp_dirs.h" +#include "core/config/project_settings.h" #include "core/os/dir_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #ifdef TOOLS_ENABLED #include "core/version.h" diff --git a/modules/mono/godotsharp_dirs.h b/modules/mono/godotsharp_dirs.h index 2ab4b0e309..6391616419 100644 --- a/modules/mono/godotsharp_dirs.h +++ b/modules/mono/godotsharp_dirs.h @@ -31,7 +31,7 @@ #ifndef GODOTSHARP_DIRS_H #define GODOTSHARP_DIRS_H -#include "core/ustring.h" +#include "core/string/ustring.h" namespace GodotSharpDirs { diff --git a/modules/mono/managed_callable.h b/modules/mono/managed_callable.h index 4f71e14a2f..bde1b41781 100644 --- a/modules/mono/managed_callable.h +++ b/modules/mono/managed_callable.h @@ -33,9 +33,9 @@ #include <mono/metadata/object.h> -#include "core/callable.h" #include "core/os/mutex.h" -#include "core/self_list.h" +#include "core/templates/self_list.h" +#include "core/variant/callable.h" #include "mono_gc_handle.h" #include "mono_gd/gd_mono_method.h" diff --git a/modules/mono/mono_gc_handle.h b/modules/mono/mono_gc_handle.h index 13cfad4654..5c3a210e97 100644 --- a/modules/mono/mono_gc_handle.h +++ b/modules/mono/mono_gc_handle.h @@ -33,7 +33,7 @@ #include <mono/jit/jit.h> -#include "core/reference.h" +#include "core/object/reference.h" namespace gdmono { diff --git a/modules/mono/mono_gd/android_mono_config.h b/modules/mono/mono_gd/android_mono_config.h index 93f708bba0..9e304939b2 100644 --- a/modules/mono/mono_gd/android_mono_config.h +++ b/modules/mono/mono_gd/android_mono_config.h @@ -33,7 +33,7 @@ #ifdef ANDROID_ENABLED -#include "core/ustring.h" +#include "core/string/ustring.h" // This function is defined in an auto-generated source file String get_godot_android_mono_config(); diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index cf5ac33d20..0e335b3349 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -37,12 +37,12 @@ #include <mono/metadata/mono-gc.h> #include <mono/metadata/profiler.h> +#include "core/config/project_settings.h" #include "core/debugger/engine_debugger.h" #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" #include "core/os/thread.h" -#include "core/project_settings.h" #include "../csharp_script.h" #include "../godotsharp_dirs.h" diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp index 6e351001d4..33628b3ce3 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.cpp +++ b/modules/mono/mono_gd/gd_mono_assembly.cpp @@ -33,11 +33,11 @@ #include <mono/metadata/mono-debug.h> #include <mono/metadata/tokentype.h> +#include "core/config/project_settings.h" #include "core/io/file_access_pack.h" -#include "core/list.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" +#include "core/templates/list.h" #include "../godotsharp_dirs.h" #include "gd_mono_cache.h" diff --git a/modules/mono/mono_gd/gd_mono_assembly.h b/modules/mono/mono_gd/gd_mono_assembly.h index 63899dc9be..fc10480e07 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.h +++ b/modules/mono/mono_gd/gd_mono_assembly.h @@ -34,9 +34,9 @@ #include <mono/jit/jit.h> #include <mono/metadata/assembly.h> -#include "core/hash_map.h" -#include "core/map.h" -#include "core/ustring.h" +#include "core/string/ustring.h" +#include "core/templates/hash_map.h" +#include "core/templates/map.h" #include "gd_mono_utils.h" class GDMonoAssembly { diff --git a/modules/mono/mono_gd/gd_mono_class.h b/modules/mono/mono_gd/gd_mono_class.h index 44b146b87c..87db2fa033 100644 --- a/modules/mono/mono_gd/gd_mono_class.h +++ b/modules/mono/mono_gd/gd_mono_class.h @@ -31,8 +31,8 @@ #ifndef GD_MONO_CLASS_H #define GD_MONO_CLASS_H -#include "core/map.h" -#include "core/ustring.h" +#include "core/string/ustring.h" +#include "core/templates/map.h" #include "gd_mono_field.h" #include "gd_mono_header.h" diff --git a/modules/mono/mono_gd/gd_mono_field.cpp b/modules/mono/mono_gd/gd_mono_field.cpp index 563c45e71f..00a1e1e507 100644 --- a/modules/mono/mono_gd/gd_mono_field.cpp +++ b/modules/mono/mono_gd/gd_mono_field.cpp @@ -355,7 +355,7 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ } if (CACHED_CLASS(RID) == type_class) { - MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator RID()); + MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator ::RID()); mono_field_set_value(p_object, mono_field, managed); break; } @@ -450,8 +450,8 @@ void GDMonoField::set_value_from_variant(MonoObject *p_object, const Variant &p_ MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator NodePath()); mono_field_set_value(p_object, mono_field, managed); } break; - case Variant::_RID: { - MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator RID()); + case Variant::RID: { + MonoObject *managed = GDMonoUtils::create_managed_from(p_value.operator ::RID()); mono_field_set_value(p_object, mono_field, managed); } break; case Variant::OBJECT: { diff --git a/modules/mono/mono_gd/gd_mono_header.h b/modules/mono/mono_gd/gd_mono_header.h index 0f4f888546..ffb56e7cec 100644 --- a/modules/mono/mono_gd/gd_mono_header.h +++ b/modules/mono/mono_gd/gd_mono_header.h @@ -31,7 +31,7 @@ #ifndef GD_MONO_HEADER_H #define GD_MONO_HEADER_H -#include "core/int_types.h" +#include <cstdint> #ifdef WIN32 #define GD_MONO_STDCALL __stdcall diff --git a/modules/mono/mono_gd/gd_mono_internals.h b/modules/mono/mono_gd/gd_mono_internals.h index cf7efdecd6..d1d5eca263 100644 --- a/modules/mono/mono_gd/gd_mono_internals.h +++ b/modules/mono/mono_gd/gd_mono_internals.h @@ -35,7 +35,7 @@ #include "../utils/macros.h" -#include "core/class_db.h" +#include "core/object/class_db.h" namespace GDMonoInternals { diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index c460e283ea..9d193ab8ab 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -204,7 +204,7 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type, bool *r_nil_is_ } if (CACHED_CLASS(RID) == type_class) { - return Variant::_RID; + return Variant::RID; } if (CACHED_CLASS(Dictionary) == type_class) { @@ -580,7 +580,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty } if (CACHED_CLASS(RID) == type_class) { - return GDMonoUtils::create_managed_from(p_var->operator RID()); + return GDMonoUtils::create_managed_from(p_var->operator ::RID()); } // Godot.Collections.Dictionary or IDictionary @@ -673,8 +673,8 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return GDMonoUtils::create_managed_from(p_var->operator StringName()); case Variant::NODE_PATH: return GDMonoUtils::create_managed_from(p_var->operator NodePath()); - case Variant::_RID: - return GDMonoUtils::create_managed_from(p_var->operator RID()); + case Variant::RID: + return GDMonoUtils::create_managed_from(p_var->operator ::RID()); case Variant::OBJECT: return GDMonoUtils::unmanaged_get_managed(p_var->operator Object *()); case Variant::CALLABLE: { diff --git a/modules/mono/mono_gd/gd_mono_marshal.h b/modules/mono/mono_gd/gd_mono_marshal.h index a1fd975916..d2c564d67d 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.h +++ b/modules/mono/mono_gd/gd_mono_marshal.h @@ -31,7 +31,7 @@ #ifndef GDMONOMARSHAL_H #define GDMONOMARSHAL_H -#include "core/variant.h" +#include "core/variant/variant.h" #include "../managed_callable.h" #include "gd_mono.h" diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index 3f1155f430..2676165cbc 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -35,10 +35,10 @@ #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" +#include "core/object/reference.h" #include "core/os/dir_access.h" #include "core/os/mutex.h" #include "core/os/os.h" -#include "core/reference.h" #ifdef TOOLS_ENABLED #include "editor/debugger/editor_debugger_node.h" diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index 80569cb1c7..7088385c4f 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -37,8 +37,8 @@ #include "../utils/macros.h" #include "gd_mono_header.h" -#include "core/class_db.h" -#include "core/reference.h" +#include "core/object/class_db.h" +#include "core/object/reference.h" #define UNHANDLED_EXCEPTION(m_exc) \ if (unlikely(m_exc != nullptr)) { \ diff --git a/modules/mono/mono_gd/support/android_support.cpp b/modules/mono/mono_gd/support/android_support.cpp index 8bcdeec9dd..386e0576b3 100644 --- a/modules/mono/mono_gd/support/android_support.cpp +++ b/modules/mono/mono_gd/support/android_support.cpp @@ -44,7 +44,7 @@ #endif #include "core/os/os.h" -#include "core/ustring.h" +#include "core/string/ustring.h" #include "platform/android/java_godot_wrapper.h" #include "platform/android/os_android.h" #include "platform/android/thread_jandroid.h" diff --git a/modules/mono/mono_gd/support/android_support.h b/modules/mono/mono_gd/support/android_support.h index dc2e6c95ed..5947395a99 100755 --- a/modules/mono/mono_gd/support/android_support.h +++ b/modules/mono/mono_gd/support/android_support.h @@ -33,7 +33,7 @@ #if defined(ANDROID_ENABLED) -#include "core/ustring.h" +#include "core/string/ustring.h" namespace gdmono { namespace android { diff --git a/modules/mono/mono_gd/support/ios_support.h b/modules/mono/mono_gd/support/ios_support.h index e28af120e3..ed251cb23a 100755 --- a/modules/mono/mono_gd/support/ios_support.h +++ b/modules/mono/mono_gd/support/ios_support.h @@ -33,7 +33,7 @@ #if defined(IPHONE_ENABLED) -#include "core/ustring.h" +#include "core/string/ustring.h" namespace gdmono { namespace ios { diff --git a/modules/mono/register_types.cpp b/modules/mono/register_types.cpp index 98c3ba1324..f5c1bda18b 100644 --- a/modules/mono/register_types.cpp +++ b/modules/mono/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "csharp_script.h" diff --git a/modules/mono/signal_awaiter_utils.h b/modules/mono/signal_awaiter_utils.h index c550315a23..18d1e43e14 100644 --- a/modules/mono/signal_awaiter_utils.h +++ b/modules/mono/signal_awaiter_utils.h @@ -31,7 +31,7 @@ #ifndef SIGNAL_AWAITER_UTILS_H #define SIGNAL_AWAITER_UTILS_H -#include "core/reference.h" +#include "core/object/reference.h" #include "csharp_script.h" #include "mono_gc_handle.h" diff --git a/modules/mono/utils/mono_reg_utils.h b/modules/mono/utils/mono_reg_utils.h index 4ef876f2b6..cc3f1cb035 100644 --- a/modules/mono/utils/mono_reg_utils.h +++ b/modules/mono/utils/mono_reg_utils.h @@ -33,7 +33,7 @@ #ifdef WINDOWS_ENABLED -#include "core/ustring.h" +#include "core/string/ustring.h" struct MonoRegInfo { String version; diff --git a/modules/mono/utils/osx_utils.cpp b/modules/mono/utils/osx_utils.cpp index e68466b1cf..41be198bcf 100644 --- a/modules/mono/utils/osx_utils.cpp +++ b/modules/mono/utils/osx_utils.cpp @@ -32,7 +32,7 @@ #ifdef OSX_ENABLED -#include "core/print_string.h" +#include "core/string/print_string.h" #include <CoreFoundation/CoreFoundation.h> #include <CoreServices/CoreServices.h> diff --git a/modules/mono/utils/osx_utils.h b/modules/mono/utils/osx_utils.h index 55002702f8..92faead0fb 100644 --- a/modules/mono/utils/osx_utils.h +++ b/modules/mono/utils/osx_utils.h @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "core/ustring.h" +#include "core/string/ustring.h" #ifndef OSX_UTILS_H #define OSX_UTILS_H diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index 5d1abd0c09..eb0ba8c700 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -30,10 +30,10 @@ #include "path_utils.h" +#include "core/config/project_settings.h" #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #ifdef WINDOWS_ENABLED #include <windows.h> diff --git a/modules/mono/utils/path_utils.h b/modules/mono/utils/path_utils.h index bcd8af8bb9..458d1bb849 100644 --- a/modules/mono/utils/path_utils.h +++ b/modules/mono/utils/path_utils.h @@ -31,8 +31,8 @@ #ifndef PATH_UTILS_H #define PATH_UTILS_H -#include "core/string_builder.h" -#include "core/ustring.h" +#include "core/string/string_builder.h" +#include "core/string/ustring.h" namespace path { diff --git a/modules/mono/utils/string_utils.h b/modules/mono/utils/string_utils.h index 0318fec592..99f3548f31 100644 --- a/modules/mono/utils/string_utils.h +++ b/modules/mono/utils/string_utils.h @@ -31,8 +31,8 @@ #ifndef STRING_FORMAT_H #define STRING_FORMAT_H -#include "core/ustring.h" -#include "core/variant.h" +#include "core/string/ustring.h" +#include "core/variant/variant.h" #include <stdarg.h> diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h index 7357e54e35..73960ba85f 100644 --- a/modules/opensimplex/noise_texture.h +++ b/modules/opensimplex/noise_texture.h @@ -33,8 +33,8 @@ #include "open_simplex_noise.h" -#include "core/image.h" -#include "core/reference.h" +#include "core/io/image.h" +#include "core/object/reference.h" #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "editor/property_editor.h" diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h index dce62bc1f9..835f8ed35e 100644 --- a/modules/opensimplex/open_simplex_noise.h +++ b/modules/opensimplex/open_simplex_noise.h @@ -31,8 +31,8 @@ #ifndef OPEN_SIMPLEX_NOISE_H #define OPEN_SIMPLEX_NOISE_H -#include "core/image.h" -#include "core/reference.h" +#include "core/io/image.h" +#include "core/object/reference.h" #include "scene/resources/texture.h" #include "thirdparty/misc/open-simplex-noise.h" diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 52b49c783e..8cf19e1ca6 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -31,12 +31,12 @@ #ifndef REGEX_H #define REGEX_H -#include "core/array.h" -#include "core/dictionary.h" -#include "core/map.h" -#include "core/reference.h" -#include "core/ustring.h" -#include "core/vector.h" +#include "core/object/reference.h" +#include "core/string/ustring.h" +#include "core/templates/map.h" +#include "core/templates/vector.h" +#include "core/variant/array.h" +#include "core/variant/dictionary.h" class RegExMatch : public Reference { GDCLASS(RegExMatch, Reference); diff --git a/modules/regex/register_types.cpp b/modules/regex/register_types.cpp index 5d4aeba2d7..d470fcdaeb 100644 --- a/modules/regex/register_types.cpp +++ b/modules/regex/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "core/class_db.h" +#include "core/object/class_db.h" #include "regex.h" void register_regex_types() { diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h index 19e6d57474..11b9e1c833 100644 --- a/modules/squish/image_compress_squish.h +++ b/modules/squish/image_compress_squish.h @@ -31,7 +31,7 @@ #ifndef IMAGE_COMPRESS_SQUISH_H #define IMAGE_COMPRESS_SQUISH_H -#include "core/image.h" +#include "core/io/image.h" void image_compress_squish(Image *p_image, float p_lossy_quality, Image::UsedChannels p_channels); void image_decompress_squish(Image *p_image); diff --git a/modules/stb_vorbis/register_types.cpp b/modules/stb_vorbis/register_types.cpp index 6669d30278..13c26fc8cc 100644 --- a/modules/stb_vorbis/register_types.cpp +++ b/modules/stb_vorbis/register_types.cpp @@ -33,7 +33,7 @@ #include "audio_stream_ogg_vorbis.h" #ifdef TOOLS_ENABLED -#include "core/engine.h" +#include "core/config/engine.h" #include "resource_importer_ogg_vorbis.h" #endif diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h index ecaba5052b..8e478a40ce 100644 --- a/modules/svg/image_loader_svg.h +++ b/modules/svg/image_loader_svg.h @@ -32,7 +32,7 @@ #define IMAGE_LOADER_SVG_H #include "core/io/image_loader.h" -#include "core/ustring.h" +#include "core/string/ustring.h" /** @author Daniel Ramirez <djrmuv@gmail.com> diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 1475d24792..aa8b3122f4 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -30,10 +30,10 @@ #include "image_loader_tga.h" -#include "core/error_macros.h" +#include "core/error/error_macros.h" #include "core/io/file_access_memory.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size) { Error error; @@ -313,9 +313,9 @@ void ImageLoaderTGA::get_recognized_extensions(List<String> *p_extensions) const p_extensions->push_back("tga"); } -static Ref<Image> _tga_mem_loader_func(const uint8_t *p_png, int p_size) { +static Ref<Image> _tga_mem_loader_func(const uint8_t *p_tga, int p_size) { FileAccessMemory memfile; - Error open_memfile_error = memfile.open_custom(p_png, p_size); + Error open_memfile_error = memfile.open_custom(p_tga, p_size); ERR_FAIL_COND_V_MSG(open_memfile_error, Ref<Image>(), "Could not create memfile for TGA image buffer."); Ref<Image> img; img.instance(); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 498391e44a..4f33f58ed1 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -30,8 +30,8 @@ #include "video_stream_theora.h" +#include "core/config/project_settings.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "thirdparty/misc/yuv2rgb.h" diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 84f816acf8..867f464038 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -35,7 +35,7 @@ #include "core/os/file_access.h" #include "core/os/semaphore.h" #include "core/os/thread.h" -#include "core/ring_buffer.h" +#include "core/templates/ring_buffer.h" #include "scene/resources/video_stream.h" #include "servers/audio_server.h" diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp index 5bdcb84244..75dc16c39a 100644 --- a/modules/tinyexr/image_loader_tinyexr.cpp +++ b/modules/tinyexr/image_loader_tinyexr.cpp @@ -31,7 +31,7 @@ #include "image_loader_tinyexr.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include "thirdparty/tinyexr/tinyexr.h" diff --git a/modules/upnp/register_types.cpp b/modules/upnp/register_types.cpp index 34900206de..e66bc9d11a 100644 --- a/modules/upnp/register_types.cpp +++ b/modules/upnp/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/error_macros.h" +#include "core/error/error_macros.h" #include "upnp.h" #include "upnp_device.h" diff --git a/modules/upnp/upnp.h b/modules/upnp/upnp.h index 1c4b5549f4..e87f93e697 100644 --- a/modules/upnp/upnp.h +++ b/modules/upnp/upnp.h @@ -31,7 +31,7 @@ #ifndef GODOT_UPNP_H #define GODOT_UPNP_H -#include "core/reference.h" +#include "core/object/reference.h" #include "upnp_device.h" diff --git a/modules/upnp/upnp_device.h b/modules/upnp/upnp_device.h index 4b519fce32..a287c99b0d 100644 --- a/modules/upnp/upnp_device.h +++ b/modules/upnp/upnp_device.h @@ -31,7 +31,7 @@ #ifndef GODOT_UPNP_DEVICE_H #define GODOT_UPNP_DEVICE_H -#include "core/reference.h" +#include "core/object/reference.h" class UPNPDevice : public Reference { GDCLASS(UPNPDevice, Reference); diff --git a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index ef4183e6f6..000fbd0140 100644 --- a/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -111,61 +111,61 @@ <constant name="MATH_RANDOMIZE" value="31" enum="BuiltinFunc"> Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. </constant> - <constant name="MATH_RAND" value="32" enum="BuiltinFunc"> + <constant name="MATH_RANDI" value="32" enum="BuiltinFunc"> Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function. </constant> <constant name="MATH_RANDF" value="33" enum="BuiltinFunc"> Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication. </constant> - <constant name="MATH_RANDOM" value="34" enum="BuiltinFunc"> + <constant name="MATH_RANDF_RANGE" value="34" enum="BuiltinFunc"> Return a random floating-point value between the two inputs. </constant> - <constant name="MATH_SEED" value="35" enum="BuiltinFunc"> + <constant name="MATH_RANDI_RANGE" value="35" enum="BuiltinFunc"> + Return a random 32-bit integer value between the two inputs. + </constant> + <constant name="MATH_SEED" value="36" enum="BuiltinFunc"> Set the seed for the random number generator. </constant> - <constant name="MATH_RANDSEED" value="36" enum="BuiltinFunc"> + <constant name="MATH_RANDSEED" value="37" enum="BuiltinFunc"> Return a random value from the given seed, along with the new seed. </constant> - <constant name="MATH_DEG2RAD" value="37" enum="BuiltinFunc"> + <constant name="MATH_DEG2RAD" value="38" enum="BuiltinFunc"> Convert the input from degrees to radians. </constant> - <constant name="MATH_RAD2DEG" value="38" enum="BuiltinFunc"> + <constant name="MATH_RAD2DEG" value="39" enum="BuiltinFunc"> Convert the input from radians to degrees. </constant> - <constant name="MATH_LINEAR2DB" value="39" enum="BuiltinFunc"> + <constant name="MATH_LINEAR2DB" value="40" enum="BuiltinFunc"> Convert the input from linear volume to decibel volume. </constant> - <constant name="MATH_DB2LINEAR" value="40" enum="BuiltinFunc"> + <constant name="MATH_DB2LINEAR" value="41" enum="BuiltinFunc"> Convert the input from decibel volume to linear volume. </constant> - <constant name="MATH_POLAR2CARTESIAN" value="41" enum="BuiltinFunc"> + <constant name="MATH_POLAR2CARTESIAN" value="42" enum="BuiltinFunc"> Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis). </constant> - <constant name="MATH_CARTESIAN2POLAR" value="42" enum="BuiltinFunc"> + <constant name="MATH_CARTESIAN2POLAR" value="43" enum="BuiltinFunc"> Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). </constant> - <constant name="MATH_WRAP" value="43" enum="BuiltinFunc"> + <constant name="MATH_WRAP" value="44" enum="BuiltinFunc"> </constant> - <constant name="MATH_WRAPF" value="44" enum="BuiltinFunc"> + <constant name="MATH_WRAPF" value="45" enum="BuiltinFunc"> </constant> - <constant name="LOGIC_MAX" value="45" enum="BuiltinFunc"> + <constant name="LOGIC_MAX" value="46" enum="BuiltinFunc"> Return the greater of the two numbers, also known as their maximum. </constant> - <constant name="LOGIC_MIN" value="46" enum="BuiltinFunc"> + <constant name="LOGIC_MIN" value="47" enum="BuiltinFunc"> Return the lesser of the two numbers, also known as their minimum. </constant> - <constant name="LOGIC_CLAMP" value="47" enum="BuiltinFunc"> + <constant name="LOGIC_CLAMP" value="48" enum="BuiltinFunc"> Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to [code]min(max(input, range_low), range_high)[/code]. </constant> - <constant name="LOGIC_NEAREST_PO2" value="48" enum="BuiltinFunc"> + <constant name="LOGIC_NEAREST_PO2" value="49" enum="BuiltinFunc"> Return the nearest power of 2 to the input. </constant> - <constant name="OBJ_WEAKREF" value="49" enum="BuiltinFunc"> + <constant name="OBJ_WEAKREF" value="50" enum="BuiltinFunc"> Create a [WeakRef] from the input. </constant> - <constant name="FUNC_FUNCREF" value="50" enum="BuiltinFunc"> - Create a [FuncRef] from the input. - </constant> <constant name="TYPE_CONVERT" value="51" enum="BuiltinFunc"> Convert between types. </constant> diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index 8afed1229f..0172f29923 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/io/resource_loader.h" #include "visual_script.h" #include "visual_script_builtin_funcs.h" diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 1af4b46e22..1c7d5472cb 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -30,9 +30,9 @@ #include "visual_script.h" +#include "core/config/project_settings.h" #include "core/core_string_names.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/main/node.h" #include "visual_script_nodes.h" @@ -84,10 +84,10 @@ void VisualScriptNode::validate_input_default_values() { Callable::CallError ce; Variant existing = default_input_values[i]; const Variant *existingp = &existing; - default_input_values[i] = Variant::construct(expected, &existingp, 1, ce, false); + Variant::construct(expected, default_input_values[i], &existingp, 1, ce); if (ce.error != Callable::CallError::CALL_OK) { //could not convert? force.. - default_input_values[i] = Variant::construct(expected, nullptr, 0, ce, false); + Variant::construct(expected, default_input_values[i], nullptr, 0, ce); } } } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index cb5ed37ba1..85dab4e6cf 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -33,8 +33,8 @@ #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" +#include "core/object/script_language.h" #include "core/os/thread.h" -#include "core/script_language.h" class VisualScriptInstance; class VisualScriptNodeInstance; diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index 177f9192b8..a27307aec2 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -30,13 +30,12 @@ #include "visual_script_builtin_funcs.h" -#include "core/class_db.h" -#include "core/func_ref.h" #include "core/io/marshalls.h" #include "core/math/math_funcs.h" +#include "core/object/class_db.h" +#include "core/object/reference.h" #include "core/os/os.h" -#include "core/reference.h" -#include "core/variant_parser.h" +#include "core/variant/variant_parser.h" const char *VisualScriptBuiltinFunc::func_name[VisualScriptBuiltinFunc::FUNC_MAX] = { "sin", @@ -73,7 +72,8 @@ const char *VisualScriptBuiltinFunc::func_name[VisualScriptBuiltinFunc::FUNC_MAX "randomize", "randi", "randf", - "rand_range", + "randf_range", + "randi_range", "seed", "rand_seed", "deg2rad", @@ -89,7 +89,6 @@ const char *VisualScriptBuiltinFunc::func_name[VisualScriptBuiltinFunc::FUNC_MAX "clamp", "nearest_po2", "weakref", - "funcref", "convert", "typeof", "type_exists", @@ -143,7 +142,7 @@ bool VisualScriptBuiltinFunc::has_input_sequence_port() const { int VisualScriptBuiltinFunc::get_func_argument_count(BuiltinFunc p_func) { switch (p_func) { case MATH_RANDOMIZE: - case MATH_RAND: + case MATH_RANDI: case MATH_RANDF: return 0; case MATH_SIN: @@ -194,12 +193,12 @@ int VisualScriptBuiltinFunc::get_func_argument_count(BuiltinFunc p_func) { case MATH_POW: case MATH_EASE: case MATH_STEPIFY: - case MATH_RANDOM: + case MATH_RANDF_RANGE: + case MATH_RANDI_RANGE: case MATH_POLAR2CARTESIAN: case MATH_CARTESIAN2POLAR: case LOGIC_MAX: case LOGIC_MIN: - case FUNC_FUNCREF: case TYPE_CONVERT: case COLORN: return 2; @@ -361,16 +360,23 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } } break; case MATH_RANDOMIZE: - case MATH_RAND: + case MATH_RANDI: case MATH_RANDF: { } break; - case MATH_RANDOM: { + case MATH_RANDF_RANGE: { if (p_idx == 0) { return PropertyInfo(Variant::FLOAT, "from"); } else { return PropertyInfo(Variant::FLOAT, "to"); } } break; + case MATH_RANDI_RANGE: { + if (p_idx == 0) { + return PropertyInfo(Variant::INT, "from"); + } else { + return PropertyInfo(Variant::INT, "to"); + } + } break; case MATH_SEED: case MATH_RANDSEED: { return PropertyInfo(Variant::INT, "seed"); @@ -426,13 +432,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case OBJ_WEAKREF: { return PropertyInfo(Variant::OBJECT, "source"); } break; - case FUNC_FUNCREF: { - if (p_idx == 0) { - return PropertyInfo(Variant::OBJECT, "instance"); - } else { - return PropertyInfo(Variant::STRING, "funcname"); - } - } break; case TYPE_CONVERT: { if (p_idx == 0) { return PropertyInfo(Variant::NIL, "what"); @@ -551,13 +550,16 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case MATH_RANDOMIZE: { } break; - case MATH_RAND: { + case MATH_RANDI: { t = Variant::INT; } break; case MATH_RANDF: - case MATH_RANDOM: { + case MATH_RANDF_RANGE: { t = Variant::FLOAT; } break; + case MATH_RANDI_RANGE: { + t = Variant::INT; + } break; case MATH_SEED: { } break; case MATH_RANDSEED: { @@ -593,10 +595,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons t = Variant::OBJECT; } break; - case FUNC_FUNCREF: { - t = Variant::OBJECT; - - } break; case TYPE_CONVERT: { } break; case TEXT_ORD: @@ -861,17 +859,22 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in Math::randomize(); } break; - case VisualScriptBuiltinFunc::MATH_RAND: { + case VisualScriptBuiltinFunc::MATH_RANDI: { *r_return = Math::rand(); } break; case VisualScriptBuiltinFunc::MATH_RANDF: { *r_return = Math::randf(); } break; - case VisualScriptBuiltinFunc::MATH_RANDOM: { + case VisualScriptBuiltinFunc::MATH_RANDF_RANGE: { VALIDATE_ARG_NUM(0); VALIDATE_ARG_NUM(1); *r_return = Math::random((double)*p_inputs[0], (double)*p_inputs[1]); } break; + case VisualScriptBuiltinFunc::MATH_RANDI_RANGE: { + VALIDATE_ARG_NUM(0); + VALIDATE_ARG_NUM(1); + *r_return = Math::random((int)*p_inputs[0], (int)*p_inputs[1]); + } break; case VisualScriptBuiltinFunc::MATH_SEED: { VALIDATE_ARG_NUM(0); uint64_t seed = *p_inputs[0]; @@ -1013,30 +1016,6 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in } } break; - case VisualScriptBuiltinFunc::FUNC_FUNCREF: { - if (p_inputs[0]->get_type() != Variant::OBJECT) { - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_error.argument = 0; - r_error.expected = Variant::OBJECT; - - return; - } - if (p_inputs[1]->get_type() != Variant::STRING && p_inputs[1]->get_type() != Variant::NODE_PATH) { - r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_error.argument = 1; - r_error.expected = Variant::STRING; - - return; - } - - Ref<FuncRef> fr = memnew(FuncRef); - - fr->set_instance(*p_inputs[0]); - fr->set_function(*p_inputs[1]); - - *r_return = fr; - - } break; case VisualScriptBuiltinFunc::TYPE_CONVERT: { VALIDATE_ARG_NUM(1); int type = *p_inputs[1]; @@ -1048,7 +1027,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func, const Variant **p_in return; } else { - *r_return = Variant::construct(Variant::Type(type), p_inputs, 1, r_error); + Variant::construct(Variant::Type(type), *r_return, p_inputs, 1, r_error); } } break; case VisualScriptBuiltinFunc::TYPE_OF: { @@ -1283,9 +1262,10 @@ void VisualScriptBuiltinFunc::_bind_methods() { BIND_ENUM_CONSTANT(MATH_MOVE_TOWARD); BIND_ENUM_CONSTANT(MATH_DECTIME); BIND_ENUM_CONSTANT(MATH_RANDOMIZE); - BIND_ENUM_CONSTANT(MATH_RAND); + BIND_ENUM_CONSTANT(MATH_RANDI); BIND_ENUM_CONSTANT(MATH_RANDF); - BIND_ENUM_CONSTANT(MATH_RANDOM); + BIND_ENUM_CONSTANT(MATH_RANDF_RANGE); + BIND_ENUM_CONSTANT(MATH_RANDI_RANGE); BIND_ENUM_CONSTANT(MATH_SEED); BIND_ENUM_CONSTANT(MATH_RANDSEED); BIND_ENUM_CONSTANT(MATH_DEG2RAD); @@ -1301,7 +1281,6 @@ void VisualScriptBuiltinFunc::_bind_methods() { BIND_ENUM_CONSTANT(LOGIC_CLAMP); BIND_ENUM_CONSTANT(LOGIC_NEAREST_PO2); BIND_ENUM_CONSTANT(OBJ_WEAKREF); - BIND_ENUM_CONSTANT(FUNC_FUNCREF); BIND_ENUM_CONSTANT(TYPE_CONVERT); BIND_ENUM_CONSTANT(TYPE_OF); BIND_ENUM_CONSTANT(TYPE_EXISTS); @@ -1375,9 +1354,10 @@ void register_visual_script_builtin_func_node() { VisualScriptLanguage::singleton->add_register_func("functions/built_in/move_toward", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_MOVE_TOWARD>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/dectime", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_DECTIME>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/randomize", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDOMIZE>); - VisualScriptLanguage::singleton->add_register_func("functions/built_in/rand", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RAND>); + VisualScriptLanguage::singleton->add_register_func("functions/built_in/randi", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDI>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/randf", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDF>); - VisualScriptLanguage::singleton->add_register_func("functions/built_in/random", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDOM>); + VisualScriptLanguage::singleton->add_register_func("functions/built_in/randf_range", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDF_RANGE>); + VisualScriptLanguage::singleton->add_register_func("functions/built_in/randi_range", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDI_RANGE>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/seed", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_SEED>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/randseed", create_builtin_func_node<VisualScriptBuiltinFunc::MATH_RANDSEED>); @@ -1396,7 +1376,6 @@ void register_visual_script_builtin_func_node() { VisualScriptLanguage::singleton->add_register_func("functions/built_in/nearest_po2", create_builtin_func_node<VisualScriptBuiltinFunc::LOGIC_NEAREST_PO2>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/weakref", create_builtin_func_node<VisualScriptBuiltinFunc::OBJ_WEAKREF>); - VisualScriptLanguage::singleton->add_register_func("functions/built_in/funcref", create_builtin_func_node<VisualScriptBuiltinFunc::FUNC_FUNCREF>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/convert", create_builtin_func_node<VisualScriptBuiltinFunc::TYPE_CONVERT>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/typeof", create_builtin_func_node<VisualScriptBuiltinFunc::TYPE_OF>); VisualScriptLanguage::singleton->add_register_func("functions/built_in/type_exists", create_builtin_func_node<VisualScriptBuiltinFunc::TYPE_EXISTS>); diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index aee2ed79ce..361b445e30 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -70,9 +70,10 @@ public: MATH_MOVE_TOWARD, MATH_DECTIME, MATH_RANDOMIZE, - MATH_RAND, + MATH_RANDI, MATH_RANDF, - MATH_RANDOM, + MATH_RANDF_RANGE, + MATH_RANDI_RANGE, MATH_SEED, MATH_RANDSEED, MATH_DEG2RAD, @@ -88,7 +89,6 @@ public: LOGIC_CLAMP, LOGIC_NEAREST_PO2, OBJ_WEAKREF, - FUNC_FUNCREF, TYPE_CONVERT, TYPE_OF, TYPE_EXISTS, diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 01c674d086..1bb96a47f3 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -30,11 +30,11 @@ #include "visual_script_editor.h" -#include "core/class_db.h" #include "core/input/input.h" +#include "core/object/class_db.h" +#include "core/object/script_language.h" #include "core/os/keyboard.h" -#include "core/script_language.h" -#include "core/variant.h" +#include "core/variant/variant.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" #include "editor/editor_scale.h" @@ -388,7 +388,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::NODE_PATH: color = Color(0.41, 0.58, 0.93); break; - case Variant::_RID: + case Variant::RID: color = Color(0.41, 0.93, 0.6); break; case Variant::OBJECT: @@ -494,7 +494,7 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) { case Variant::NODE_PATH: color = Color(0.41, 0.58, 0.93); break; - case Variant::_RID: + case Variant::RID: color = Color(0.17, 0.9, 0.45); break; case Variant::OBJECT: @@ -885,7 +885,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { //not the same, reconvert Callable::CallError ce; const Variant *existingp = &value; - value = Variant::construct(left_type, &existingp, 1, ce, false); + Variant::construct(left_type, value, &existingp, 1, ce); } if (left_type == Variant::COLOR) { @@ -1173,7 +1173,9 @@ String VisualScriptEditor::_sanitized_variant_text(const StringName &property_na if (script->get_variable_info(property_name).type != Variant::NIL) { Callable::CallError ce; const Variant *converted = &var; - var = Variant::construct(script->get_variable_info(property_name).type, &converted, 1, ce, false); + Variant n; + Variant::construct(script->get_variable_info(property_name).type, n, &converted, 1, ce); + var = n; } return String(var); @@ -3959,8 +3961,9 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i Variant existing = vsn->get_default_input_value(p_input_port); if (pinfo.type != Variant::NIL && existing.get_type() != pinfo.type) { Callable::CallError ce; - const Variant *existingp = &existing; - existing = Variant::construct(pinfo.type, &existingp, 1, ce, false); + Variant e = existing; + const Variant *existingp = &e; + Variant::construct(pinfo.type, existing, &existingp, 1, ce); } default_value_edit->set_position(Object::cast_to<Control>(p_button)->get_global_position() + Vector2(0, Object::cast_to<Control>(p_button)->get_size().y)); diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 60a439b291..bb015b118d 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1341,7 +1341,7 @@ public: } bool valid; - r_ret = base.get_named(index->name, &valid); + r_ret = base.get_named(index->name, valid); if (!valid) { r_error_str = "Invalid index '" + String(index->name) + "' for base of type " + Variant::get_type_name(base.get_type()) + "."; return true; @@ -1405,7 +1405,7 @@ public: argp.write[i] = &arr[i]; } - r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce); + Variant::construct(constructor->data_type, r_ret, (const Variant **)argp.ptr(), argp.size(), ce); if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Invalid arguments to construct '" + Variant::get_type_name(constructor->data_type) + "'."; diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 3ed20fab35..36c756fc58 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -30,9 +30,9 @@ #include "visual_script_flow_control.h" +#include "core/config/project_settings.h" #include "core/io/resource_loader.h" #include "core/os/keyboard.h" -#include "core/project_settings.h" ////////////////////////////////////////// ////////////////RETURN//////////////////// diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 68de686272..3b46af3cbd 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -30,7 +30,7 @@ #include "visual_script_func_nodes.h" -#include "core/engine.h" +#include "core/config/engine.h" #include "core/io/resource_loader.h" #include "core/os/os.h" #include "scene/main/node.h" @@ -976,7 +976,7 @@ void VisualScriptPropertySet::_adjust_input_index(PropertyInfo &pinfo) const { if (index != StringName()) { Variant v; Callable::CallError ce; - v = Variant::construct(pinfo.type, nullptr, 0, ce); + Variant::construct(pinfo.type, v, nullptr, 0, ce); Variant i = v.get(index); pinfo.type = i.get_type(); } @@ -1117,7 +1117,7 @@ void VisualScriptPropertySet::_update_cache() { Variant v; Callable::CallError ce; - v = Variant::construct(basic_type, nullptr, 0, ce); + Variant::construct(basic_type, v, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); @@ -1336,7 +1336,8 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { Callable::CallError ce; - Variant v = Variant::construct(type_cache.type, nullptr, 0, ce); + Variant v; + Variant::construct(type_cache.type, v, nullptr, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); String options = ""; @@ -1449,11 +1450,11 @@ public: _FORCE_INLINE_ void _process_get(Variant &source, const Variant &p_argument, bool &valid) { if (index != StringName() && assign_op == VisualScriptPropertySet::ASSIGN_OP_NONE) { - source.set_named(index, p_argument, &valid); + source.set_named(index, p_argument, valid); } else { Variant value; if (index != StringName()) { - value = source.get_named(index, &valid); + value = source.get_named(index, valid); } else { value = source; } @@ -1497,7 +1498,7 @@ public: } if (index != StringName()) { - source.set_named(index, value, &valid); + source.set_named(index, value, valid); } else { source = value; } @@ -1562,12 +1563,12 @@ public: bool valid; if (needs_get) { - Variant value = v.get_named(property, &valid); + Variant value = v.get_named(property, valid); _process_get(value, *p_inputs[1], valid); - v.set_named(property, value, &valid); + v.set_named(property, value, valid); } else { - v.set_named(property, *p_inputs[1], &valid); + v.set_named(property, *p_inputs[1], valid); } if (!valid) { @@ -1786,7 +1787,7 @@ void VisualScriptPropertyGet::_update_cache() { Variant v; Callable::CallError ce; - v = Variant::construct(basic_type, nullptr, 0, ce); + Variant::construct(basic_type, v, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); @@ -2012,7 +2013,8 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const { if (property.name == "index") { Callable::CallError ce; - Variant v = Variant::construct(type_cache, nullptr, 0, ce); + Variant v; + Variant::construct(type_cache, v, nullptr, 0, ce); List<PropertyInfo> plist; v.get_property_list(&plist); String options = ""; @@ -2111,7 +2113,7 @@ public: *p_outputs[0] = object->get(property, &valid); if (index != StringName()) { - *p_outputs[0] = p_outputs[0]->get_named(index); + *p_outputs[0] = p_outputs[0]->get_named(index, valid); } if (!valid) { @@ -2140,7 +2142,7 @@ public: *p_outputs[0] = another->get(property, &valid); if (index != StringName()) { - *p_outputs[0] = p_outputs[0]->get_named(index); + *p_outputs[0] = p_outputs[0]->get_named(index, valid); } if (!valid) { @@ -2156,7 +2158,7 @@ public: *p_outputs[0] = v.get(property, &valid); if (index != StringName()) { - *p_outputs[0] = p_outputs[0]->get_named(index); + *p_outputs[0] = p_outputs[0]->get_named(index, valid); } if (!valid) { @@ -2368,7 +2370,8 @@ void register_visual_script_func_nodes() { Variant::Type t = Variant::Type(i); String type_name = Variant::get_type_name(t); Callable::CallError ce; - Variant vt = Variant::construct(t, nullptr, 0, ce); + Variant vt; + Variant::construct(t, vt, nullptr, 0, ce); List<MethodInfo> ml; vt.get_method_list(&ml); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 28122ade99..edec270adc 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -30,11 +30,11 @@ #include "visual_script_nodes.h" -#include "core/engine.h" -#include "core/global_constants.h" +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/core_constants.h" #include "core/input/input.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" @@ -828,7 +828,6 @@ PropertyInfo VisualScriptOperator::get_input_value_port_info(int p_idx) const { { Variant::NIL, Variant::NIL }, //OP_NEGATE, { Variant::NIL, Variant::NIL }, //OP_POSITIVE, { Variant::INT, Variant::INT }, //OP_MODULE, - { Variant::STRING, Variant::STRING }, //OP_STRING_CONCAT, //bitwise { Variant::INT, Variant::INT }, //OP_SHIFT_LEFT, { Variant::INT, Variant::INT }, //OP_SHIFT_RIGHT, @@ -873,7 +872,6 @@ PropertyInfo VisualScriptOperator::get_output_value_port_info(int p_idx) const { Variant::NIL, //OP_NEGATE, Variant::NIL, //OP_POSITIVE, Variant::INT, //OP_MODULE, - Variant::STRING, //OP_STRING_CONCAT, //bitwise Variant::INT, //OP_SHIFT_LEFT, Variant::INT, //OP_SHIFT_RIGHT, @@ -1433,7 +1431,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) { type = p_type; Callable::CallError ce; - value = Variant::construct(type, nullptr, 0, ce); + Variant::construct(type, value, nullptr, 0, ce); ports_changed_notify(); _change_notify(); } @@ -1756,7 +1754,7 @@ PropertyInfo VisualScriptGlobalConstant::get_input_value_port_info(int p_idx) co } PropertyInfo VisualScriptGlobalConstant::get_output_value_port_info(int p_idx) const { - String name = GlobalConstants::get_global_constant_name(index); + String name = CoreConstants::get_global_constant_name(index); return PropertyInfo(Variant::INT, name); } @@ -1780,7 +1778,7 @@ public: //virtual int get_working_memory_size() const { return 0; } virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { - *p_outputs[0] = GlobalConstants::get_global_constant_value(index); + *p_outputs[0] = CoreConstants::get_global_constant_value(index); return 0; } }; @@ -1797,11 +1795,11 @@ void VisualScriptGlobalConstant::_bind_methods() { String cc; - for (int i = 0; i < GlobalConstants::get_global_constant_count(); i++) { + for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) { if (i > 0) { cc += ","; } - cc += GlobalConstants::get_global_constant_name(i); + cc += CoreConstants::get_global_constant_name(i); } ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_global_constant", "get_global_constant"); } @@ -3257,7 +3255,7 @@ public: virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) { Callable::CallError ce; - *p_outputs[0] = Variant::construct(type, p_inputs, argcount, ce); + Variant::construct(type, *p_outputs[0], p_inputs, argcount, ce); if (ce.error != Callable::CallError::CALL_OK) { r_error_str = "Invalid arguments for constructor"; } @@ -3729,7 +3727,7 @@ void VisualScriptDeconstruct::_update_elements() { elements.clear(); Variant v; Callable::CallError ce; - v = Variant::construct(type, nullptr, 0, ce); + Variant::construct(type, v, nullptr, 0, ce); List<PropertyInfo> pinfo; v.get_property_list(&pinfo); @@ -3881,7 +3879,6 @@ void register_visual_script_nodes() { VisualScriptLanguage::singleton->add_register_func("operators/math/negate", create_op_node<Variant::OP_NEGATE>); VisualScriptLanguage::singleton->add_register_func("operators/math/positive", create_op_node<Variant::OP_POSITIVE>); VisualScriptLanguage::singleton->add_register_func("operators/math/remainder", create_op_node<Variant::OP_MODULE>); - VisualScriptLanguage::singleton->add_register_func("operators/math/string_concat", create_op_node<Variant::OP_STRING_CONCAT>); //bitwise VisualScriptLanguage::singleton->add_register_func("operators/bitwise/shift_left", create_op_node<Variant::OP_SHIFT_LEFT>); VisualScriptLanguage::singleton->add_register_func("operators/bitwise/shift_right", create_op_node<Variant::OP_SHIFT_RIGHT>); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index 3c44faab90..875270e74f 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -196,7 +196,7 @@ void VisualScriptPropertySelector::_update_search() { if (type != Variant::NIL) { Variant v; Callable::CallError ce; - v = Variant::construct(type, nullptr, 0, ce); + Variant::construct(type, v, nullptr, 0, ce); v.get_method_list(&methods); } else { Object *obj = ObjectDB::get_instance(script); diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 832e14d91a..2128b82e3f 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -30,9 +30,9 @@ #include "video_stream_webm.h" +#include "core/config/project_settings.h" #include "core/os/file_access.h" #include "core/os/os.h" -#include "core/project_settings.h" #include "servers/audio_server.h" #include "thirdparty/misc/yuv2rgb.h" diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index d5c80e7909..b169687f25 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -32,7 +32,7 @@ #include "core/io/marshalls.h" #include "core/os/os.h" -#include "core/print_string.h" +#include "core/string/print_string.h" #include <stdlib.h> #include <webp/decode.h> diff --git a/modules/webrtc/register_types.cpp b/modules/webrtc/register_types.cpp index 5b296b1ac6..0e830f0540 100644 --- a/modules/webrtc/register_types.cpp +++ b/modules/webrtc/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "webrtc_data_channel.h" #include "webrtc_peer_connection.h" diff --git a/modules/webrtc/webrtc_data_channel.cpp b/modules/webrtc/webrtc_data_channel.cpp index 7566532982..cd9e77aff8 100644 --- a/modules/webrtc/webrtc_data_channel.cpp +++ b/modules/webrtc/webrtc_data_channel.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "webrtc_data_channel.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" void WebRTCDataChannel::_bind_methods() { ClassDB::bind_method(D_METHOD("poll"), &WebRTCDataChannel::poll); diff --git a/modules/websocket/editor_debugger_server_websocket.cpp b/modules/websocket/editor_debugger_server_websocket.cpp index 95ea7ceafa..8eb975b323 100644 --- a/modules/websocket/editor_debugger_server_websocket.cpp +++ b/modules/websocket/editor_debugger_server_websocket.cpp @@ -30,7 +30,7 @@ #include "editor_debugger_server_websocket.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" #include "editor/editor_settings.h" #include "modules/websocket/remote_debugger_peer_websocket.h" diff --git a/modules/websocket/emws_client.cpp b/modules/websocket/emws_client.cpp index 7c31449709..93d60dca08 100644 --- a/modules/websocket/emws_client.cpp +++ b/modules/websocket/emws_client.cpp @@ -31,8 +31,8 @@ #ifdef JAVASCRIPT_ENABLED #include "emws_client.h" +#include "core/config/project_settings.h" #include "core/io/ip.h" -#include "core/project_settings.h" #include "emscripten.h" extern "C" { diff --git a/modules/websocket/emws_client.h b/modules/websocket/emws_client.h index ab8a0612bb..58973c52fa 100644 --- a/modules/websocket/emws_client.h +++ b/modules/websocket/emws_client.h @@ -33,7 +33,7 @@ #ifdef JAVASCRIPT_ENABLED -#include "core/error_list.h" +#include "core/error/error_list.h" #include "emws_peer.h" #include "websocket_client.h" diff --git a/modules/websocket/emws_peer.h b/modules/websocket/emws_peer.h index 9c00f2d58b..c94d7e9148 100644 --- a/modules/websocket/emws_peer.h +++ b/modules/websocket/emws_peer.h @@ -33,9 +33,9 @@ #ifdef JAVASCRIPT_ENABLED -#include "core/error_list.h" +#include "core/error/error_list.h" #include "core/io/packet_peer.h" -#include "core/ring_buffer.h" +#include "core/templates/ring_buffer.h" #include "emscripten.h" #include "packet_buffer.h" #include "websocket_peer.h" diff --git a/modules/websocket/emws_server.h b/modules/websocket/emws_server.h index bb6f35a711..1ce17855fe 100644 --- a/modules/websocket/emws_server.h +++ b/modules/websocket/emws_server.h @@ -33,7 +33,7 @@ #ifdef JAVASCRIPT_ENABLED -#include "core/reference.h" +#include "core/object/reference.h" #include "emws_peer.h" #include "websocket_server.h" diff --git a/modules/websocket/packet_buffer.h b/modules/websocket/packet_buffer.h index 9973efe297..18b47b8d50 100644 --- a/modules/websocket/packet_buffer.h +++ b/modules/websocket/packet_buffer.h @@ -32,7 +32,7 @@ #define PACKET_BUFFER_H #include "core/os/copymem.h" -#include "core/ring_buffer.h" +#include "core/templates/ring_buffer.h" template <class T> class PacketBuffer { diff --git a/modules/websocket/register_types.cpp b/modules/websocket/register_types.cpp index bc50de414e..8979a09619 100644 --- a/modules/websocket/register_types.cpp +++ b/modules/websocket/register_types.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "register_types.h" -#include "core/error_macros.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" +#include "core/error/error_macros.h" #ifdef JAVASCRIPT_ENABLED #include "emscripten.h" #include "emws_client.h" diff --git a/modules/websocket/remote_debugger_peer_websocket.cpp b/modules/websocket/remote_debugger_peer_websocket.cpp index a67a959e31..9a72e460e2 100644 --- a/modules/websocket/remote_debugger_peer_websocket.cpp +++ b/modules/websocket/remote_debugger_peer_websocket.cpp @@ -30,7 +30,7 @@ #include "remote_debugger_peer_websocket.h" -#include "core/project_settings.h" +#include "core/config/project_settings.h" Error RemoteDebuggerPeerWebSocket::connect_to_host(const String &p_uri) { Vector<String> protocols; diff --git a/modules/websocket/websocket_client.h b/modules/websocket/websocket_client.h index 1053be22e3..2966dc480b 100644 --- a/modules/websocket/websocket_client.h +++ b/modules/websocket/websocket_client.h @@ -32,7 +32,7 @@ #define WEBSOCKET_CLIENT_H #include "core/crypto/crypto.h" -#include "core/error_list.h" +#include "core/error/error_list.h" #include "websocket_multiplayer_peer.h" #include "websocket_peer.h" diff --git a/modules/websocket/websocket_multiplayer_peer.h b/modules/websocket/websocket_multiplayer_peer.h index af26aef21e..54daae23a6 100644 --- a/modules/websocket/websocket_multiplayer_peer.h +++ b/modules/websocket/websocket_multiplayer_peer.h @@ -31,9 +31,9 @@ #ifndef WEBSOCKET_MULTIPLAYER_PEER_H #define WEBSOCKET_MULTIPLAYER_PEER_H -#include "core/error_list.h" +#include "core/error/error_list.h" #include "core/io/networked_multiplayer_peer.h" -#include "core/list.h" +#include "core/templates/list.h" #include "websocket_peer.h" class WebSocketMultiplayerPeer : public NetworkedMultiplayerPeer { diff --git a/modules/websocket/websocket_peer.h b/modules/websocket/websocket_peer.h index a61943b615..729fdfd340 100644 --- a/modules/websocket/websocket_peer.h +++ b/modules/websocket/websocket_peer.h @@ -31,7 +31,7 @@ #ifndef WEBSOCKETPEER_H #define WEBSOCKETPEER_H -#include "core/error_list.h" +#include "core/error/error_list.h" #include "core/io/packet_peer.h" #include "websocket_macros.h" diff --git a/modules/websocket/websocket_server.h b/modules/websocket/websocket_server.h index 064ad4f179..34ae52a1ee 100644 --- a/modules/websocket/websocket_server.h +++ b/modules/websocket/websocket_server.h @@ -32,7 +32,7 @@ #define WEBSOCKET_H #include "core/crypto/crypto.h" -#include "core/reference.h" +#include "core/object/reference.h" #include "websocket_multiplayer_peer.h" #include "websocket_peer.h" diff --git a/modules/websocket/wsl_client.cpp b/modules/websocket/wsl_client.cpp index 7d16c2e99f..a2b81438df 100644 --- a/modules/websocket/wsl_client.cpp +++ b/modules/websocket/wsl_client.cpp @@ -31,8 +31,8 @@ #ifndef JAVASCRIPT_ENABLED #include "wsl_client.h" +#include "core/config/project_settings.h" #include "core/io/ip.h" -#include "core/project_settings.h" void WSLClient::_do_handshake() { if (_requested < _request.size() - 1) { diff --git a/modules/websocket/wsl_client.h b/modules/websocket/wsl_client.h index 8355a5a737..0141ea93ea 100644 --- a/modules/websocket/wsl_client.h +++ b/modules/websocket/wsl_client.h @@ -33,7 +33,7 @@ #ifndef JAVASCRIPT_ENABLED -#include "core/error_list.h" +#include "core/error/error_list.h" #include "core/io/stream_peer_ssl.h" #include "core/io/stream_peer_tcp.h" #include "websocket_client.h" diff --git a/modules/websocket/wsl_peer.h b/modules/websocket/wsl_peer.h index fe4abfb64c..35ac18615a 100644 --- a/modules/websocket/wsl_peer.h +++ b/modules/websocket/wsl_peer.h @@ -33,10 +33,10 @@ #ifndef JAVASCRIPT_ENABLED -#include "core/error_list.h" +#include "core/error/error_list.h" #include "core/io/packet_peer.h" #include "core/io/stream_peer_tcp.h" -#include "core/ring_buffer.h" +#include "core/templates/ring_buffer.h" #include "packet_buffer.h" #include "websocket_peer.h" #include "wslay/wslay.h" diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index da7bfc70c0..9a05967e4e 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -31,8 +31,8 @@ #ifndef JAVASCRIPT_ENABLED #include "wsl_server.h" +#include "core/config/project_settings.h" #include "core/os/os.h" -#include "core/project_settings.h" WSLServer::PendingPeer::PendingPeer() { use_ssl = false; diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index 6242009f67..65350518c3 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -30,7 +30,7 @@ #include "register_types.h" -#include "core/error_macros.h" +#include "core/error/error_macros.h" #include "core/crypto/crypto_core.h" |