diff --git a/docs/reference/changelog-r2025.md b/docs/reference/changelog-r2025.md index 8dcb0004235..114982338d7 100644 --- a/docs/reference/changelog-r2025.md +++ b/docs/reference/changelog-r2025.md @@ -3,6 +3,8 @@ ## 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)). + - 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/projects/samples/contests/ratslife/controllers/contest_manager/boolean.h b/projects/samples/contests/ratslife/controllers/contest_manager/boolean.h deleted file mode 100644 index 6959f499ac4..00000000000 --- a/projects/samples/contests/ratslife/controllers/contest_manager/boolean.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 1996-2024 Cyberbotics Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Description: Boolean type - */ - -#ifndef BOOLEAN_H -#define BOOLEAN_H - -#if !defined(bool) && !defined(true) && !defined(false) -typedef enum { false, true } bool; -#endif - -#endif diff --git a/projects/samples/contests/ratslife/controllers/contest_manager/maze_definition.h b/projects/samples/contests/ratslife/controllers/contest_manager/maze_definition.h index bc7ab74ea16..d255852cc7f 100644 --- a/projects/samples/contests/ratslife/controllers/contest_manager/maze_definition.h +++ b/projects/samples/contests/ratslife/controllers/contest_manager/maze_definition.h @@ -21,7 +21,7 @@ #ifndef MAZE_DEFINITION_H #define MAZE_DEFINITION_H -#include "boolean.h" +#include #include "linked_list.h" // enum typedef enum { North, South, East, West, None } Orientation; diff --git a/projects/samples/contests/ratslife/controllers/contest_manager/round_manager.c b/projects/samples/contests/ratslife/controllers/contest_manager/round_manager.c index 62fd710bd7e..ad2ea940b7b 100644 --- a/projects/samples/contests/ratslife/controllers/contest_manager/round_manager.c +++ b/projects/samples/contests/ratslife/controllers/contest_manager/round_manager.c @@ -20,7 +20,7 @@ #include "round_manager.h" -#include "boolean.h" +#include #include "helper.h" #include diff --git a/projects/samples/contests/ratslife/controllers/contest_manager/texture_generator.c b/projects/samples/contests/ratslife/controllers/contest_manager/texture_generator.c index e6c9ad58dbe..f1b9a7f923a 100644 --- a/projects/samples/contests/ratslife/controllers/contest_manager/texture_generator.c +++ b/projects/samples/contests/ratslife/controllers/contest_manager/texture_generator.c @@ -22,7 +22,7 @@ #include #include -#include "boolean.h" +#include #include "helper.h" #include "parameters.h" #include "texture_generator.h" 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; 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 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();