diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/SCsub | 10 | ||||
-rw-r--r-- | modules/enet/networked_multiplayer_enet.cpp | 4 | ||||
-rw-r--r-- | modules/enet/networked_multiplayer_enet.h | 8 | ||||
-rw-r--r-- | modules/etc/SCsub | 3 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 12 | ||||
-rw-r--r-- | modules/gdscript/SCsub | 5 | ||||
-rw-r--r-- | modules/gdscript/register_types.cpp | 44 | ||||
-rw-r--r-- | modules/gridmap/SCsub | 5 | ||||
-rw-r--r-- | modules/gridmap/grid_map.cpp | 4 | ||||
-rw-r--r-- | modules/gridmap/grid_map.h | 5 | ||||
-rw-r--r-- | modules/mono/SCsub | 21 | ||||
-rw-r--r-- | modules/openssl/stream_peer_openssl.cpp | 8 | ||||
-rw-r--r-- | modules/thekla_unwrap/SCsub | 13 | ||||
-rw-r--r-- | modules/thekla_unwrap/register_types.cpp | 7 | ||||
-rw-r--r-- | modules/visual_script/SCsub | 5 |
15 files changed, 121 insertions, 33 deletions
diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index 7a37cca130..0967bca3f2 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -1,9 +1,13 @@ #!/usr/bin/env python Import('env') +Import('env_modules') # build only version 2 # Bullet 2.87 + +env_bullet = env_modules.Clone() + bullet_src__2_x = [ # BulletCollision "BulletCollision/BroadphaseCollision/btAxisSweep3.cpp" @@ -181,11 +185,11 @@ thirdparty_src = thirdparty_dir + "src/" bullet_sources = [thirdparty_src + file for file in bullet_src__2_x] # include headers -env.Append(CPPPATH=[thirdparty_src]) +env_bullet.Append(CPPPATH=[thirdparty_src]) -env.add_source_files(env.modules_sources, bullet_sources) +env_bullet.add_source_files(env.modules_sources, bullet_sources) # Godot source files -env.add_source_files(env.modules_sources, "*.cpp") +env_bullet.add_source_files(env.modules_sources, "*.cpp") Export('env') diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index ce485956b4..396bebf0ea 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -386,7 +386,7 @@ int NetworkedMultiplayerENet::get_available_packet_count() const { return incoming_packets.size(); } -Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buffer_size) const { +Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { ERR_FAIL_COND_V(incoming_packets.size() == 0, ERR_UNAVAILABLE); @@ -480,7 +480,7 @@ int NetworkedMultiplayerENet::get_max_packet_size() const { return 1 << 24; //anything is good } -void NetworkedMultiplayerENet::_pop_current_packet() const { +void NetworkedMultiplayerENet::_pop_current_packet() { if (current_packet.packet) { enet_packet_destroy(current_packet.packet); diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h index 81d517147d..d7bc5c7849 100644 --- a/modules/enet/networked_multiplayer_enet.h +++ b/modules/enet/networked_multiplayer_enet.h @@ -86,12 +86,12 @@ private: CompressionMode compression_mode; - mutable List<Packet> incoming_packets; + List<Packet> incoming_packets; - mutable Packet current_packet; + Packet current_packet; uint32_t _gen_unique_id() const; - void _pop_current_packet() const; + void _pop_current_packet(); Vector<uint8_t> src_compressor_mem; Vector<uint8_t> dst_compressor_mem; @@ -123,7 +123,7 @@ public: virtual bool is_server() const; virtual int get_available_packet_count() const; - virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) const; ///< buffer is GONE after next get_packet + virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size); ///< buffer is GONE after next get_packet virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size); virtual int get_max_packet_size() const; diff --git a/modules/etc/SCsub b/modules/etc/SCsub index 9c3e703f11..31d8f00ef3 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -34,7 +34,8 @@ env_etc.Append(CPPPATH=[thirdparty_dir]) env_etc.add_source_files(env.modules_sources, "*.cpp") # upstream uses c++11 -env_etc.Append(CCFLAGS="-std=gnu++11") +if (not env_etc.msvc): + env_etc.Append(CCFLAGS="-std=c++11") # -ffast-math seems to be incompatible with ec2comp on recent versions of # GCC and Clang if '-ffast-math' in env_etc['CCFLAGS']: diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 31f3b0b77b..b7b2553435 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -5533,6 +5533,12 @@ ] }, { + "name": "godot_get_stack_bottom", + "return_type": "void *", + "arguments": [ + ] + }, + { "name": "godot_method_bind_get_method", "return_type": "godot_method_bind *", "arguments": [ @@ -5569,6 +5575,12 @@ ] }, { + "name": "godot_get_global_constants", + "return_type": "godot_dictionary", + "arguments": [ + ] + }, + { "name": "godot_register_native_call_type", "return_type": "void", "arguments": [ diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub index 0882406761..13870170a5 100644 --- a/modules/gdscript/SCsub +++ b/modules/gdscript/SCsub @@ -1,7 +1,10 @@ #!/usr/bin/env python Import('env') +Import('env_modules') -env.add_source_files(env.modules_sources, "*.cpp") +env_gdscript = env_modules.Clone() + +env_gdscript.add_source_files(env.modules_sources, "*.cpp") Export('env') diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 1e007ddb0f..e707032ed8 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -30,6 +30,7 @@ #include "register_types.h" #include "gdscript.h" +#include "gdscript_tokenizer.h" #include "io/file_access_encrypted.h" #include "io/resource_loader.h" #include "os/file_access.h" @@ -38,6 +39,45 @@ GDScriptLanguage *script_language_gd = NULL; ResourceFormatLoaderGDScript *resource_loader_gd = NULL; ResourceFormatSaverGDScript *resource_saver_gd = NULL; +#ifdef TOOLS_ENABLED + +#include "editor/editor_export.h" +#include "editor/editor_node.h" +#include "editor/editor_settings.h" + +class EditorExportGDScript : public EditorExportPlugin { + + GDCLASS(EditorExportGDScript, EditorExportPlugin); + +public: + virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features) { + + if (!p_path.ends_with(".gd")) + return; + + Vector<uint8_t> file = FileAccess::get_file_as_array(p_path); + if (file.empty()) + return; + String txt; + txt.parse_utf8((const char *)file.ptr(), file.size()); + file = GDScriptTokenizerBuffer::parse_code_string(txt); + + if (file.empty()) + return; + + add_file(p_path.get_basename() + ".gdc", file, true); + } +}; + +static void _editor_init() { + + Ref<EditorExportGDScript> gd_export; + gd_export.instance(); + EditorExport::get_singleton()->add_export_plugin(gd_export); +} + +#endif + void register_gdscript_types() { ClassDB::register_class<GDScript>(); @@ -49,6 +89,10 @@ void register_gdscript_types() { ResourceLoader::add_resource_format_loader(resource_loader_gd); resource_saver_gd = memnew(ResourceFormatSaverGDScript); ResourceSaver::add_resource_format_saver(resource_saver_gd); + +#ifdef TOOLS_ENABLED + EditorNode::add_init_callback(_editor_init); +#endif } void unregister_gdscript_types() { diff --git a/modules/gridmap/SCsub b/modules/gridmap/SCsub index 0882406761..2ffe15cd33 100644 --- a/modules/gridmap/SCsub +++ b/modules/gridmap/SCsub @@ -1,7 +1,10 @@ #!/usr/bin/env python Import('env') +Import('env_modules') -env.add_source_files(env.modules_sources, "*.cpp") +env_gridmap = env_modules.Clone() + +env_gridmap.add_source_files(env.modules_sources, "*.cpp") Export('env') diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index b3a1947647..bebf8bcf8f 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -469,7 +469,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { nm.xform = xform; if (navigation) { - nm.id = navigation->navmesh_create(navmesh, xform, this); + nm.id = navigation->navmesh_add(navmesh, xform, this); } else { nm.id = -1; } @@ -556,7 +556,7 @@ void GridMap::_octant_enter_world(const OctantKey &p_key) { if (cell_map.has(F->key()) && F->get().id < 0) { Ref<NavigationMesh> nm = theme->get_item_navmesh(cell_map[F->key()].item); if (nm.is_valid()) { - F->get().id = navigation->navmesh_create(nm, F->get().xform, this); + F->get().id = navigation->navmesh_add(nm, F->get().xform, this); } } } diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 5bfdf1dac3..ab66bf123e 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -186,6 +186,11 @@ class GridMap : public Spatial { Vector3 _get_offset() const; + struct BakedMesh { + Ref<Mesh> mesh; + Transform transform; + }; + protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; diff --git a/modules/mono/SCsub b/modules/mono/SCsub index 18a20ecac4..320bbe7090 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -1,6 +1,9 @@ #!/usr/bin/env python Import('env') +Import('env_modules') + +env_mono = env_modules.Clone() from compat import byte_to_str @@ -43,12 +46,12 @@ def make_cs_files_header(src, dst): header.write('#endif // _CS_FILES_DATA_H') -env.add_source_files(env.modules_sources, '*.cpp') -env.add_source_files(env.modules_sources, 'mono_gd/*.cpp') -env.add_source_files(env.modules_sources, 'utils/*.cpp') +env_mono.add_source_files(env.modules_sources, '*.cpp') +env_mono.add_source_files(env.modules_sources, 'mono_gd/*.cpp') +env_mono.add_source_files(env.modules_sources, 'utils/*.cpp') if env['tools']: - env.add_source_files(env.modules_sources, 'editor/*.cpp') + env_mono.add_source_files(env.modules_sources, 'editor/*.cpp') make_cs_files_header('glue/cs_files', 'glue/cs_compressed.gen.h') vars = Variables() @@ -58,12 +61,12 @@ vars.Update(env) # Glue sources if env['mono_glue']: - env.add_source_files(env.modules_sources, 'glue/*.cpp') + env_mono.add_source_files(env.modules_sources, 'glue/*.cpp') else: - env.Append(CPPDEFINES=['MONO_GLUE_DISABLED']) + env_mono.Append(CPPDEFINES=['MONO_GLUE_DISABLED']) if ARGUMENTS.get('yolo_copy', False): - env.Append(CPPDEFINES=['YOLO_COPY']) + env_mono.Append(CPPDEFINES=['YOLO_COPY']) # Build GodotSharpTools solution @@ -201,8 +204,8 @@ def mono_build_solution(source, target, env): mono_sln_builder = Builder(action = mono_build_solution) -env.Append(BUILDERS={'MonoBuildSolution': mono_sln_builder}) -env.MonoBuildSolution( +env_mono.Append(BUILDERS={'MonoBuildSolution': mono_sln_builder}) +env_mono.MonoBuildSolution( os.path.join(Dir('#bin').abspath, 'GodotSharpTools.dll'), 'editor/GodotSharpTools/GodotSharpTools.sln' ) diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp index 6d1d5485f3..7e8b308cf8 100644 --- a/modules/openssl/stream_peer_openssl.cpp +++ b/modules/openssl/stream_peer_openssl.cpp @@ -412,8 +412,12 @@ void StreamPeerOpenSSL::_print_error(int err) { err = SSL_get_error(ssl, err); switch (err) { - case SSL_ERROR_NONE: ERR_PRINT("NO ERROR: The TLS/SSL I/O operation completed"); break; - case SSL_ERROR_ZERO_RETURN: ERR_PRINT("The TLS/SSL connection has been closed."); + case SSL_ERROR_NONE: + ERR_PRINT("NO ERROR: The TLS/SSL I/O operation completed"); + break; + case SSL_ERROR_ZERO_RETURN: + ERR_PRINT("The TLS/SSL connection has been closed."); + break; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: ERR_PRINT("The operation did not complete."); diff --git a/modules/thekla_unwrap/SCsub b/modules/thekla_unwrap/SCsub index 1d4b086848..c57bf326ea 100644 --- a/modules/thekla_unwrap/SCsub +++ b/modules/thekla_unwrap/SCsub @@ -56,14 +56,19 @@ if env['builtin_thekla_atlas']: env_thekla_unwrap.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/poshlib", thirdparty_dir + "/nvcore", thirdparty_dir + "/nvmesh"]) # upstream uses c++11 - env_thekla_unwrap.Append(CXXFLAGS="-std=gnu++11") + if (not env_thekla_unwrap.msvc): + env_thekla_unwrap.Append(CXXFLAGS="-std=c++11") if env["platform"] == 'x11': - env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX"]) + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"]) elif env["platform"] == 'osx': - env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN"]) + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"]) elif env["platform"] == 'windows': - env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32"]) + if env.msvc: + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ]) + else: + env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"]) + env.Append(LIBS=["dbghelp"]) # Godot source files env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/thekla_unwrap/register_types.cpp b/modules/thekla_unwrap/register_types.cpp index 01b834f8cb..ab3203068f 100644 --- a/modules/thekla_unwrap/register_types.cpp +++ b/modules/thekla_unwrap/register_types.cpp @@ -42,7 +42,7 @@ bool thekla_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver input_mesh.face_array[i].vertex_index[0] = p_indices[i * 3 + 0]; input_mesh.face_array[i].vertex_index[1] = p_indices[i * 3 + 1]; input_mesh.face_array[i].vertex_index[2] = p_indices[i * 3 + 2]; - printf("face %i - %i, %i, %i - mat %i\n", i, input_mesh.face_array[i].vertex_index[0], input_mesh.face_array[i].vertex_index[1], input_mesh.face_array[i].vertex_index[2], p_face_materials[i]); + //printf("face %i - %i, %i, %i - mat %i\n", i, input_mesh.face_array[i].vertex_index[0], input_mesh.face_array[i].vertex_index[1], input_mesh.face_array[i].vertex_index[2], p_face_materials[i]); input_mesh.face_array[i].material_index = p_face_materials[i]; } input_mesh.vertex_array = new Thekla::Atlas_Input_Vertex[p_vertex_count]; @@ -54,8 +54,8 @@ bool thekla_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver } input_mesh.vertex_array[i].uv[0] = 0; input_mesh.vertex_array[i].uv[1] = 0; - printf("vertex %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].position[0], input_mesh.vertex_array[i].position[1], input_mesh.vertex_array[i].position[2]); - printf("normal %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].normal[0], input_mesh.vertex_array[i].normal[1], input_mesh.vertex_array[i].normal[2]); + //printf("vertex %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].position[0], input_mesh.vertex_array[i].position[1], input_mesh.vertex_array[i].position[2]); + //printf("normal %i - %f, %f, %f\n", i, input_mesh.vertex_array[i].normal[0], input_mesh.vertex_array[i].normal[1], input_mesh.vertex_array[i].normal[2]); } input_mesh.face_count = p_index_count / 3; input_mesh.vertex_count = p_vertex_count; @@ -65,6 +65,7 @@ bool thekla_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver Thekla::atlas_set_default_options(&options); options.packer_options.witness.packing_quality = 1; options.packer_options.witness.texel_area = 1.0 / p_texel_size; + options.packer_options.witness.conservative = true; //generate Thekla::Atlas_Error err; diff --git a/modules/visual_script/SCsub b/modules/visual_script/SCsub index 0882406761..96ee911ba0 100644 --- a/modules/visual_script/SCsub +++ b/modules/visual_script/SCsub @@ -1,7 +1,10 @@ #!/usr/bin/env python Import('env') +Import('env_modules') -env.add_source_files(env.modules_sources, "*.cpp") +env_vs = env_modules.Clone() + +env_vs.add_source_files(env.modules_sources, "*.cpp") Export('env') |