From 92352acc572976b39c30fe77cb9dcb83acea4313 Mon Sep 17 00:00:00 2001 From: CoolSpy3 <55305038+CoolSpy3@users.noreply.github.com> Date: Sun, 15 Jun 2025 10:17:57 -0700 Subject: [PATCH 1/3] Fix `wb_speaker_play_sound` Request Message (#6843) * fix speaker_play_sound message * update changelog * changelog clarification --- docs/reference/changelog-r2025.md | 1 + src/controller/c/speaker.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/reference/changelog-r2025.md b/docs/reference/changelog-r2025.md index 8dcb0004235..99dd770f49c 100644 --- a/docs/reference/changelog-r2025.md +++ b/docs/reference/changelog-r2025.md @@ -3,6 +3,7 @@ ## Webots R2025b - Bug Fixes - Fixed a bug preventing the `webots-controller` executable from running on arm-based mac devices ([#6806](https://github.com/cyberbotics/webots/pull/6806)). + - Fixed a bug causing Webots to crash when multiple sounds were used with a [Speaker](speaker.md) node ([#6843](https://github.com/cyberbotics/webots/pull/6843)). ## Webots R2025a Released on January 31st, 2025. diff --git a/src/controller/c/speaker.c b/src/controller/c/speaker.c index cd11ce8e3c6..32e02cd1118 100644 --- a/src/controller/c/speaker.c +++ b/src/controller/c/speaker.c @@ -258,17 +258,17 @@ static void speaker_write_request(WbDevice *d, WbRequest *r) { request_write_char(r, 1); else request_write_char(r, 0); - } - request_write_int32(r, sound->upload_size); - if (sound->upload_size) { - /* Sound data available to stream, send it one time and discard it. - * Webots will cache the data inside the device. - */ - request_write_data(r, sound->upload_data, sound->upload_size); - free(sound->upload_data); - sound->upload_data = NULL; - sound->upload_size = 0; + request_write_int32(r, sound->upload_size); + if (sound->upload_size) { + /* Sound data available to stream, send it one time and discard it. + * Webots will cache the data inside the device. + */ + request_write_data(r, sound->upload_data, sound->upload_size); + free(sound->upload_data); + sound->upload_data = NULL; + sound->upload_size = 0; + } } sound->need_update = false; From 5e8942c0993e49e19b42ef8ebefcc2c346ab7b4a Mon Sep 17 00:00:00 2001 From: CoolSpy3 <55305038+CoolSpy3@users.noreply.github.com> Date: Sun, 15 Jun 2025 22:47:13 -0700 Subject: [PATCH 2/3] Fix Checking of Reload/Reset Selection in WbBuildEditor (#6844) * fix reload button checking in WbBuildEditor popup * update changelog * fix pointer syntax * use const-pointers where applicable --- docs/reference/changelog-r2025.md | 1 + src/webots/editor/WbBuildEditor.cpp | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/reference/changelog-r2025.md b/docs/reference/changelog-r2025.md index 99dd770f49c..114982338d7 100644 --- a/docs/reference/changelog-r2025.md +++ b/docs/reference/changelog-r2025.md @@ -4,6 +4,7 @@ - Bug Fixes - Fixed a bug preventing the `webots-controller` executable from running on arm-based mac devices ([#6806](https://github.com/cyberbotics/webots/pull/6806)). - Fixed a bug causing Webots to crash when multiple sounds were used with a [Speaker](speaker.md) node ([#6843](https://github.com/cyberbotics/webots/pull/6843)). + - Fixed a bug causing the "Reload/Reset" buttons in the controller recompilation popup to not work on Windows ([#6844](https://github.com/cyberbotics/webots/pull/6844)). ## Webots R2025a Released on January 31st, 2025. diff --git a/src/webots/editor/WbBuildEditor.cpp b/src/webots/editor/WbBuildEditor.cpp index 51da84d4b93..9bc52adda9d 100644 --- a/src/webots/editor/WbBuildEditor.cpp +++ b/src/webots/editor/WbBuildEditor.cpp @@ -28,6 +28,7 @@ #include "../../../include/controller/c/webots/utils/ansi_codes.h" #include +#include #include #include @@ -268,12 +269,16 @@ void WbBuildEditor::reloadMessageBoxIfNeeded() { if (WbMessageBox::enabled()) { QMessageBox messageBox(QMessageBox::Question, tr("Compilation successful"), tr("Do you want to reset or reload the world?"), QMessageBox::Cancel, this); - messageBox.addButton(tr("Reload"), QMessageBox::AcceptRole); - messageBox.setDefaultButton(messageBox.addButton(tr("Reset"), QMessageBox::AcceptRole)); - const int ret = messageBox.exec(); - if (ret == 0) + const QPushButton *reloadButton = messageBox.addButton(tr("Reload"), QMessageBox::AcceptRole); + QPushButton *resetButton = messageBox.addButton(tr("Reset"), QMessageBox::AcceptRole); + messageBox.setDefaultButton(resetButton); + + messageBox.exec(); + + const QAbstractButton *clickedButton = messageBox.clickedButton(); + if (clickedButton == reloadButton) emit reloadRequested(); - else if (ret == 1) + else if (clickedButton == resetButton) emit resetRequested(); } } else From ee34f4e2d1eb936ccf32e3e2c38f55940374d4c8 Mon Sep 17 00:00:00 2001 From: CoolSpy3 <55305038+CoolSpy3@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:14:50 -0700 Subject: [PATCH 3/3] use QImage::flipped instead of QImage::mirrored in WbWrenTextureOverlay (#6850) --- src/webots/wren/WbWrenTextureOverlay.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/webots/wren/WbWrenTextureOverlay.cpp b/src/webots/wren/WbWrenTextureOverlay.cpp index b8647c2b78a..80aa032dc2c 100644 --- a/src/webots/wren/WbWrenTextureOverlay.cpp +++ b/src/webots/wren/WbWrenTextureOverlay.cpp @@ -272,7 +272,15 @@ WrTexture2d *WbWrenTextureOverlay::createIconTexture(QString filePath) { return imageTexture; QImageReader imageReader(filePath); - QImage image = imageReader.read().mirrored(false, true); // account for inverted Y axis in OpenGL + QImage image = imageReader.read(); + + // account for inverted Y axis in OpenGL +#ifdef _WIN32 // Windows builds against a newer version of Qt, which deprecates `mirrored` + image = image.flipped(Qt::Vertical); +#else + image = image.mirrored(false, true); +#endif + const bool isTranslucent = image.pixelFormat().alphaUsage() == QPixelFormat::UsesAlpha; imageTexture = wr_texture_2d_new();