diff options
Diffstat (limited to 'modules')
52 files changed, 486 insertions, 383 deletions
diff --git a/modules/camera/camera_linux.cpp b/modules/camera/camera_linux.cpp index 8f4771a045..1bcab6ac03 100644 --- a/modules/camera/camera_linux.cpp +++ b/modules/camera/camera_linux.cpp @@ -163,7 +163,7 @@ bool CameraLinux::_can_query_format(int p_file_descriptor, int p_type) { CameraLinux::CameraLinux() { camera_thread.start(CameraLinux::camera_thread_func, this); -}; +} CameraLinux::~CameraLinux() { exit_flag.set(); diff --git a/modules/camera/camera_macos.mm b/modules/camera/camera_macos.mm index 4c02ebee9a..ee97ef5101 100644 --- a/modules/camera/camera_macos.mm +++ b/modules/camera/camera_macos.mm @@ -214,12 +214,12 @@ public: AVCaptureDevice *CameraFeedMacOS::get_device() const { return device; -}; +} CameraFeedMacOS::CameraFeedMacOS() { device = nullptr; capture_session = nullptr; -}; +} void CameraFeedMacOS::set_device(AVCaptureDevice *p_device) { device = p_device; @@ -233,7 +233,7 @@ void CameraFeedMacOS::set_device(AVCaptureDevice *p_device) { } else if ([p_device position] == AVCaptureDevicePositionFront) { position = CameraFeed::FEED_FRONT; }; -}; +} bool CameraFeedMacOS::activate_feed() { if (capture_session) { @@ -259,7 +259,7 @@ bool CameraFeedMacOS::activate_feed() { }; return true; -}; +} void CameraFeedMacOS::deactivate_feed() { // end camera capture if we have one @@ -267,7 +267,7 @@ void CameraFeedMacOS::deactivate_feed() { [capture_session cleanup]; capture_session = nullptr; }; -}; +} ////////////////////////////////////////////////////////////////////////// // MyDeviceNotifications - This is a little helper class gets notifications @@ -353,7 +353,7 @@ void CameraMacOS::update_feeds() { add_feed(newfeed); }; }; -}; +} CameraMacOS::CameraMacOS() { // Find available cameras we have at this time @@ -361,4 +361,4 @@ CameraMacOS::CameraMacOS() { // should only have one of these.... device_notifications = [[MyDeviceNotifications alloc] initForServer:this]; -}; +} diff --git a/modules/camera/camera_win.cpp b/modules/camera/camera_win.cpp index 39585734b9..5c00e7dd6c 100644 --- a/modules/camera/camera_win.cpp +++ b/modules/camera/camera_win.cpp @@ -66,13 +66,13 @@ CameraFeedWindows::~CameraFeedWindows() { }; ///@TODO free up anything used by this -}; +} bool CameraFeedWindows::activate_feed() { ///@TODO this should activate our camera and start the process of capturing frames return true; -}; +} ///@TODO we should probably have a callback method here that is being called by the // camera API which provides frames and call back into the CameraServer to update our texture @@ -93,4 +93,4 @@ CameraWindows::CameraWindows() { add_active_cameras(); // need to add something that will react to devices being connected/removed... -}; +} diff --git a/modules/csg/editor/csg_gizmos.cpp b/modules/csg/editor/csg_gizmos.cpp index 9e886cfb5f..343a98e903 100644 --- a/modules/csg/editor/csg_gizmos.cpp +++ b/modules/csg/editor/csg_gizmos.cpp @@ -65,7 +65,7 @@ void CSGShapeEditor::edit(CSGShape3D *p_csg_shape) { void CSGShapeEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { - options->set_icon(get_editor_theme_icon(SNAME("CSGCombiner3D"))); + options->set_button_icon(get_editor_theme_icon(SNAME("CSGCombiner3D"))); } break; } } diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 38e2fa31ad..229d0b2b39 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -48,7 +48,12 @@ enum { DDPF_ALPHAONLY = 0x00000002, DDPF_FOURCC = 0x00000004, DDPF_RGB = 0x00000040, - DDPF_RG_SNORM = 0x00080000 + DDPF_RG_SNORM = 0x00080000, + DDSC2_CUBEMAP = 0x200, + DDSC2_VOLUME = 0x200000, + DX10D_1D = 2, + DX10D_2D = 3, + DX10D_3D = 4, }; enum DDSFourCC { @@ -141,6 +146,15 @@ enum DDSFormat { DDS_MAX }; +enum DDSType { + DDST_2D = 1, + DDST_CUBEMAP, + DDST_3D, + + DDST_TYPE_MASK = 0x7F, + DDST_ARRAY = 0x80, +}; + struct DDSFormatInfo { const char *name = nullptr; bool compressed = false; @@ -182,7 +196,7 @@ static const DDSFormatInfo dds_format_info[DDS_MAX] = { { "GRAYSCALE_ALPHA_4", false, 1, 1, Image::FORMAT_LA8 } }; -static DDSFormat dxgi_to_dds_format(uint32_t p_dxgi_format) { +inline DDSFormat _dxgi_to_dds_format(uint32_t p_dxgi_format) { switch (p_dxgi_format) { case DXGI_R32G32B32A32_FLOAT: { return DDS_RGBA32F; @@ -269,210 +283,23 @@ static DDSFormat dxgi_to_dds_format(uint32_t p_dxgi_format) { } } -Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { - if (r_error) { - *r_error = ERR_CANT_OPEN; - } - - Error err; - Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ, &err); - if (f.is_null()) { - return Ref<Resource>(); - } - - Ref<FileAccess> fref(f); - if (r_error) { - *r_error = ERR_FILE_CORRUPT; - } - - ERR_FAIL_COND_V_MSG(err != OK, Ref<Resource>(), "Unable to open DDS texture file '" + p_path + "'."); - - uint32_t magic = f->get_32(); - uint32_t hsize = f->get_32(); - uint32_t flags = f->get_32(); - uint32_t height = f->get_32(); - uint32_t width = f->get_32(); - uint32_t pitch = f->get_32(); - /* uint32_t depth = */ f->get_32(); - uint32_t mipmaps = f->get_32(); - - // Skip reserved. - for (int i = 0; i < 11; i++) { - f->get_32(); - } - - // Validate. - // We don't check DDSD_CAPS or DDSD_PIXELFORMAT, as they're mandatory when writing, - // but non-mandatory when reading (as some writers don't set them). - if (magic != DDS_MAGIC || hsize != 124) { - ERR_FAIL_V_MSG(Ref<Resource>(), "Invalid or unsupported DDS texture file '" + p_path + "'."); - } - - /* uint32_t format_size = */ f->get_32(); - uint32_t format_flags = f->get_32(); - uint32_t format_fourcc = f->get_32(); - uint32_t format_rgb_bits = f->get_32(); - uint32_t format_red_mask = f->get_32(); - uint32_t format_green_mask = f->get_32(); - uint32_t format_blue_mask = f->get_32(); - uint32_t format_alpha_mask = f->get_32(); - - /* uint32_t caps_1 = */ f->get_32(); - /* uint32_t caps_2 = */ f->get_32(); - /* uint32_t caps_3 = */ f->get_32(); - /* uint32_t caps_4 = */ f->get_32(); - - // Skip reserved. - f->get_32(); - - if (f->get_position() < 128) { - f->seek(128); - } - - DDSFormat dds_format = DDS_MAX; - - if (format_flags & DDPF_FOURCC) { - // FourCC formats. - switch (format_fourcc) { - case DDFCC_DXT1: { - dds_format = DDS_DXT1; - } break; - case DDFCC_DXT2: - case DDFCC_DXT3: { - dds_format = DDS_DXT3; - } break; - case DDFCC_DXT4: - case DDFCC_DXT5: { - dds_format = DDS_DXT5; - } break; - case DDFCC_ATI1: - case DDFCC_BC4U: { - dds_format = DDS_ATI1; - } break; - case DDFCC_ATI2: - case DDFCC_BC5U: - case DDFCC_A2XY: { - dds_format = DDS_ATI2; - } break; - case DDFCC_R16F: { - dds_format = DDS_R16F; - } break; - case DDFCC_RG16F: { - dds_format = DDS_RG16F; - } break; - case DDFCC_RGBA16F: { - dds_format = DDS_RGBA16F; - } break; - case DDFCC_R32F: { - dds_format = DDS_R32F; - } break; - case DDFCC_RG32F: { - dds_format = DDS_RG32F; - } break; - case DDFCC_RGBA32F: { - dds_format = DDS_RGBA32F; - } break; - case DDFCC_DX10: { - uint32_t dxgi_format = f->get_32(); - /* uint32_t dimension = */ f->get_32(); - /* uint32_t misc_flags_1 = */ f->get_32(); - /* uint32_t array_size = */ f->get_32(); - /* uint32_t misc_flags_2 = */ f->get_32(); - - dds_format = dxgi_to_dds_format(dxgi_format); - } break; - - default: { - ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported FourCC in DDS '" + p_path + "'."); - } - } - - } else if (format_flags & DDPF_RGB) { - // Channel-bitmasked formats. - if (format_flags & DDPF_ALPHAPIXELS) { - // With alpha. - if (format_rgb_bits == 32 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff && format_alpha_mask == 0xff000000) { - dds_format = DDS_BGRA8; - } else if (format_rgb_bits == 32 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000 && format_alpha_mask == 0xff000000) { - dds_format = DDS_RGBA8; - } else if (format_rgb_bits == 16 && format_red_mask == 0x00007c00 && format_green_mask == 0x000003e0 && format_blue_mask == 0x0000001f && format_alpha_mask == 0x00008000) { - dds_format = DDS_BGR5A1; - } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff00000 && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff && format_alpha_mask == 0xc0000000) { - dds_format = DDS_BGR10A2; - } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff00000 && format_alpha_mask == 0xc0000000) { - dds_format = DDS_RGB10A2; - } else if (format_rgb_bits == 16 && format_red_mask == 0xf00 && format_green_mask == 0xf0 && format_blue_mask == 0xf && format_alpha_mask == 0xf000) { - dds_format = DDS_BGRA4; - } else if (format_rgb_bits == 16 && format_red_mask == 0xe0 && format_green_mask == 0x1c && format_blue_mask == 0x3 && format_alpha_mask == 0xff00) { - dds_format = DDS_B2GR3A8; - } +static Ref<Image> _dds_load_layer(Ref<FileAccess> p_file, DDSFormat p_dds_format, uint32_t p_width, uint32_t p_height, uint32_t p_mipmaps, uint32_t p_pitch, uint32_t p_flags, Vector<uint8_t> &r_src_data) { + const DDSFormatInfo &info = dds_format_info[p_dds_format]; - } else { - // Without alpha. - if (format_rgb_bits == 24 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff) { - dds_format = DDS_BGR8; - } else if (format_rgb_bits == 24 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000) { - dds_format = DDS_RGB8; - } else if (format_rgb_bits == 16 && format_red_mask == 0x0000f800 && format_green_mask == 0x000007e0 && format_blue_mask == 0x0000001f) { - dds_format = DDS_BGR565; - } else if (format_rgb_bits == 8 && format_red_mask == 0xe0 && format_green_mask == 0x1c && format_blue_mask == 0x3) { - dds_format = DDS_B2GR3; - } - } - - } else { - // Other formats. - if (format_flags & DDPF_ALPHAONLY && format_rgb_bits == 8 && format_alpha_mask == 0xff) { - // Alpha only. - dds_format = DDS_LUMINANCE; - } - } - - // Depending on the writer, luminance formats may or may not have the DDPF_RGB or DDPF_LUMINANCE flags defined, - // so we check for these formats after everything else failed. - if (dds_format == DDS_MAX) { - if (format_flags & DDPF_ALPHAPIXELS) { - // With alpha. - if (format_rgb_bits == 16 && format_red_mask == 0xff && format_alpha_mask == 0xff00) { - dds_format = DDS_LUMINANCE_ALPHA; - } else if (format_rgb_bits == 8 && format_red_mask == 0xf && format_alpha_mask == 0xf0) { - dds_format = DDS_LUMINANCE_ALPHA_4; - } - - } else { - // Without alpha. - if (format_rgb_bits == 8 && format_red_mask == 0xff) { - dds_format = DDS_LUMINANCE; - } - } - } - - // No format detected, error. - if (dds_format == DDS_MAX) { - ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported color layout in DDS '" + p_path + "'."); - } - - if (!(flags & DDSD_MIPMAPCOUNT)) { - mipmaps = 1; - } - - Vector<uint8_t> src_data; - - const DDSFormatInfo &info = dds_format_info[dds_format]; - uint32_t w = width; - uint32_t h = height; + uint32_t w = p_width; + uint32_t h = p_height; if (info.compressed) { // BC compressed. uint32_t size = MAX(info.divisor, w) / info.divisor * MAX(info.divisor, h) / info.divisor * info.block_size; - if (flags & DDSD_LINEARSIZE) { - ERR_FAIL_COND_V_MSG(size != pitch, Ref<Resource>(), "DDS header flags specify that a linear size of the top-level image is present, but the specified size does not match the expected value."); + if (p_flags & DDSD_LINEARSIZE) { + ERR_FAIL_COND_V_MSG(size != p_pitch, Ref<Resource>(), "DDS header flags specify that a linear size of the top-level image is present, but the specified size does not match the expected value."); } else { - ERR_FAIL_COND_V_MSG(pitch != 0, Ref<Resource>(), "DDS header flags specify that no linear size will given for the top-level image, but a non-zero linear size value is present in the header."); + ERR_FAIL_COND_V_MSG(p_pitch != 0, Ref<Resource>(), "DDS header flags specify that no linear size will given for the top-level image, but a non-zero linear size value is present in the header."); } - for (uint32_t i = 1; i < mipmaps; i++) { + for (uint32_t i = 1; i < p_mipmaps; i++) { w = MAX(1u, w >> 1); h = MAX(1u, h >> 1); @@ -480,22 +307,22 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig size += bsize; } - src_data.resize(size); - uint8_t *wb = src_data.ptrw(); - f->get_buffer(wb, size); + r_src_data.resize(size); + uint8_t *wb = r_src_data.ptrw(); + p_file->get_buffer(wb, size); } else { // Generic uncompressed. - uint32_t size = width * height * info.block_size; + uint32_t size = p_width * p_height * info.block_size; - for (uint32_t i = 1; i < mipmaps; i++) { + for (uint32_t i = 1; i < p_mipmaps; i++) { w = (w + 1) >> 1; h = (h + 1) >> 1; size += w * h * info.block_size; } // Calculate the space these formats will take up after decoding. - switch (dds_format) { + switch (p_dds_format) { case DDS_BGR565: size = size * 3 / 2; break; @@ -515,12 +342,11 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig break; } - src_data.resize(size); - uint8_t *wb = src_data.ptrw(); - f->get_buffer(wb, size); + r_src_data.resize(size); + uint8_t *wb = r_src_data.ptrw(); + p_file->get_buffer(wb, size); - // Decode nonstandard formats. - switch (dds_format) { + switch (p_dds_format) { case DDS_BGR5A1: { // To RGBA8. int colcount = size / 4; @@ -707,14 +533,282 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig } } - Ref<Image> img = memnew(Image(width, height, mipmaps - 1, info.format, src_data)); - Ref<ImageTexture> texture = ImageTexture::create_from_image(img); + return memnew(Image(p_width, p_height, p_mipmaps > 1, info.format, r_src_data)); +} + +Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { + if (r_error) { + *r_error = ERR_CANT_OPEN; + } + + Error err; + Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ, &err); + if (f.is_null()) { + return Ref<Resource>(); + } + Ref<FileAccess> fref(f); if (r_error) { - *r_error = OK; + *r_error = ERR_FILE_CORRUPT; + } + + ERR_FAIL_COND_V_MSG(err != OK, Ref<Resource>(), vformat("Unable to open DDS texture file '%s'.", p_path)); + + uint32_t magic = f->get_32(); + uint32_t hsize = f->get_32(); + uint32_t flags = f->get_32(); + uint32_t height = f->get_32(); + uint32_t width = f->get_32(); + uint32_t pitch = f->get_32(); + uint32_t depth = f->get_32(); + uint32_t mipmaps = f->get_32(); + + // Skip reserved. + for (int i = 0; i < 11; i++) { + f->get_32(); + } + + // Validate. + // We don't check DDSD_CAPS or DDSD_PIXELFORMAT, as they're mandatory when writing, + // but non-mandatory when reading (as some writers don't set them). + if (magic != DDS_MAGIC || hsize != 124) { + ERR_FAIL_V_MSG(Ref<Resource>(), vformat("Invalid or unsupported DDS texture file '%s'.", p_path)); + } + + /* uint32_t format_size = */ f->get_32(); + uint32_t format_flags = f->get_32(); + uint32_t format_fourcc = f->get_32(); + uint32_t format_rgb_bits = f->get_32(); + uint32_t format_red_mask = f->get_32(); + uint32_t format_green_mask = f->get_32(); + uint32_t format_blue_mask = f->get_32(); + uint32_t format_alpha_mask = f->get_32(); + + /* uint32_t caps_1 = */ f->get_32(); + uint32_t caps_2 = f->get_32(); + /* uint32_t caps_3 = */ f->get_32(); + /* uint32_t caps_4 = */ f->get_32(); + + // Skip reserved. + f->get_32(); + + if (f->get_position() < 128) { + f->seek(128); + } + + uint32_t layer_count = 1; + uint32_t dds_type = DDST_2D; + + if (caps_2 & DDSC2_CUBEMAP) { + dds_type = DDST_CUBEMAP; + layer_count *= 6; + + } else if (caps_2 & DDSC2_VOLUME) { + dds_type = DDST_3D; + layer_count = depth; + } + + DDSFormat dds_format = DDS_MAX; + + if (format_flags & DDPF_FOURCC) { + // FourCC formats. + switch (format_fourcc) { + case DDFCC_DXT1: { + dds_format = DDS_DXT1; + } break; + case DDFCC_DXT2: + case DDFCC_DXT3: { + dds_format = DDS_DXT3; + } break; + case DDFCC_DXT4: + case DDFCC_DXT5: { + dds_format = DDS_DXT5; + } break; + case DDFCC_ATI1: + case DDFCC_BC4U: { + dds_format = DDS_ATI1; + } break; + case DDFCC_ATI2: + case DDFCC_BC5U: + case DDFCC_A2XY: { + dds_format = DDS_ATI2; + } break; + case DDFCC_R16F: { + dds_format = DDS_R16F; + } break; + case DDFCC_RG16F: { + dds_format = DDS_RG16F; + } break; + case DDFCC_RGBA16F: { + dds_format = DDS_RGBA16F; + } break; + case DDFCC_R32F: { + dds_format = DDS_R32F; + } break; + case DDFCC_RG32F: { + dds_format = DDS_RG32F; + } break; + case DDFCC_RGBA32F: { + dds_format = DDS_RGBA32F; + } break; + case DDFCC_DX10: { + uint32_t dxgi_format = f->get_32(); + uint32_t dimension = f->get_32(); + /* uint32_t misc_flags_1 = */ f->get_32(); + uint32_t array_size = f->get_32(); + /* uint32_t misc_flags_2 = */ f->get_32(); + + if (dimension == DX10D_3D) { + dds_type = DDST_3D; + layer_count = depth; + } + + if (array_size > 1) { + layer_count *= array_size; + dds_type |= DDST_ARRAY; + } + + dds_format = _dxgi_to_dds_format(dxgi_format); + } break; + + default: { + ERR_FAIL_V_MSG(Ref<Resource>(), vformat("Unrecognized or unsupported FourCC in DDS '%s'.", p_path)); + } + } + + } else if (format_flags & DDPF_RGB) { + // Channel-bitmasked formats. + if (format_flags & DDPF_ALPHAPIXELS) { + // With alpha. + if (format_rgb_bits == 32 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff && format_alpha_mask == 0xff000000) { + dds_format = DDS_BGRA8; + } else if (format_rgb_bits == 32 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000 && format_alpha_mask == 0xff000000) { + dds_format = DDS_RGBA8; + } else if (format_rgb_bits == 16 && format_red_mask == 0x00007c00 && format_green_mask == 0x000003e0 && format_blue_mask == 0x0000001f && format_alpha_mask == 0x00008000) { + dds_format = DDS_BGR5A1; + } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff00000 && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff && format_alpha_mask == 0xc0000000) { + dds_format = DDS_BGR10A2; + } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff00000 && format_alpha_mask == 0xc0000000) { + dds_format = DDS_RGB10A2; + } else if (format_rgb_bits == 16 && format_red_mask == 0xf00 && format_green_mask == 0xf0 && format_blue_mask == 0xf && format_alpha_mask == 0xf000) { + dds_format = DDS_BGRA4; + } else if (format_rgb_bits == 16 && format_red_mask == 0xe0 && format_green_mask == 0x1c && format_blue_mask == 0x3 && format_alpha_mask == 0xff00) { + dds_format = DDS_B2GR3A8; + } + + } else { + // Without alpha. + if (format_rgb_bits == 24 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff) { + dds_format = DDS_BGR8; + } else if (format_rgb_bits == 24 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000) { + dds_format = DDS_RGB8; + } else if (format_rgb_bits == 16 && format_red_mask == 0x0000f800 && format_green_mask == 0x000007e0 && format_blue_mask == 0x0000001f) { + dds_format = DDS_BGR565; + } else if (format_rgb_bits == 8 && format_red_mask == 0xe0 && format_green_mask == 0x1c && format_blue_mask == 0x3) { + dds_format = DDS_B2GR3; + } + } + + } else { + // Other formats. + if (format_flags & DDPF_ALPHAONLY && format_rgb_bits == 8 && format_alpha_mask == 0xff) { + // Alpha only. + dds_format = DDS_LUMINANCE; + } + } + + // Depending on the writer, luminance formats may or may not have the DDPF_RGB or DDPF_LUMINANCE flags defined, + // so we check for these formats after everything else failed. + if (dds_format == DDS_MAX) { + if (format_flags & DDPF_ALPHAPIXELS) { + // With alpha. + if (format_rgb_bits == 16 && format_red_mask == 0xff && format_alpha_mask == 0xff00) { + dds_format = DDS_LUMINANCE_ALPHA; + } else if (format_rgb_bits == 8 && format_red_mask == 0xf && format_alpha_mask == 0xf0) { + dds_format = DDS_LUMINANCE_ALPHA_4; + } + + } else { + // Without alpha. + if (format_rgb_bits == 8 && format_red_mask == 0xff) { + dds_format = DDS_LUMINANCE; + } + } + } + + // No format detected, error. + if (dds_format == DDS_MAX) { + ERR_FAIL_V_MSG(Ref<Resource>(), vformat("Unrecognized or unsupported color layout in DDS '%s'.", p_path)); + } + + if (!(flags & DDSD_MIPMAPCOUNT)) { + mipmaps = 1; + } + + Vector<uint8_t> src_data; + + Vector<Ref<Image>> images; + images.resize(layer_count); + + for (uint32_t i = 0; i < layer_count; i++) { + images.write[i] = _dds_load_layer(f, dds_format, width, height, mipmaps, pitch, flags, src_data); + } + + if ((dds_type & DDST_TYPE_MASK) == DDST_2D) { + if (dds_type & DDST_ARRAY) { + Ref<Texture2DArray> texture = memnew(Texture2DArray()); + texture->create_from_images(images); + + if (r_error) { + *r_error = OK; + } + + return texture; + + } else { + if (r_error) { + *r_error = OK; + } + + return ImageTexture::create_from_image(images[0]); + } + + } else if ((dds_type & DDST_TYPE_MASK) == DDST_CUBEMAP) { + ERR_FAIL_COND_V(layer_count % 6 != 0, Ref<Resource>()); + + if (dds_type & DDST_ARRAY) { + Ref<CubemapArray> texture = memnew(CubemapArray()); + texture->create_from_images(images); + + if (r_error) { + *r_error = OK; + } + + return texture; + + } else { + Ref<Cubemap> texture = memnew(Cubemap()); + texture->create_from_images(images); + + if (r_error) { + *r_error = OK; + } + + return texture; + } + + } else if ((dds_type & DDST_TYPE_MASK) == DDST_3D) { + Ref<ImageTexture3D> texture = memnew(ImageTexture3D()); + texture->create(images[0]->get_format(), width, height, layer_count, mipmaps > 1, images); + + if (r_error) { + *r_error = OK; + } + + return texture; } - return texture; + return Ref<Resource>(); } void ResourceFormatDDS::get_recognized_extensions(List<String> *p_extensions) const { @@ -722,12 +816,12 @@ void ResourceFormatDDS::get_recognized_extensions(List<String> *p_extensions) co } bool ResourceFormatDDS::handles_type(const String &p_type) const { - return ClassDB::is_parent_class(p_type, "Texture2D"); + return ClassDB::is_parent_class(p_type, "Texture"); } String ResourceFormatDDS::get_resource_type(const String &p_path) const { if (p_path.get_extension().to_lower() == "dds") { - return "ImageTexture"; + return "Texture"; } return ""; } diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 7dafb63a60..ac768873dd 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1864,14 +1864,14 @@ Variant::Type GDScriptInstance::get_property_type(const StringName &p_name, bool } void GDScriptInstance::validate_property(PropertyInfo &p_property) const { - Variant property = (Dictionary)p_property; - const Variant *args[1] = { &property }; - const GDScript *sptr = script.ptr(); while (sptr) { if (likely(sptr->valid)) { HashMap<StringName, GDScriptFunction *>::ConstIterator E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._validate_property); if (E) { + Variant property = (Dictionary)p_property; + const Variant *args[1] = { &property }; + Callable::CallError err; Variant ret = E->value->call(const_cast<GDScriptInstance *>(this), args, 1, err); if (err.error == Callable::CallError::CALL_OK) { diff --git a/modules/gdscript/gdscript_tokenizer_buffer.h b/modules/gdscript/gdscript_tokenizer_buffer.h index a2d5be7991..fd81c79981 100644 --- a/modules/gdscript/gdscript_tokenizer_buffer.h +++ b/modules/gdscript/gdscript_tokenizer_buffer.h @@ -81,7 +81,7 @@ public: virtual bool is_past_cursor() const override; virtual void push_expression_indented_block() override; // For lambdas, or blocks inside expressions. virtual void pop_expression_indented_block() override; // For lambdas, or blocks inside expressions. - virtual bool is_text() override { return false; }; + virtual bool is_text() override { return false; } #ifdef TOOLS_ENABLED virtual const HashMap<int, CommentData> &get_comments() const override { diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 00728eebd9..95739ef4b7 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -505,7 +505,7 @@ void EditorFileSystemImportFormatSupportQueryBlend::_browse_install() { } void EditorFileSystemImportFormatSupportQueryBlend::_update_icons() { - blender_path_browse->set_icon(blender_path_browse->get_editor_theme_icon(SNAME("FolderBrowse"))); + blender_path_browse->set_button_icon(blender_path_browse->get_editor_theme_icon(SNAME("FolderBrowse"))); } bool EditorFileSystemImportFormatSupportQueryBlend::query() { diff --git a/modules/godot_physics_2d/godot_joints_2d.h b/modules/godot_physics_2d/godot_joints_2d.h index 6d221a406e..5877c79ab5 100644 --- a/modules/godot_physics_2d/godot_joints_2d.h +++ b/modules/godot_physics_2d/godot_joints_2d.h @@ -72,7 +72,7 @@ public: body->remove_constraint(this, i); } } - }; + } }; class GodotPinJoint2D : public GodotJoint2D { diff --git a/modules/godot_physics_2d/godot_physics_server_2d.cpp b/modules/godot_physics_2d/godot_physics_server_2d.cpp index b732648a1c..286a93a986 100644 --- a/modules/godot_physics_2d/godot_physics_server_2d.cpp +++ b/modules/godot_physics_2d/godot_physics_server_2d.cpp @@ -118,7 +118,7 @@ void GodotPhysicsServer2D::shape_set_data(RID p_shape, const Variant &p_data) { GodotShape2D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL(shape); shape->set_data(p_data); -}; +} void GodotPhysicsServer2D::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) { GodotShape2D *shape = shape_owner.get_or_null(p_shape); @@ -130,14 +130,14 @@ PhysicsServer2D::ShapeType GodotPhysicsServer2D::shape_get_type(RID p_shape) con const GodotShape2D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL_V(shape, SHAPE_CUSTOM); return shape->get_type(); -}; +} Variant GodotPhysicsServer2D::shape_get_data(RID p_shape) const { const GodotShape2D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL_V(shape, Variant()); ERR_FAIL_COND_V(!shape->is_configured(), Variant()); return shape->get_data(); -}; +} real_t GodotPhysicsServer2D::shape_get_custom_solver_bias(RID p_shape) const { const GodotShape2D *shape = shape_owner.get_or_null(p_shape); @@ -228,7 +228,7 @@ RID GodotPhysicsServer2D::space_create() { area->set_priority(-1); return id; -}; +} void GodotPhysicsServer2D::space_set_active(RID p_space, bool p_active) { GodotSpace2D *space = space_owner.get_or_null(p_space); @@ -447,13 +447,13 @@ void GodotPhysicsServer2D::area_set_param(RID p_area, AreaParameter p_param, con GodotArea2D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL(area); area->set_param(p_param, p_value); -}; +} void GodotPhysicsServer2D::area_set_transform(RID p_area, const Transform2D &p_transform) { GodotArea2D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL(area); area->set_transform(p_transform); -}; +} Variant GodotPhysicsServer2D::area_get_param(RID p_area, AreaParameter p_param) const { if (space_owner.owns(p_area)) { @@ -464,14 +464,14 @@ Variant GodotPhysicsServer2D::area_get_param(RID p_area, AreaParameter p_param) ERR_FAIL_NULL_V(area, Variant()); return area->get_param(p_param); -}; +} Transform2D GodotPhysicsServer2D::area_get_transform(RID p_area) const { GodotArea2D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL_V(area, Transform2D()); return area->get_transform(); -}; +} void GodotPhysicsServer2D::area_set_pickable(RID p_area, bool p_pickable) { GodotArea2D *area = area_owner.get_or_null(p_area); @@ -553,7 +553,7 @@ void GodotPhysicsServer2D::body_set_space(RID p_body, RID p_space) { body->clear_constraint_list(); body->set_space(space); -}; +} RID GodotPhysicsServer2D::body_get_space(RID p_body) const { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -564,7 +564,7 @@ RID GodotPhysicsServer2D::body_get_space(RID p_body) const { return RID(); } return space->get_self(); -}; +} void GodotPhysicsServer2D::body_set_mode(RID p_body, BodyMode p_mode) { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -572,14 +572,14 @@ void GodotPhysicsServer2D::body_set_mode(RID p_body, BodyMode p_mode) { FLUSH_QUERY_CHECK(body); body->set_mode(p_mode); -}; +} PhysicsServer2D::BodyMode GodotPhysicsServer2D::body_get_mode(RID p_body) const { GodotBody2D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, BODY_MODE_STATIC); return body->get_mode(); -}; +} void GodotPhysicsServer2D::body_add_shape(RID p_body, RID p_shape, const Transform2D &p_transform, bool p_disabled) { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -904,7 +904,7 @@ void GodotPhysicsServer2D::body_set_axis_velocity(RID p_body, const Vector2 &p_a v += p_axis_velocity; body->set_linear_velocity(v); body->wakeup(); -}; +} void GodotPhysicsServer2D::body_add_collision_exception(RID p_body, RID p_body_b) { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -912,7 +912,7 @@ void GodotPhysicsServer2D::body_add_collision_exception(RID p_body, RID p_body_b body->add_exception(p_body_b); body->wakeup(); -}; +} void GodotPhysicsServer2D::body_remove_collision_exception(RID p_body, RID p_body_b) { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -920,7 +920,7 @@ void GodotPhysicsServer2D::body_remove_collision_exception(RID p_body, RID p_bod body->remove_exception(p_body_b); body->wakeup(); -}; +} void GodotPhysicsServer2D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { GodotBody2D *body = body_owner.get_or_null(p_body); @@ -929,31 +929,31 @@ void GodotPhysicsServer2D::body_get_collision_exceptions(RID p_body, List<RID> * for (int i = 0; i < body->get_exceptions().size(); i++) { p_exceptions->push_back(body->get_exceptions()[i]); } -}; +} void GodotPhysicsServer2D::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) { GodotBody2D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL(body); -}; +} real_t GodotPhysicsServer2D::body_get_contacts_reported_depth_threshold(RID p_body) const { GodotBody2D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, 0); return 0; -}; +} void GodotPhysicsServer2D::body_set_omit_force_integration(RID p_body, bool p_omit) { GodotBody2D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL(body); body->set_omit_force_integration(p_omit); -}; +} bool GodotPhysicsServer2D::body_is_omitting_force_integration(RID p_body) const { GodotBody2D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, false); return body->get_omit_force_integration(); -}; +} void GodotPhysicsServer2D::body_set_max_contacts_reported(RID p_body, int p_contacts) { GodotBody2D *body = body_owner.get_or_null(p_body); diff --git a/modules/godot_physics_3d/godot_physics_server_3d.cpp b/modules/godot_physics_3d/godot_physics_server_3d.cpp index 3c228964bc..df58cd7db6 100644 --- a/modules/godot_physics_3d/godot_physics_server_3d.cpp +++ b/modules/godot_physics_3d/godot_physics_server_3d.cpp @@ -108,7 +108,7 @@ void GodotPhysicsServer3D::shape_set_data(RID p_shape, const Variant &p_data) { GodotShape3D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL(shape); shape->set_data(p_data); -}; +} void GodotPhysicsServer3D::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) { GodotShape3D *shape = shape_owner.get_or_null(p_shape); @@ -120,14 +120,14 @@ PhysicsServer3D::ShapeType GodotPhysicsServer3D::shape_get_type(RID p_shape) con const GodotShape3D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL_V(shape, SHAPE_CUSTOM); return shape->get_type(); -}; +} Variant GodotPhysicsServer3D::shape_get_data(RID p_shape) const { const GodotShape3D *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_NULL_V(shape, Variant()); ERR_FAIL_COND_V(!shape->is_configured(), Variant()); return shape->get_data(); -}; +} void GodotPhysicsServer3D::shape_set_margin(RID p_shape, real_t p_margin) { } @@ -158,7 +158,7 @@ RID GodotPhysicsServer3D::space_create() { space->set_static_global_body(sgb); return id; -}; +} void GodotPhysicsServer3D::space_set_active(RID p_space, bool p_active) { GodotSpace3D *space = space_owner.get_or_null(p_space); @@ -356,13 +356,13 @@ void GodotPhysicsServer3D::area_set_param(RID p_area, AreaParameter p_param, con GodotArea3D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL(area); area->set_param(p_param, p_value); -}; +} void GodotPhysicsServer3D::area_set_transform(RID p_area, const Transform3D &p_transform) { GodotArea3D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL(area); area->set_transform(p_transform); -}; +} Variant GodotPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) const { if (space_owner.owns(p_area)) { @@ -373,14 +373,14 @@ Variant GodotPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) ERR_FAIL_NULL_V(area, Variant()); return area->get_param(p_param); -}; +} Transform3D GodotPhysicsServer3D::area_get_transform(RID p_area) const { GodotArea3D *area = area_owner.get_or_null(p_area); ERR_FAIL_NULL_V(area, Transform3D()); return area->get_transform(); -}; +} void GodotPhysicsServer3D::area_set_collision_layer(RID p_area, uint32_t p_layer) { GodotArea3D *area = area_owner.get_or_null(p_area); @@ -446,7 +446,7 @@ RID GodotPhysicsServer3D::body_create() { RID rid = body_owner.make_rid(body); body->set_self(rid); return rid; -}; +} void GodotPhysicsServer3D::body_set_space(RID p_body, RID p_space) { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -464,7 +464,7 @@ void GodotPhysicsServer3D::body_set_space(RID p_body, RID p_space) { body->clear_constraint_map(); body->set_space(space); -}; +} RID GodotPhysicsServer3D::body_get_space(RID p_body) const { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -475,21 +475,21 @@ RID GodotPhysicsServer3D::body_get_space(RID p_body) const { return RID(); } return space->get_self(); -}; +} void GodotPhysicsServer3D::body_set_mode(RID p_body, BodyMode p_mode) { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL(body); body->set_mode(p_mode); -}; +} PhysicsServer3D::BodyMode GodotPhysicsServer3D::body_get_mode(RID p_body) const { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, BODY_MODE_STATIC); return body->get_mode(); -}; +} void GodotPhysicsServer3D::body_add_shape(RID p_body, RID p_shape, const Transform3D &p_transform, bool p_disabled) { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -838,7 +838,7 @@ void GodotPhysicsServer3D::body_add_collision_exception(RID p_body, RID p_body_b body->add_exception(p_body_b); body->wakeup(); -}; +} void GodotPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_body_b) { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -846,7 +846,7 @@ void GodotPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_bod body->remove_exception(p_body_b); body->wakeup(); -}; +} void GodotPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -855,31 +855,31 @@ void GodotPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> * for (int i = 0; i < body->get_exceptions().size(); i++) { p_exceptions->push_back(body->get_exceptions()[i]); } -}; +} void GodotPhysicsServer3D::body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL(body); -}; +} real_t GodotPhysicsServer3D::body_get_contacts_reported_depth_threshold(RID p_body) const { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, 0); return 0; -}; +} void GodotPhysicsServer3D::body_set_omit_force_integration(RID p_body, bool p_omit) { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL(body); body->set_omit_force_integration(p_omit); -}; +} bool GodotPhysicsServer3D::body_is_omitting_force_integration(RID p_body) const { GodotBody3D *body = body_owner.get_or_null(p_body); ERR_FAIL_NULL_V(body, false); return body->get_omit_force_integration(); -}; +} void GodotPhysicsServer3D::body_set_max_contacts_reported(RID p_body, int p_contacts) { GodotBody3D *body = body_owner.get_or_null(p_body); @@ -1772,4 +1772,4 @@ GodotPhysicsServer3D::GodotPhysicsServer3D(bool p_using_threads) { GodotBroadPhase3D::create_func = GodotBroadPhase3DBVH::_create; using_threads = p_using_threads; -}; +} diff --git a/modules/godot_physics_3d/godot_soft_body_3d.cpp b/modules/godot_physics_3d/godot_soft_body_3d.cpp index ba47152778..db7319dd91 100644 --- a/modules/godot_physics_3d/godot_soft_body_3d.cpp +++ b/modules/godot_physics_3d/godot_soft_body_3d.cpp @@ -1123,7 +1123,7 @@ struct AABBQueryResult { _FORCE_INLINE_ bool operator()(void *p_data) { return result_callback(soft_body->get_node_index(p_data), userdata); - }; + } }; void GodotSoftBody3D::query_aabb(const AABB &p_aabb, GodotSoftBody3D::QueryResultCallback p_result_callback, void *p_userdata) { @@ -1142,7 +1142,7 @@ struct RayQueryResult { _FORCE_INLINE_ bool operator()(void *p_data) { return result_callback(soft_body->get_face_index(p_data), userdata); - }; + } }; void GodotSoftBody3D::query_ray(const Vector3 &p_from, const Vector3 &p_to, GodotSoftBody3D::QueryResultCallback p_result_callback, void *p_userdata) { diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index b94ce38f72..76c8792723 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -1060,10 +1060,10 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) { } void GridMapEditor::_update_theme() { - options->set_icon(get_theme_icon(SNAME("GridMap"), EditorStringName(EditorIcons))); + options->set_button_icon(get_theme_icon(SNAME("GridMap"), EditorStringName(EditorIcons))); search_box->set_right_icon(get_theme_icon(SNAME("Search"), EditorStringName(EditorIcons))); - mode_thumbnail->set_icon(get_theme_icon(SNAME("FileThumbnail"), EditorStringName(EditorIcons))); - mode_list->set_icon(get_theme_icon(SNAME("FileList"), EditorStringName(EditorIcons))); + mode_thumbnail->set_button_icon(get_theme_icon(SNAME("FileThumbnail"), EditorStringName(EditorIcons))); + mode_list->set_button_icon(get_theme_icon(SNAME("FileList"), EditorStringName(EditorIcons))); } void GridMapEditor::_notification(int p_what) { diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp index a1417681a7..a18c866cb2 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -398,7 +398,7 @@ void EditorInspectorPluginAudioStreamInteractive::_edit(Object *p_object) { void EditorInspectorPluginAudioStreamInteractive::parse_end(Object *p_object) { if (Object::cast_to<AudioStreamInteractive>(p_object)) { Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Transitions")); - button->set_icon(audio_stream_interactive_transition_editor->get_editor_theme_icon(SNAME("Blend"))); + button->set_button_icon(audio_stream_interactive_transition_editor->get_editor_theme_icon(SNAME("Blend"))); button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object)); add_custom_control(button); } diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h index e0f0a5fe23..feb1922eb0 100644 --- a/modules/mbedtls/crypto_mbedtls.h +++ b/modules/mbedtls/crypto_mbedtls.h @@ -59,7 +59,7 @@ public: virtual Error save(const String &p_path, bool p_public_only); virtual String save_to_string(bool p_public_only); virtual Error load_from_string(const String &p_string_key, bool p_public_only); - virtual bool is_public_only() const { return public_only; }; + virtual bool is_public_only() const { return public_only; } CryptoKeyMbedTLS() { mbedtls_pk_init(&pkey); diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp index fccf69095a..aa98cd78e1 100644 --- a/modules/mobile_vr/mobile_vr_interface.cpp +++ b/modules/mobile_vr/mobile_vr_interface.cpp @@ -39,11 +39,11 @@ StringName MobileVRInterface::get_name() const { return "Native mobile"; -}; +} uint32_t MobileVRInterface::get_capabilities() const { return XRInterface::XR_STEREO; -}; +} Vector3 MobileVRInterface::scale_magneto(const Vector3 &p_magnetometer) { // Our magnetometer doesn't give us nice clean data. @@ -100,7 +100,7 @@ Vector3 MobileVRInterface::scale_magneto(const Vector3 &p_magnetometer) { }; return mag_scaled; -}; +} Basis MobileVRInterface::combine_acc_mag(const Vector3 &p_grav, const Vector3 &p_magneto) { // yup, stock standard cross product solution... @@ -119,7 +119,7 @@ Basis MobileVRInterface::combine_acc_mag(const Vector3 &p_grav, const Vector3 &p acc_mag_m3.rows[2] = magneto; return acc_mag_m3; -}; +} void MobileVRInterface::set_position_from_sensors() { _THREAD_SAFE_METHOD_ @@ -217,7 +217,7 @@ void MobileVRInterface::set_position_from_sensors() { head_transform.basis = orientation.orthonormalized(); last_ticks = ticks; -}; +} void MobileVRInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("set_eye_height", "eye_height"), &MobileVRInterface::set_eye_height); @@ -282,51 +282,51 @@ Rect2 MobileVRInterface::get_offset_rect() const { void MobileVRInterface::set_iod(const double p_iod) { intraocular_dist = p_iod; -}; +} double MobileVRInterface::get_iod() const { return intraocular_dist; -}; +} void MobileVRInterface::set_display_width(const double p_display_width) { display_width = p_display_width; -}; +} double MobileVRInterface::get_display_width() const { return display_width; -}; +} void MobileVRInterface::set_display_to_lens(const double p_display_to_lens) { display_to_lens = p_display_to_lens; -}; +} double MobileVRInterface::get_display_to_lens() const { return display_to_lens; -}; +} void MobileVRInterface::set_oversample(const double p_oversample) { oversample = p_oversample; -}; +} double MobileVRInterface::get_oversample() const { return oversample; -}; +} void MobileVRInterface::set_k1(const double p_k1) { k1 = p_k1; -}; +} double MobileVRInterface::get_k1() const { return k1; -}; +} void MobileVRInterface::set_k2(const double p_k2) { k2 = p_k2; -}; +} double MobileVRInterface::get_k2() const { return k2; -}; +} float MobileVRInterface::get_vrs_min_radius() const { return xr_vrs.get_vrs_min_radius(); @@ -347,7 +347,7 @@ void MobileVRInterface::set_vrs_strength(float p_vrs_strength) { uint32_t MobileVRInterface::get_view_count() { // needs stereo... return 2; -}; +} XRInterface::TrackingStatus MobileVRInterface::get_tracking_status() const { return tracking_state; @@ -355,7 +355,7 @@ XRInterface::TrackingStatus MobileVRInterface::get_tracking_status() const { bool MobileVRInterface::is_initialized() const { return (initialized); -}; +} bool MobileVRInterface::initialize() { XRServer *xr_server = XRServer::get_singleton(); @@ -389,7 +389,7 @@ bool MobileVRInterface::initialize() { }; return true; -}; +} void MobileVRInterface::uninitialize() { if (initialized) { @@ -410,7 +410,7 @@ void MobileVRInterface::uninitialize() { initialized = false; }; -}; +} Dictionary MobileVRInterface::get_system_info() { Dictionary dict; @@ -444,7 +444,7 @@ Size2 MobileVRInterface::get_render_target_size() { target_size.y *= oversample; return target_size; -}; +} Transform3D MobileVRInterface::get_camera_transform() { _THREAD_SAFE_METHOD_ @@ -465,7 +465,7 @@ Transform3D MobileVRInterface::get_camera_transform() { } return transform_for_eye; -}; +} Transform3D MobileVRInterface::get_transform_for_view(uint32_t p_view, const Transform3D &p_cam_transform) { _THREAD_SAFE_METHOD_ @@ -499,7 +499,7 @@ Transform3D MobileVRInterface::get_transform_for_view(uint32_t p_view, const Tra }; return transform_for_eye; -}; +} Projection MobileVRInterface::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) { _THREAD_SAFE_METHOD_ @@ -510,7 +510,7 @@ Projection MobileVRInterface::get_projection_for_view(uint32_t p_view, double p_ eye.set_for_hmd(p_view + 1, p_aspect, intraocular_dist, display_width, display_to_lens, oversample, p_z_near, p_z_far); return eye; -}; +} Vector<BlitToScreen> MobileVRInterface::post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) { _THREAD_SAFE_METHOD_ @@ -573,7 +573,7 @@ void MobileVRInterface::process() { head->set_pose("default", head_transform, Vector3(), Vector3(), tracking_confidence); } }; -}; +} RID MobileVRInterface::get_vrs_texture() { PackedVector2Array eye_foci; @@ -599,4 +599,4 @@ MobileVRInterface::~MobileVRInterface() { if (is_initialized()) { uninitialize(); }; -}; +} diff --git a/modules/mobile_vr/mobile_vr_interface.h b/modules/mobile_vr/mobile_vr_interface.h index 9b1987bafa..a582b611cc 100644 --- a/modules/mobile_vr/mobile_vr_interface.h +++ b/modules/mobile_vr/mobile_vr_interface.h @@ -99,19 +99,19 @@ private: float floor_decimals(const float p_value, const float p_decimals) { float power_of_10 = pow(10.0f, p_decimals); return floor(p_value * power_of_10) / power_of_10; - }; + } Vector3 floor_decimals(const Vector3 &p_vector, const float p_decimals) { return Vector3(floor_decimals(p_vector.x, p_decimals), floor_decimals(p_vector.y, p_decimals), floor_decimals(p_vector.z, p_decimals)); - }; + } Vector3 low_pass(const Vector3 &p_vector, const Vector3 &p_last_vector, const float p_factor) { return p_vector + (p_factor * (p_last_vector - p_vector)); - }; + } Vector3 scrub(const Vector3 &p_vector, const Vector3 &p_last_vector, const float p_decimals, const float p_factor) { return low_pass(floor_decimals(p_vector, p_decimals), p_last_vector, p_factor); - }; + } void set_position_from_sensors(); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index f516683954..fea0eb1327 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -502,8 +502,8 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() } _recursion_flag_ = true; SCOPE_EXIT { - _recursion_flag_ = false; - }; + _recursion_flag_ = false; // clang-format off + }; // clang-format on if (!gdmono || !gdmono->is_runtime_initialized()) { return Vector<StackInfo>(); diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index 1c30fe541c..e0e3625c23 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -47,11 +47,11 @@ void EditorNetworkProfiler::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { if (activate->is_pressed()) { - activate->set_icon(theme_cache.stop_icon); + activate->set_button_icon(theme_cache.stop_icon); } else { - activate->set_icon(theme_cache.play_icon); + activate->set_button_icon(theme_cache.play_icon); } - clear_button->set_icon(theme_cache.clear_icon); + clear_button->set_button_icon(theme_cache.clear_icon); incoming_bandwidth_text->set_right_icon(theme_cache.incoming_bandwidth_icon); outgoing_bandwidth_text->set_right_icon(theme_cache.outgoing_bandwidth_icon); @@ -186,10 +186,10 @@ void EditorNetworkProfiler::_activate_pressed() { void EditorNetworkProfiler::_update_button_text() { if (activate->is_pressed()) { - activate->set_icon(theme_cache.stop_icon); + activate->set_button_icon(theme_cache.stop_icon); activate->set_text(TTR("Stop")); } else { - activate->set_icon(theme_cache.play_icon); + activate->set_button_icon(theme_cache.play_icon); activate->set_text(TTR("Start")); } } diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index c07f47798c..c57e1a7f51 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -355,8 +355,8 @@ void ReplicationEditor::_notification(int p_what) { } case NOTIFICATION_ENTER_TREE: { add_theme_style_override(SceneStringName(panel), EditorNode::get_singleton()->get_editor_theme()->get_stylebox(SceneStringName(panel), SNAME("Panel"))); - add_pick_button->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); - pin->set_icon(get_theme_icon(SNAME("Pin"), EditorStringName(EditorIcons))); + add_pick_button->set_button_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); + pin->set_button_icon(get_theme_icon(SNAME("Pin"), EditorStringName(EditorIcons))); } break; } } diff --git a/modules/multiplayer/scene_multiplayer.h b/modules/multiplayer/scene_multiplayer.h index 108d7b9e83..d6305c7803 100644 --- a/modules/multiplayer/scene_multiplayer.h +++ b/modules/multiplayer/scene_multiplayer.h @@ -54,14 +54,14 @@ public: virtual void set_target_peer(int p_peer_id) override {} virtual int get_packet_peer() const override { return 0; } - virtual TransferMode get_packet_mode() const override { return TRANSFER_MODE_RELIABLE; }; + virtual TransferMode get_packet_mode() const override { return TRANSFER_MODE_RELIABLE; } virtual int get_packet_channel() const override { return 0; } virtual void disconnect_peer(int p_peer, bool p_force = false) override {} virtual bool is_server() const override { return true; } virtual void poll() override {} virtual void close() override {} virtual int get_unique_id() const override { return TARGET_PEER_SERVER; } - virtual ConnectionStatus get_connection_status() const override { return CONNECTION_CONNECTED; }; + virtual ConnectionStatus get_connection_status() const override { return CONNECTION_CONNECTED; } }; class SceneMultiplayer : public MultiplayerAPI { diff --git a/modules/navigation/2d/nav_mesh_generator_2d.cpp b/modules/navigation/2d/nav_mesh_generator_2d.cpp index 592fc5113f..44f45529ca 100644 --- a/modules/navigation/2d/nav_mesh_generator_2d.cpp +++ b/modules/navigation/2d/nav_mesh_generator_2d.cpp @@ -757,7 +757,7 @@ void NavMeshGenerator2D::generator_parse_source_geometry_data(Ref<NavigationPoly for (Node *E : parse_nodes) { generator_parse_geometry_node(p_navigation_mesh, p_source_geometry_data, E, recurse_children); } -}; +} static void generator_recursive_process_polytree_items(List<TPPLPoly> &p_tppl_in_polygon, const Clipper2Lib::PolyPathD *p_polypath_item) { using namespace Clipper2Lib; diff --git a/modules/navigation/3d/nav_mesh_generator_3d.cpp b/modules/navigation/3d/nav_mesh_generator_3d.cpp index 4cf76bed55..bfbd8d539f 100644 --- a/modules/navigation/3d/nav_mesh_generator_3d.cpp +++ b/modules/navigation/3d/nav_mesh_generator_3d.cpp @@ -662,7 +662,7 @@ void NavMeshGenerator3D::generator_parse_source_geometry_data(const Ref<Navigati for (Node *parse_node : parse_nodes) { generator_parse_geometry_node(p_navigation_mesh, p_source_geometry_data, parse_node, recurse_children); } -}; +} void NavMeshGenerator3D::generator_bake_from_source_geometry_data(Ref<NavigationMesh> p_navigation_mesh, const Ref<NavigationMeshSourceGeometryData3D> &p_source_geometry_data) { if (p_navigation_mesh.is_null() || p_source_geometry_data.is_null()) { diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp index 65c1d39a6c..9799cee208 100644 --- a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp +++ b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp @@ -56,8 +56,8 @@ void NavigationMeshEditor::_node_removed(Node *p_node) { void NavigationMeshEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - button_bake->set_icon(get_theme_icon(SNAME("Bake"), EditorStringName(EditorIcons))); - button_reset->set_icon(get_theme_icon(SNAME("Reload"), EditorStringName(EditorIcons))); + button_bake->set_button_icon(get_theme_icon(SNAME("Bake"), EditorStringName(EditorIcons))); + button_reset->set_button_icon(get_theme_icon(SNAME("Reload"), EditorStringName(EditorIcons))); } break; } } diff --git a/modules/navigation/nav_agent.cpp b/modules/navigation/nav_agent.cpp index cb26ab9cbb..fbc39115fc 100644 --- a/modules/navigation/nav_agent.cpp +++ b/modules/navigation/nav_agent.cpp @@ -310,7 +310,7 @@ void NavAgent::set_avoidance_priority(real_t p_priority) { rvo_agent_2d.avoidance_priority_ = avoidance_priority; } agent_dirty = true; -}; +} bool NavAgent::check_dirty() { const bool was_dirty = agent_dirty; diff --git a/modules/navigation/nav_agent.h b/modules/navigation/nav_agent.h index 8dd9ed7bb2..ff5ddf03f8 100644 --- a/modules/navigation/nav_agent.h +++ b/modules/navigation/nav_agent.h @@ -132,13 +132,13 @@ public: const Vector3 &get_velocity_forced() const { return velocity_forced; } void set_avoidance_layers(uint32_t p_layers); - uint32_t get_avoidance_layers() const { return avoidance_layers; }; + uint32_t get_avoidance_layers() const { return avoidance_layers; } void set_avoidance_mask(uint32_t p_mask); - uint32_t get_avoidance_mask() const { return avoidance_mask; }; + uint32_t get_avoidance_mask() const { return avoidance_mask; } void set_avoidance_priority(real_t p_priority); - real_t get_avoidance_priority() const { return avoidance_priority; }; + real_t get_avoidance_priority() const { return avoidance_priority; } void set_paused(bool p_paused); bool get_paused() const; diff --git a/modules/navigation/nav_link.cpp b/modules/navigation/nav_link.cpp index df538d10e2..11645b3302 100644 --- a/modules/navigation/nav_link.cpp +++ b/modules/navigation/nav_link.cpp @@ -59,7 +59,7 @@ void NavLink::set_enabled(bool p_enabled) { // TODO: This should not require a full rebuild as the link has not really changed. link_dirty = true; -}; +} void NavLink::set_bidirectional(bool p_bidirectional) { if (bidirectional == p_bidirectional) { diff --git a/modules/navigation/nav_obstacle.h b/modules/navigation/nav_obstacle.h index f8303677b3..9a5cbc0256 100644 --- a/modules/navigation/nav_obstacle.h +++ b/modules/navigation/nav_obstacle.h @@ -94,7 +94,7 @@ public: bool is_map_changed(); void set_avoidance_layers(uint32_t p_layers); - uint32_t get_avoidance_layers() const { return avoidance_layers; }; + uint32_t get_avoidance_layers() const { return avoidance_layers; } void set_paused(bool p_paused); bool get_paused() const; diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp index 2278822eac..716c1e3e78 100644 --- a/modules/navigation/nav_region.cpp +++ b/modules/navigation/nav_region.cpp @@ -61,7 +61,7 @@ void NavRegion::set_enabled(bool p_enabled) { // TODO: This should not require a full rebuild as the region has not really changed. polygons_dirty = true; -}; +} void NavRegion::set_use_edge_connections(bool p_enabled) { if (use_edge_connections != p_enabled) { diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h index b13641f824..61f382f889 100644 --- a/modules/navigation/nav_region.h +++ b/modules/navigation/nav_region.h @@ -96,7 +96,7 @@ public: gd::ClosestPointQueryResult get_closest_point_info(const Vector3 &p_point) const; Vector3 get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const; - real_t get_surface_area() const { return surface_area; }; + real_t get_surface_area() const { return surface_area; } bool sync(); diff --git a/modules/noise/tests/test_noise_texture_2d.h b/modules/noise/tests/test_noise_texture_2d.h index c1aefde3dc..18667cfbf2 100644 --- a/modules/noise/tests/test_noise_texture_2d.h +++ b/modules/noise/tests/test_noise_texture_2d.h @@ -46,7 +46,7 @@ class NoiseTextureTester : public RefCounted { public: NoiseTextureTester(const NoiseTexture2D *const p_texture) : - texture{ p_texture } {}; + texture{ p_texture } {} Color compute_average_color(const Ref<Image> &p_noise_image) { Color r_avg_color{}; diff --git a/modules/noise/tests/test_noise_texture_3d.h b/modules/noise/tests/test_noise_texture_3d.h index 1a102dcfb7..e02f597e1d 100644 --- a/modules/noise/tests/test_noise_texture_3d.h +++ b/modules/noise/tests/test_noise_texture_3d.h @@ -46,7 +46,7 @@ class NoiseTexture3DTester : public RefCounted { public: NoiseTexture3DTester(const NoiseTexture3D *const p_texture) : - texture{ p_texture } {}; + texture{ p_texture } {} Color compute_average_color(const Ref<Image> &p_noise_image) { Color r_avg_color{}; diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index f926153c84..ac310d66ca 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -43,7 +43,7 @@ void OpenXRActionEditor::_bind_methods() { } void OpenXRActionEditor::_theme_changed() { - rem_action->set_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); + rem_action->set_button_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); } void OpenXRActionEditor::_notification(int p_what) { diff --git a/modules/openxr/editor/openxr_action_editor.h b/modules/openxr/editor/openxr_action_editor.h index 1d98ab9776..083c8df36d 100644 --- a/modules/openxr/editor/openxr_action_editor.h +++ b/modules/openxr/editor/openxr_action_editor.h @@ -70,7 +70,7 @@ protected: void _do_set_action_type(OpenXRAction::ActionType p_action_type); public: - Ref<OpenXRAction> get_action() { return action; }; + Ref<OpenXRAction> get_action() { return action; } OpenXRActionEditor(Ref<OpenXRAction> p_action); }; diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp index 732fdbe508..2f6a85b99d 100644 --- a/modules/openxr/editor/openxr_action_set_editor.cpp +++ b/modules/openxr/editor/openxr_action_set_editor.cpp @@ -48,16 +48,16 @@ void OpenXRActionSetEditor::_bind_methods() { void OpenXRActionSetEditor::_set_fold_icon() { if (is_expanded) { - fold_btn->set_icon(get_theme_icon(SNAME("GuiTreeArrowDown"), EditorStringName(EditorIcons))); + fold_btn->set_button_icon(get_theme_icon(SNAME("GuiTreeArrowDown"), EditorStringName(EditorIcons))); } else { - fold_btn->set_icon(get_theme_icon(SNAME("GuiTreeArrowRight"), EditorStringName(EditorIcons))); + fold_btn->set_button_icon(get_theme_icon(SNAME("GuiTreeArrowRight"), EditorStringName(EditorIcons))); } } void OpenXRActionSetEditor::_theme_changed() { _set_fold_icon(); - add_action->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); - rem_action_set->set_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); + add_action->set_button_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); + rem_action_set->set_button_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); } void OpenXRActionSetEditor::_notification(int p_what) { diff --git a/modules/openxr/editor/openxr_action_set_editor.h b/modules/openxr/editor/openxr_action_set_editor.h index 3045c42364..de1f889a3d 100644 --- a/modules/openxr/editor/openxr_action_set_editor.h +++ b/modules/openxr/editor/openxr_action_set_editor.h @@ -89,7 +89,7 @@ protected: void _do_remove_action_editor(OpenXRActionEditor *p_action_editor); public: - Ref<OpenXRActionSet> get_action_set() { return action_set; }; + Ref<OpenXRActionSet> get_action_set() { return action_set; } void set_focus_on_entry(); void remove_all_actions(); diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index e8c3861871..80887f29c8 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -220,7 +220,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co path_hb->add_child(type_label); Button *path_add = memnew(Button); - path_add->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); + path_add->set_button_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); path_add->set_flat(true); path_add->connect(SceneStringName(pressed), callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path))); path_hb->add_child(path_add); @@ -247,7 +247,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *action_rem = memnew(Button); action_rem->set_flat(true); - action_rem->set_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); + action_rem->set_button_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); action_rem->connect(SceneStringName(pressed), callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path))); action_hb->add_child(action_rem); } diff --git a/modules/openxr/extensions/platform/openxr_opengl_extension.cpp b/modules/openxr/extensions/platform/openxr_opengl_extension.cpp index 34c4bbf3c5..62be546790 100644 --- a/modules/openxr/extensions/platform/openxr_opengl_extension.cpp +++ b/modules/openxr/extensions/platform/openxr_opengl_extension.cpp @@ -66,7 +66,7 @@ HashMap<String, bool *> OpenXROpenGLExtension::get_requested_extensions() { #else request_extensions[XR_KHR_OPENGL_ENABLE_EXTENSION_NAME] = nullptr; #endif -#if defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED) +#if defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED) && defined(WAYLAND_ENABLED) request_extensions[XR_MNDX_EGL_ENABLE_EXTENSION_NAME] = &egl_extension_enabled; #endif @@ -137,7 +137,7 @@ XrGraphicsBindingOpenGLESAndroidKHR OpenXROpenGLExtension::graphics_binding_gl; #ifdef X11_ENABLED XrGraphicsBindingOpenGLXlibKHR OpenXROpenGLExtension::graphics_binding_gl; #endif -#ifdef EGL_ENABLED +#if defined(EGL_ENABLED) && defined(WAYLAND_ENABLED) XrGraphicsBindingEGLMNDX OpenXROpenGLExtension::graphics_binding_egl; #endif #endif diff --git a/modules/openxr/extensions/platform/openxr_opengl_extension.h b/modules/openxr/extensions/platform/openxr_opengl_extension.h index 6ebdbb31f8..6e535e012a 100644 --- a/modules/openxr/extensions/platform/openxr_opengl_extension.h +++ b/modules/openxr/extensions/platform/openxr_opengl_extension.h @@ -70,7 +70,7 @@ private: #ifdef X11_ENABLED static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl; #endif -#ifdef EGL_ENABLED +#if defined(EGL_ENABLED) && defined(WAYLAND_ENABLED) static XrGraphicsBindingEGLMNDX graphics_binding_egl; bool egl_extension_enabled = false; diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index b6e475f8cd..def3c87f0c 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -1296,7 +1296,7 @@ bool OpenXRAPI::create_main_swapchains(Size2i p_size) { } return true; -}; +} void OpenXRAPI::destroy_session() { // TODO need to figure out if we're still rendering our current frame @@ -2355,7 +2355,7 @@ void OpenXRAPI::post_draw_viewport(RID p_render_target) { for (OpenXRExtensionWrapper *wrapper : registered_extension_wrappers) { wrapper->on_post_draw_viewport(p_render_target); } -}; +} void OpenXRAPI::end_frame() { XrResult result; diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h index c1cd5f7cc2..0045567a4c 100644 --- a/modules/openxr/openxr_api.h +++ b/modules/openxr/openxr_api.h @@ -398,12 +398,12 @@ private: } public: - XrInstance get_instance() const { return instance; }; - XrSystemId get_system_id() const { return system_id; }; - XrSession get_session() const { return session; }; - OpenXRGraphicsExtensionWrapper *get_graphics_extension() const { return graphics_extension; }; - String get_runtime_name() const { return runtime_name; }; - String get_runtime_version() const { return runtime_version; }; + XrInstance get_instance() const { return instance; } + XrSystemId get_system_id() const { return system_id; } + XrSession get_session() const { return session; } + OpenXRGraphicsExtensionWrapper *get_graphics_extension() const { return graphics_extension; } + String get_runtime_name() const { return runtime_name; } + String get_runtime_version() const { return runtime_version; } // helper method to convert an XrPosef to a Transform3D Transform3D transform_from_pose(const XrPosef &p_pose); diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index 9ef358966e..f600891ec8 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -162,11 +162,11 @@ void OpenXRInterface::_bind_methods() { StringName OpenXRInterface::get_name() const { return StringName("OpenXR"); -}; +} uint32_t OpenXRInterface::get_capabilities() const { return XRInterface::XR_VR + XRInterface::XR_STEREO; -}; +} PackedStringArray OpenXRInterface::get_suggested_tracker_names() const { // These are hardcoded in OpenXR, note that they will only be available if added to our action map @@ -613,7 +613,7 @@ bool OpenXRInterface::initialize_on_startup() const { bool OpenXRInterface::is_initialized() const { return initialized; -}; +} bool OpenXRInterface::initialize() { XRServer *xr_server = XRServer::get_singleton(); diff --git a/modules/raycast/raycast_occlusion_cull.cpp b/modules/raycast/raycast_occlusion_cull.cpp index 0d99212795..7e963e788e 100644 --- a/modules/raycast/raycast_occlusion_cull.cpp +++ b/modules/raycast/raycast_occlusion_cull.cpp @@ -142,7 +142,7 @@ void RaycastOcclusionCull::RaycastHZBuffer::_generate_camera_rays(const CameraRa Vector3 dir; if (p_data->camera_orthogonal) { - dir = -p_data->camera_dir; + dir = p_data->camera_dir; tile.ray.org_x[j] = pixel_pos.x - dir.x * p_data->z_near; tile.ray.org_y[j] = pixel_pos.y - dir.y * p_data->z_near; tile.ray.org_z[j] = pixel_pos.z - dir.z * p_data->z_near; diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub index f1dcef6667..f6aa242698 100644 --- a/modules/text_server_adv/SCsub +++ b/modules/text_server_adv/SCsub @@ -477,7 +477,7 @@ if env["builtin_icu4c"]: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - icu_data_name = "icudt75l.dat" + icu_data_name = "icudt76l.dat" if env.editor_build: env_icu.Depends("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name) diff --git a/modules/text_server_adv/gdextension_build/SConstruct b/modules/text_server_adv/gdextension_build/SConstruct index 4c305f3b3f..fb705eaa50 100644 --- a/modules/text_server_adv/gdextension_build/SConstruct +++ b/modules/text_server_adv/gdextension_build/SConstruct @@ -717,7 +717,7 @@ thirdparty_icu_sources = [ ] thirdparty_icu_sources = [thirdparty_icu_dir + file for file in thirdparty_icu_sources] -icu_data_name = "icudt75l.dat" +icu_data_name = "icudt76l.dat" if env["static_icu_data"]: env_icu.Depends("../../../thirdparty/icu4c/icudata.gen.h", "../../../thirdparty/icu4c/" + icu_data_name) diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index d26fde70b1..519520e737 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -98,6 +98,11 @@ using namespace godot; // Thirdparty headers. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#endif + #include <unicode/ubidi.h> #include <unicode/ubrk.h> #include <unicode/uchar.h> @@ -111,6 +116,10 @@ using namespace godot; #include <unicode/ustring.h> #include <unicode/utypes.h> +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #ifdef MODULE_FREETYPE_ENABLED #include <ft2build.h> #include FT_FREETYPE_H diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 14636f27a0..8919e320d0 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -158,11 +158,11 @@ bool TextServerFallback::_has(const RID &p_rid) { String TextServerFallback::_get_support_data_filename() const { return ""; -}; +} String TextServerFallback::_get_support_data_info() const { return "Not supported"; -}; +} bool TextServerFallback::_load_support_data(const String &p_filename) { return false; // No extra data used. @@ -4730,7 +4730,7 @@ void TextServerFallback::_update_settings() { TextServerFallback::TextServerFallback() { _insert_feature_sets(); ProjectSettings::get_singleton()->connect("settings_changed", callable_mp(this, &TextServerFallback::_update_settings)); -}; +} void TextServerFallback::_cleanup() { for (const KeyValue<SystemFontKey, SystemFontCache> &E : system_fonts) { @@ -4749,4 +4749,4 @@ TextServerFallback::~TextServerFallback() { FT_Done_FreeType(ft_library); } #endif -}; +} diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index ff8a6f9dab..933271406c 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -647,7 +647,7 @@ VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() { memdelete(thread_sem); #endif clear(); -}; +} void VideoStreamTheora::_bind_methods() {} diff --git a/modules/webrtc/webrtc_peer_connection_js.cpp b/modules/webrtc/webrtc_peer_connection_js.cpp index 8fe27fdbad..cf1ca1e31b 100644 --- a/modules/webrtc/webrtc_peer_connection_js.cpp +++ b/modules/webrtc/webrtc_peer_connection_js.cpp @@ -152,5 +152,5 @@ WebRTCPeerConnectionJS::~WebRTCPeerConnectionJS() { godot_js_rtc_pc_destroy(_js_id); _js_id = 0; } -}; +} #endif diff --git a/modules/websocket/emws_peer.h b/modules/websocket/emws_peer.h index d2b365adb4..9b1eff58aa 100644 --- a/modules/websocket/emws_peer.h +++ b/modules/websocket/emws_peer.h @@ -86,7 +86,7 @@ public: virtual int get_available_packet_count() const override; virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override; - virtual int get_max_packet_size() const override { return packet_buffer.size(); }; + virtual int get_max_packet_size() const override { return packet_buffer.size(); } // WebSocketPeer virtual Error send(const uint8_t *p_buffer, int p_buffer_size, WriteMode p_mode) override; diff --git a/modules/websocket/wsl_peer.h b/modules/websocket/wsl_peer.h index 5d881f80d8..0cc46adae7 100644 --- a/modules/websocket/wsl_peer.h +++ b/modules/websocket/wsl_peer.h @@ -129,7 +129,7 @@ public: virtual int get_available_packet_count() const override; virtual Error get_packet(const uint8_t **r_buffer, int &r_buffer_size) override; virtual Error put_packet(const uint8_t *p_buffer, int p_buffer_size) override; - virtual int get_max_packet_size() const override { return packet_buffer.size(); }; + virtual int get_max_packet_size() const override { return packet_buffer.size(); } // WebSocketPeer virtual Error send(const uint8_t *p_buffer, int p_buffer_size, WriteMode p_mode) override; diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 82a2ada3ed..d35514c82c 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -273,19 +273,19 @@ void WebXRInterfaceJS::_set_environment_blend_mode(String p_blend_mode_string) { StringName WebXRInterfaceJS::get_name() const { return "WebXR"; -}; +} uint32_t WebXRInterfaceJS::get_capabilities() const { return XRInterface::XR_STEREO | XRInterface::XR_MONO | XRInterface::XR_VR | XRInterface::XR_AR; -}; +} uint32_t WebXRInterfaceJS::get_view_count() { return godot_webxr_get_view_count(); -}; +} bool WebXRInterfaceJS::is_initialized() const { return (initialized); -}; +} bool WebXRInterfaceJS::initialize() { XRServer *xr_server = XRServer::get_singleton(); @@ -335,7 +335,7 @@ bool WebXRInterfaceJS::initialize() { }; return true; -}; +} void WebXRInterfaceJS::uninitialize() { if (initialized) { @@ -380,7 +380,7 @@ void WebXRInterfaceJS::uninitialize() { environment_blend_mode = XRInterface::XR_ENV_BLEND_MODE_OPAQUE; initialized = false; }; -}; +} Dictionary WebXRInterfaceJS::get_system_info() { Dictionary dict; @@ -429,7 +429,7 @@ Size2 WebXRInterfaceJS::get_render_target_size() { render_targetsize.height = (float)js_size[1]; return render_targetsize; -}; +} Transform3D WebXRInterfaceJS::get_camera_transform() { Transform3D camera_transform; @@ -447,7 +447,7 @@ Transform3D WebXRInterfaceJS::get_camera_transform() { } return camera_transform; -}; +} Transform3D WebXRInterfaceJS::get_transform_for_view(uint32_t p_view, const Transform3D &p_cam_transform) { XRServer *xr_server = XRServer::get_singleton(); @@ -466,7 +466,7 @@ Transform3D WebXRInterfaceJS::get_transform_for_view(uint32_t p_view, const Tran transform_for_view.origin *= world_scale; return p_cam_transform * xr_server->get_reference_frame() * transform_for_view; -}; +} Projection WebXRInterfaceJS::get_projection_for_view(uint32_t p_view, double p_aspect, double p_z_near, double p_z_far) { Projection view; @@ -529,7 +529,7 @@ Vector<BlitToScreen> WebXRInterfaceJS::post_draw_viewport(RID p_render_target, c texture_storage->render_target_set_reattach_textures(p_render_target, false); return blit_to_screen; -}; +} RID WebXRInterfaceJS::_get_color_texture() { unsigned int texture_id = godot_webxr_get_color_texture(); @@ -610,7 +610,7 @@ void WebXRInterfaceJS::process() { _update_input_source(i); } }; -}; +} void WebXRInterfaceJS::_update_input_source(int p_input_source_id) { XRServer *xr_server = XRServer::get_singleton(); @@ -873,13 +873,13 @@ WebXRInterfaceJS::WebXRInterfaceJS() { initialized = false; session_mode = "inline"; requested_reference_space_types = "local"; -}; +} WebXRInterfaceJS::~WebXRInterfaceJS() { // and make sure we cleanup if we haven't already if (initialized) { uninitialize(); }; -}; +} #endif // WEB_ENABLED |