diff options
Diffstat (limited to 'modules')
51 files changed, 134 insertions, 119 deletions
diff --git a/modules/basis_universal/texture_basisu.cpp b/modules/basis_universal/texture_basisu.cpp index 2ed0340927..5831d3de2a 100644 --- a/modules/basis_universal/texture_basisu.cpp +++ b/modules/basis_universal/texture_basisu.cpp @@ -39,44 +39,36 @@ #include <transcoder/basisu_transcoder.h> void TextureBasisU::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_basisu_data", "data"), &TextureBasisU::set_basisu_data); ClassDB::bind_method(D_METHOD("get_basisu_data"), &TextureBasisU::get_data); ClassDB::bind_method(D_METHOD("import"), &TextureBasisU::import); ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "basisu_data"), "set_basisu_data", "get_basisu_data"); - }; int TextureBasisU::get_width() const { - return tex_size.x; }; int TextureBasisU::get_height() const { - return tex_size.y; }; RID TextureBasisU::get_rid() const { - return texture; }; bool TextureBasisU::has_alpha() const { - return false; }; void TextureBasisU::set_flags(uint32_t p_flags) { - flags = p_flags; RenderingServer::get_singleton()->texture_set_flags(texture, p_flags); }; uint32_t TextureBasisU::get_flags() const { - return flags; }; @@ -95,12 +87,10 @@ void TextureBasisU::set_basisu_data(const Vector<uint8_t>& p_data) { Image::Format imgfmt; if (OS::get_singleton()->has_feature("s3tc")) { - format = basist::cTFBC3; // get this from renderer imgfmt = Image::FORMAT_DXT5; } else if (OS::get_singleton()->has_feature("etc2")) { - format = basist::cTFETC2; imgfmt = Image::FORMAT_ETC2_RGBA8; }; @@ -126,7 +116,6 @@ void TextureBasisU::set_basisu_data(const Vector<uint8_t>& p_data) { int ofs = 0; tr.start_transcoding(ptr, size); for (int i=0; i<info.m_total_levels; i++) { - basist::basisu_image_level_info level; tr.get_image_level_info(ptr, size, level, 0, i); @@ -214,19 +203,16 @@ Error TextureBasisU::import(const Ref<Image>& p_img) { Vector<uint8_t> TextureBasisU::get_basisu_data() const { - return data; }; TextureBasisU::TextureBasisU() { - flags = FLAGS_DEFAULT; texture = RenderingServer::get_singleton()->texture_create(); }; TextureBasisU::~TextureBasisU() { - RenderingServer::get_singleton()->free(texture); }; diff --git a/modules/basis_universal/texture_basisu.h b/modules/basis_universal/texture_basisu.h index 20ecf15a59..99248f9162 100644 --- a/modules/basis_universal/texture_basisu.h +++ b/modules/basis_universal/texture_basisu.h @@ -41,7 +41,6 @@ #if 0 class TextureBasisU : public Texture { - GDCLASS(TextureBasisU, Texture); RES_BASE_EXTENSION("butex"); @@ -74,7 +73,6 @@ public: TextureBasisU(); ~TextureBasisU(); - }; #endif diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index f7290666ad..663ad6e3e1 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -1553,9 +1553,6 @@ void BulletPhysicsServer3D::step(float p_deltaTime) { } } -void BulletPhysicsServer3D::sync() { -} - void BulletPhysicsServer3D::flush_queries() { if (!active) { return; diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h index 02ba5458d8..dca9339c44 100644 --- a/modules/bullet/bullet_physics_server.h +++ b/modules/bullet/bullet_physics_server.h @@ -397,7 +397,6 @@ public: virtual void init() override; virtual void step(float p_deltaTime) override; - virtual void sync() override; virtual void flush_queries() override; virtual void finish() override; diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 2f4f7d7a4c..627153fbc8 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -373,7 +373,6 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, int colcount = size/4; for(int i=0;i<colcount;i++) { - uint8_t r = wb[i*4+1]; uint8_t g = wb[i*4+2]; uint8_t b = wb[i*4+3]; @@ -392,7 +391,6 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, int colcount = size/3; for(int i=0;i<colcount;i++) { - SWAP( wb[i*3+0],wb[i*3+2] ); }*/ } break; diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index 6cac2458f9..4e9e64c6a7 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -106,7 +106,6 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f // If VRAM compression is using ETC, but image has alpha, convert to RGBA4444 or LA8 // This saves space while maintaining the alpha channel if (detected_channels == Image::USED_CHANNELS_RGBA) { - if (p_img->has_mipmaps()) { // Image doesn't support mipmaps with RGBA4444 textures p_img->clear_mipmaps(); @@ -114,7 +113,6 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f p_img->convert(Image::FORMAT_RGBA4444); return; } else if (detected_channels == Image::USE_CHANNELS_LA) { - p_img->convert(Image::FORMAT_LA8); return; } diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 825033c99c..cc12d58037 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -85,7 +85,6 @@ typedef enum { } godot_nativescript_property_hint; typedef enum { - GODOT_PROPERTY_USAGE_STORAGE = 1, GODOT_PROPERTY_USAGE_EDITOR = 2, GODOT_PROPERTY_USAGE_NETWORK = 4, diff --git a/modules/gdnative/tests/test_string.h b/modules/gdnative/tests/test_string.h index aeb855a1c4..2b1aa5bf28 100644 --- a/modules/gdnative/tests/test_string.h +++ b/modules/gdnative/tests/test_string.h @@ -1974,7 +1974,6 @@ TEST_CASE("[GDNative String] humanize_size") { CHECK(u32scmp(godot_string_get_data(&s), U"4.97 GiB") == 0); godot_string_destroy(&s); } - } // namespace TestGDNativeString #endif // TEST_GDNATIVE_STRING_H diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index bad450c9f9..a64a05fcba 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1963,6 +1963,8 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar } p_script->member_indices = base->member_indices; + native = base->native; + p_script->native = native; } break; default: { _set_error("Parser bug: invalid inheritance.", p_class); diff --git a/modules/gdscript/language_server/lsp.hpp b/modules/gdscript/language_server/lsp.hpp index bf32c1c978..288fd41c87 100644 --- a/modules/gdscript/language_server/lsp.hpp +++ b/modules/gdscript/language_server/lsp.hpp @@ -1781,7 +1781,6 @@ static String marked_documentation(const String &p_bbcode) { } return markdown; } - } // namespace lsp #endif diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index 50b3783388..643c2f10a2 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -303,5 +303,4 @@ void test(TestType p_type) { ScriptServer::finish_languages(); memdelete(packed_data); } - } // namespace TestGDScript diff --git a/modules/gdscript/tests/test_gdscript.h b/modules/gdscript/tests/test_gdscript.h index 5aa962dcf8..6182629802 100644 --- a/modules/gdscript/tests/test_gdscript.h +++ b/modules/gdscript/tests/test_gdscript.h @@ -41,7 +41,6 @@ enum TestType { }; void test(TestType p_type); - } // namespace TestGDScript #endif // TEST_GDSCRIPT_H diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index ee17a52d31..69c8d999fd 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -41,12 +41,10 @@ class GridMapEditor : public VBoxContainer { GDCLASS(GridMapEditor, VBoxContainer); enum { - GRID_CURSOR_SIZE = 50 }; enum InputAction { - INPUT_NONE, INPUT_PAINT, INPUT_ERASE, @@ -56,7 +54,6 @@ class GridMapEditor : public VBoxContainer { }; enum ClipMode { - CLIP_DISABLED, CLIP_ABOVE, CLIP_BELOW @@ -158,7 +155,6 @@ class GridMapEditor : public VBoxContainer { int cursor_rot; enum Menu { - MENU_OPTION_NEXT_LEVEL, MENU_OPTION_PREV_LEVEL, MENU_OPTION_LOCK_VIEW, diff --git a/modules/mono/build_scripts/make_android_mono_config.py b/modules/mono/build_scripts/make_android_mono_config.py index d276d7d886..04f8c80243 100644 --- a/modules/mono/build_scripts/make_android_mono_config.py +++ b/modules/mono/build_scripts/make_android_mono_config.py @@ -32,7 +32,6 @@ namespace { static const int config_compressed_size = %d; static const int config_uncompressed_size = %d; static const unsigned char config_compressed_data[] = { %s }; - } // namespace String get_godot_android_mono_config() { diff --git a/modules/mono/editor/code_completion.cpp b/modules/mono/editor/code_completion.cpp index 9defd65190..f1919c2501 100644 --- a/modules/mono/editor/code_completion.cpp +++ b/modules/mono/editor/code_completion.cpp @@ -246,5 +246,4 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr return suggestions; } - } // namespace gdmono diff --git a/modules/mono/editor/code_completion.h b/modules/mono/editor/code_completion.h index b9d22de0b3..c2a33a9133 100644 --- a/modules/mono/editor/code_completion.h +++ b/modules/mono/editor/code_completion.h @@ -50,7 +50,6 @@ enum class CompletionKind { }; PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_script_file); - } // namespace gdmono #endif // CODE_COMPLETION_H diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp index 4fa753ab8b..1a0d5743ae 100644 --- a/modules/mono/editor/godotsharp_export.cpp +++ b/modules/mono/editor/godotsharp_export.cpp @@ -141,5 +141,4 @@ Error get_exported_assembly_dependencies(const Dictionary &p_initial_assemblies, return OK; } - } // namespace GodotSharpExport diff --git a/modules/mono/editor/godotsharp_export.h b/modules/mono/editor/godotsharp_export.h index bd0f86a74b..586d4e5a0c 100644 --- a/modules/mono/editor/godotsharp_export.h +++ b/modules/mono/editor/godotsharp_export.h @@ -43,7 +43,6 @@ Error get_assembly_dependencies(GDMonoAssembly *p_assembly, const Vector<String> Error get_exported_assembly_dependencies(const Dictionary &p_initial_assemblies, const String &p_build_config, const String &p_custom_lib_dir, Dictionary &r_assembly_dependencies); - } // namespace GodotSharpExport #endif // GODOTSHARP_EXPORT_H diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs index d0add835c0..90141928ca 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs @@ -337,8 +337,8 @@ namespace Godot } /// <summary> - /// Returns the color's 32-bit integer in ABGR format - /// (each byte represents a component of the ABGR profile). + /// Returns the color converted to an unsigned 32-bit integer in ABGR + /// format (each byte represents a color channel). /// ABGR is the reversed version of the default format. /// </summary> /// <returns>A uint representing this color in ABGR32 format.</returns> @@ -356,8 +356,8 @@ namespace Godot } /// <summary> - /// Returns the color's 64-bit integer in ABGR format - /// (each word represents a component of the ABGR profile). + /// Returns the color converted to an unsigned 64-bit integer in ABGR + /// format (each word represents a color channel). /// ABGR is the reversed version of the default format. /// </summary> /// <returns>A ulong representing this color in ABGR64 format.</returns> @@ -375,8 +375,8 @@ namespace Godot } /// <summary> - /// Returns the color's 32-bit integer in ARGB format - /// (each byte represents a component of the ARGB profile). + /// Returns the color converted to an unsigned 32-bit integer in ARGB + /// format (each byte represents a color channel). /// ARGB is more compatible with DirectX, but not used much in Godot. /// </summary> /// <returns>A uint representing this color in ARGB32 format.</returns> @@ -394,8 +394,8 @@ namespace Godot } /// <summary> - /// Returns the color's 64-bit integer in ARGB format - /// (each word represents a component of the ARGB profile). + /// Returns the color converted to an unsigned 64-bit integer in ARGB + /// format (each word represents a color channel). /// ARGB is more compatible with DirectX, but not used much in Godot. /// </summary> /// <returns>A ulong representing this color in ARGB64 format.</returns> @@ -413,8 +413,8 @@ namespace Godot } /// <summary> - /// Returns the color's 32-bit integer in RGBA format - /// (each byte represents a component of the RGBA profile). + /// Returns the color converted to an unsigned 32-bit integer in RGBA + /// format (each byte represents a color channel). /// RGBA is Godot's default and recommended format. /// </summary> /// <returns>A uint representing this color in RGBA32 format.</returns> @@ -432,8 +432,8 @@ namespace Godot } /// <summary> - /// Returns the color's 64-bit integer in RGBA format - /// (each word represents a component of the RGBA profile). + /// Returns the color converted to an unsigned 64-bit integer in RGBA + /// format (each word represents a color channel). /// RGBA is Godot's default and recommended format. /// </summary> /// <returns>A ulong representing this color in RGBA64 format.</returns> @@ -472,7 +472,7 @@ namespace Godot } /// <summary> - /// Constructs a color from RGBA values on the range of 0 to 1. + /// Constructs a color from RGBA values, typically on the range of 0 to 1. /// </summary> /// <param name="r">The color's red component, typically on the range of 0 to 1.</param> /// <param name="g">The color's green component, typically on the range of 0 to 1.</param> @@ -500,8 +500,8 @@ namespace Godot } /// <summary> - /// Constructs a color from a 32-bit integer - /// (each byte represents a component of the RGBA profile). + /// Constructs a color from an unsigned 32-bit integer in RGBA format + /// (each byte represents a color channel). /// </summary> /// <param name="rgba">The uint representing the color.</param> public Color(uint rgba) @@ -516,8 +516,8 @@ namespace Godot } /// <summary> - /// Constructs a color from a 64-bit integer - /// (each word represents a component of the RGBA profile). + /// Constructs a color from an unsigned 64-bit integer in RGBA format + /// (each word represents a color channel). /// </summary> /// <param name="rgba">The ulong representing the color.</param> public Color(ulong rgba) @@ -777,31 +777,10 @@ namespace Godot return ParseCol4(str, ofs) * 16 + ParseCol4(str, ofs + 1); } - private String ToHex32(float val) + private string ToHex32(float val) { - int v = Mathf.RoundToInt(Mathf.Clamp(val * 255, 0, 255)); - - var ret = string.Empty; - - for (int i = 0; i < 2; i++) - { - char c; - int lv = v & 0xF; - - if (lv < 10) - { - c = (char)('0' + lv); - } - else - { - c = (char)('a' + lv - 10); - } - - v >>= 4; - ret = c + ret; - } - - return ret; + byte b = (byte)Mathf.RoundToInt(Mathf.Clamp(val * 255, 0, 255)); + return b.HexEncode(); } internal static bool HtmlIsValid(string color) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs index d63db0f905..0700f197ff 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs @@ -322,6 +322,15 @@ namespace Godot return instance.IndexOf(what, from, caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); } + /// <summary>Find the first occurrence of a char. Optionally, the search starting position can be passed.</summary> + /// <returns>The first instance of the char, or -1 if not found.</returns> + public static int Find(this string instance, char what, int from = 0, bool caseSensitive = true) + { + // TODO: Could be more efficient if we get a char version of `IndexOf`. + // See https://github.com/dotnet/runtime/issues/44116 + return instance.IndexOf(what.ToString(), from, caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); + } + /// <summary>Find the last occurrence of a substring.</summary> /// <returns>The starting position of the substring, or -1 if not found.</returns> public static int FindLast(this string instance, string what, bool caseSensitive = true) @@ -437,6 +446,53 @@ namespace Godot return hashv; } + /// <summary> + /// Returns a hexadecimal representation of this byte as a string. + /// </summary> + /// <param name="bytes">The byte to encode.</param> + /// <returns>The hexadecimal representation of this byte.</returns> + internal static string HexEncode(this byte b) + { + var ret = string.Empty; + + for (int i = 0; i < 2; i++) + { + char c; + int lv = b & 0xF; + + if (lv < 10) + { + c = (char)('0' + lv); + } + else + { + c = (char)('a' + lv - 10); + } + + b >>= 4; + ret = c + ret; + } + + return ret; + } + + /// <summary> + /// Returns a hexadecimal representation of this byte array as a string. + /// </summary> + /// <param name="bytes">The byte array to encode.</param> + /// <returns>The hexadecimal representation of this byte array.</returns> + public static string HexEncode(this byte[] bytes) + { + var ret = string.Empty; + + foreach (byte b in bytes) + { + ret += b.HexEncode(); + } + + return ret; + } + // <summary> // Convert a string containing an hexadecimal number into an int. // </summary> @@ -659,6 +715,33 @@ namespace Godot } /// <summary> + /// Returns a copy of the string with characters removed from the left. + /// </summary> + /// <param name="instance">The string to remove characters from.</param> + /// <param name="chars">The characters to be removed.</param> + /// <returns>A copy of the string with characters removed from the left.</returns> + public static string LStrip(this string instance, string chars) + { + int len = instance.Length; + int beg; + + for (beg = 0; beg < len; beg++) + { + if (chars.Find(instance[beg]) == -1) + { + break; + } + } + + if (beg == 0) + { + return instance; + } + + return instance.Substr(beg, len - beg); + } + + /// <summary> /// Do a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'. /// </summary> private static bool ExprMatch(this string instance, string expr, bool caseSensitive) @@ -886,6 +969,33 @@ namespace Godot return instance.Substring(pos, instance.Length - pos); } + /// <summary> + /// Returns a copy of the string with characters removed from the right. + /// </summary> + /// <param name="instance">The string to remove characters from.</param> + /// <param name="chars">The characters to be removed.</param> + /// <returns>A copy of the string with characters removed from the right.</returns> + public static string RStrip(this string instance, string chars) + { + int len = instance.Length; + int end; + + for (end = len - 1; end >= 0; end--) + { + if (chars.Find(instance[end]) == -1) + { + break; + } + } + + if (end == len - 1) + { + return instance; + } + + return instance.Substr(0, end + 1); + } + public static byte[] SHA256Buffer(this string instance) { return godot_icall_String_sha256_buffer(instance); diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index 4233732bff..093a935288 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -322,5 +322,4 @@ String get_data_mono_bin_dir() { return _GodotSharpDirs::get_singleton().data_mono_bin_dir; } #endif - } // namespace GodotSharpDirs diff --git a/modules/mono/godotsharp_dirs.h b/modules/mono/godotsharp_dirs.h index 6391616419..85be506c28 100644 --- a/modules/mono/godotsharp_dirs.h +++ b/modules/mono/godotsharp_dirs.h @@ -66,7 +66,6 @@ String get_data_mono_lib_dir(); #ifdef WINDOWS_ENABLED String get_data_mono_bin_dir(); #endif - } // namespace GodotSharpDirs #endif // GODOTSHARP_DIRS_H diff --git a/modules/mono/mono_gc_handle.h b/modules/mono/mono_gc_handle.h index 5c3a210e97..b85dc70af3 100644 --- a/modules/mono/mono_gc_handle.h +++ b/modules/mono/mono_gc_handle.h @@ -42,7 +42,6 @@ enum class GCHandleType : char { STRONG_HANDLE, WEAK_HANDLE }; - } // Manual release of the GC handle must be done when using this struct diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 0e335b3349..772961291c 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -201,7 +201,6 @@ MonoDomain *gd_initialize_mono_runtime() { return mono_jit_init_version("GodotEngine.RootDomain", runtime_version); } #endif - } // namespace void GDMono::add_mono_shared_libs_dir_to_path() { diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index 18f7418049..969296c44d 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -283,7 +283,6 @@ public: } } }; - } // namespace gdmono #define _GDMONO_SCOPE_DOMAIN_(m_mono_domain) \ diff --git a/modules/mono/mono_gd/gd_mono_cache.cpp b/modules/mono/mono_gd/gd_mono_cache.cpp index 29aef6e609..3f51c6523b 100644 --- a/modules/mono/mono_gd/gd_mono_cache.cpp +++ b/modules/mono/mono_gd/gd_mono_cache.cpp @@ -316,5 +316,4 @@ void update_godot_api_cache() { cached_data.godot_api_cache_updated = true; } - } // namespace GDMonoCache diff --git a/modules/mono/mono_gd/gd_mono_cache.h b/modules/mono/mono_gd/gd_mono_cache.h index a7bbc763a7..9dfa5769be 100644 --- a/modules/mono/mono_gd/gd_mono_cache.h +++ b/modules/mono/mono_gd/gd_mono_cache.h @@ -181,7 +181,6 @@ inline void clear_corlib_cache() { inline void clear_godot_api_cache() { cached_data.clear_godot_api_cache(); } - } // namespace GDMonoCache #define CACHED_CLASS(m_class) (GDMonoCache::cached_data.class_##m_class) diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index 0ed9e441ef..82f916e8c5 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -127,5 +127,4 @@ void unhandled_exception(MonoException *p_exc) { #endif } } - } // namespace GDMonoInternals diff --git a/modules/mono/mono_gd/gd_mono_internals.h b/modules/mono/mono_gd/gd_mono_internals.h index d1d5eca263..0fd6250785 100644 --- a/modules/mono/mono_gd/gd_mono_internals.h +++ b/modules/mono/mono_gd/gd_mono_internals.h @@ -46,7 +46,6 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged); * Use GDMonoUtils::debug_unhandled_exception(MonoException *) instead. */ void unhandled_exception(MonoException *p_exc); - } // namespace GDMonoInternals #endif // GD_MONO_INTERNALS_H diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 9d193ab8ab..eee880ba60 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -1536,5 +1536,4 @@ M_SignalInfo signal_info_to_managed(const Signal &p_signal) { MonoObject *name_string_name_managed = GDMonoUtils::create_managed_from(p_signal.get_name()); return { owner_managed, name_string_name_managed }; } - } // namespace GDMonoMarshal diff --git a/modules/mono/mono_gd/gd_mono_marshal.h b/modules/mono/mono_gd/gd_mono_marshal.h index d2c564d67d..d1d5f1f202 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.h +++ b/modules/mono/mono_gd/gd_mono_marshal.h @@ -271,7 +271,6 @@ static_assert(MATCHES_Vector2 && MATCHES_Rect2 && MATCHES_Transform2D && MATCHES MATCHES_Plane && MATCHES_Vector2i && MATCHES_Rect2i && MATCHES_Vector3i); /* clang-format on */ #endif - } // namespace InteropLayout #pragma pack(push, 1) @@ -517,7 +516,6 @@ DECL_TYPE_MARSHAL_TEMPLATES(Plane) #define MARSHALLED_IN(m_type, m_from_ptr) (GDMonoMarshal::marshalled_in_##m_type(m_from_ptr)) #define MARSHALLED_OUT(m_type, m_from) (GDMonoMarshal::marshalled_out_##m_type(m_from)) - } // namespace GDMonoMarshal #endif // GDMONOMARSHAL_H diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index 2676165cbc..97fc4c57f9 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -659,7 +659,6 @@ GDMonoClass *make_generic_dictionary_type(MonoReflectionType *p_key_reftype, Mon UNHANDLED_EXCEPTION(exc); return GDMono::get_singleton()->get_class(mono_class_from_mono_type(mono_reflection_type_get_type(reftype))); } - } // namespace Marshal ScopeThreadAttach::ScopeThreadAttach() { @@ -679,5 +678,4 @@ StringName get_native_godot_class_name(GDMonoClass *p_class) { StringName *ptr = GDMonoMarshal::unbox<StringName *>(CACHED_FIELD(StringName, ptr)->get_value(native_name_obj)); return ptr ? *ptr : StringName(); } - } // namespace GDMonoUtils diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index 7088385c4f..71c131f77c 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -64,7 +64,6 @@ void dictionary_get_key_value_types(MonoReflectionType *p_dict_reftype, MonoRefl GDMonoClass *make_generic_array_type(MonoReflectionType *p_elem_reftype); GDMonoClass *make_generic_dictionary_type(MonoReflectionType *p_key_reftype, MonoReflectionType *p_value_reftype); - } // namespace Marshal _FORCE_INLINE_ void hash_combine(uint32_t &p_hash, const uint32_t &p_with_hash) { @@ -156,7 +155,6 @@ private: }; StringName get_native_godot_class_name(GDMonoClass *p_class); - } // namespace GDMonoUtils #define NATIVE_GDMONOCLASS_NAME(m_class) (GDMonoUtils::get_native_godot_class_name(m_class)) diff --git a/modules/mono/mono_gd/support/android_support.cpp b/modules/mono/mono_gd/support/android_support.cpp index 386e0576b3..18daf859b5 100644 --- a/modules/mono/mono_gd/support/android_support.cpp +++ b/modules/mono/mono_gd/support/android_support.cpp @@ -387,7 +387,6 @@ void cleanup() { certStore = nullptr; } } - } // namespace support } // namespace android } // namespace gdmono diff --git a/modules/mono/mono_gd/support/android_support.h b/modules/mono/mono_gd/support/android_support.h index 5947395a99..df51100bef 100755 --- a/modules/mono/mono_gd/support/android_support.h +++ b/modules/mono/mono_gd/support/android_support.h @@ -45,7 +45,6 @@ void initialize(); void cleanup(); void register_internal_calls(); - } // namespace support } // namespace android } // namespace gdmono diff --git a/modules/mono/mono_gd/support/ios_support.h b/modules/mono/mono_gd/support/ios_support.h index ed251cb23a..48cef890d6 100755 --- a/modules/mono/mono_gd/support/ios_support.h +++ b/modules/mono/mono_gd/support/ios_support.h @@ -41,7 +41,6 @@ namespace support { void initialize(); void cleanup(); - } // namespace support } // namespace ios } // namespace gdmono diff --git a/modules/mono/mono_gd/support/ios_support.mm b/modules/mono/mono_gd/support/ios_support.mm index dc23c06eba..e6e09c4146 100644 --- a/modules/mono/mono_gd/support/ios_support.mm +++ b/modules/mono/mono_gd/support/ios_support.mm @@ -72,7 +72,6 @@ void initialize() { void cleanup() { } - } // namespace support } // namespace ios } // namespace gdmono diff --git a/modules/mono/utils/macros.h b/modules/mono/utils/macros.h index c76619cca4..60c9b9718a 100644 --- a/modules/mono/utils/macros.h +++ b/modules/mono/utils/macros.h @@ -64,7 +64,6 @@ public: template <typename F> ScopeExit<F> operator+(F p_exit_func) { return ScopeExit<F>(p_exit_func); } }; - } // namespace gdmono #define SCOPE_EXIT \ diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index a619f0b975..9902744743 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -225,7 +225,6 @@ cleanup: return msbuild_tools_path; } - } // namespace MonoRegUtils #endif // WINDOWS_ENABLED diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index eb0ba8c700..a24097924e 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -194,5 +194,4 @@ String relative_to(const String &p_path, const String &p_relative_to) { return relative_to_impl(path_abs_norm, relative_to_abs_norm); } - } // namespace path diff --git a/modules/mono/utils/path_utils.h b/modules/mono/utils/path_utils.h index 458d1bb849..c19cb3bc8b 100644 --- a/modules/mono/utils/path_utils.h +++ b/modules/mono/utils/path_utils.h @@ -56,7 +56,6 @@ String abspath(const String &p_path); String realpath(const String &p_path); String relative_to(const String &p_path, const String &p_relative_to); - } // namespace path #endif // PATH_UTILS_H diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index 65da4328f6..d70004657c 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -84,7 +84,6 @@ int sfind(const String &p_text, int p_from) { return -1; } - } // namespace String sformat(const String &p_text, const Variant &p1, const Variant &p2, const Variant &p3, const Variant &p4, const Variant &p5) { diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 050dce1aab..0923714387 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -38,7 +38,6 @@ static void _pvrtc_decompress(Image *p_img); enum PVRFLags { - PVR_HAS_MIPMAPS = 0x00000100, PVR_TWIDDLED = 0x00000200, PVR_NORMAL_MAP = 0x00000400, @@ -48,7 +47,6 @@ enum PVRFLags { PVR_VOLUME_TEXTURES = 0x00004000, PVR_HAS_ALPHA = 0x00008000, PVR_VFLIP = 0x00010000 - }; RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { diff --git a/modules/upnp/upnp.h b/modules/upnp/upnp.h index e87f93e697..81d770ec4c 100644 --- a/modules/upnp/upnp.h +++ b/modules/upnp/upnp.h @@ -57,7 +57,6 @@ protected: public: enum UPNPResult { - UPNP_RESULT_SUCCESS, UPNP_RESULT_NOT_AUTHORIZED, UPNP_RESULT_PORT_MAPPING_NOT_FOUND, diff --git a/modules/upnp/upnp_device.h b/modules/upnp/upnp_device.h index a287c99b0d..53d621c90a 100644 --- a/modules/upnp/upnp_device.h +++ b/modules/upnp/upnp_device.h @@ -38,7 +38,6 @@ class UPNPDevice : public Reference { public: enum IGDStatus { - IGD_STATUS_OK, IGD_STATUS_HTTP_ERROR, IGD_STATUS_HTTP_EMPTY, diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 1c7d5472cb..b10d4523f2 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2635,7 +2635,6 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String f->debug_get_stack_member_state(*_call_stack[l].line,&locals); for( List<Pair<StringName,int> >::Element *E = locals.front();E;E=E->next() ) { - p_locals->push_back(E->get().first); p_values->push_back(_call_stack[l].stack[E->get().second]); } diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index a27307aec2..fe0c399f8d 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -647,7 +647,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons /* String VisualScriptBuiltinFunc::get_caption() const { - return "BuiltinFunc"; } diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 66e435741f..5610e6b1b4 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -64,7 +64,6 @@ class VisualScriptEditor : public ScriptEditorBase { }; enum PortAction { - CREATE_CALL_SET_GET, CREATE_ACTION, }; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 34a1cfc4fc..b2aa42ef97 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -234,7 +234,6 @@ PropertyInfo VisualScriptFunctionCall::get_output_value_port_info(int p_idx) con /*MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { - ret = mb->get_argument_info(-1); } else {*/ diff --git a/modules/webrtc/library_godot_webrtc.js b/modules/webrtc/library_godot_webrtc.js index b75996b1f3..d4c38f15a2 100644 --- a/modules/webrtc/library_godot_webrtc.js +++ b/modules/webrtc/library_godot_webrtc.js @@ -32,7 +32,6 @@ var GodotRTCDataChannel = { // Our socket implementation that forwards events to C++. $GodotRTCDataChannel__deps: ['$IDHandler', '$GodotOS'], $GodotRTCDataChannel: { - connect: function(p_id, p_on_open, p_on_message, p_on_error, p_on_close) { const ref = IDHandler.get(p_id); if (!ref) { @@ -201,7 +200,6 @@ autoAddDeps(GodotRTCDataChannel, '$GodotRTCDataChannel'); mergeInto(LibraryManager.library, GodotRTCDataChannel); var GodotRTCPeerConnection = { - $GodotRTCPeerConnection__deps: ['$IDHandler', '$GodotOS', '$GodotRTCDataChannel'], $GodotRTCPeerConnection: { onstatechange: function(p_id, p_conn, callback, event) { diff --git a/modules/websocket/library_godot_websocket.js b/modules/websocket/library_godot_websocket.js index f7d3195807..7076a6f43d 100644 --- a/modules/websocket/library_godot_websocket.js +++ b/modules/websocket/library_godot_websocket.js @@ -29,7 +29,6 @@ /*************************************************************************/ var GodotWebSocket = { - // Our socket implementation that forwards events to C++. $GodotWebSocket__deps: ['$IDHandler'], $GodotWebSocket: { @@ -163,10 +162,8 @@ var GodotWebSocket = { for(i = 0; i < p_buf_len; i++) { bytes_array[i] = getValue(p_buf + i, 'i8'); } - var out = bytes_array; - if (p_raw) { - out = bytes_array.buffer; - } else { + var out = bytes_array.buffer; + if (!p_raw) { out = new TextDecoder("utf-8").decode(bytes_array); } return GodotWebSocket.send(p_id, out); |