Don't use by reference capture by default (#1207)

replace [&] with [this] or [] where possible to avoid people
accidentally capturing something by reference that needs to be
copied, like strings.
This commit is contained in:
Dennis Brakhane
2025-08-13 08:46:42 +02:00
committed by GitHub
parent 22674314ac
commit f0bd5a8086
23 changed files with 195 additions and 195 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ void SoundWindow::Create(EditorComponent* _editor)
openButton.SetTooltip("Open sound file.\nSupported extensions: WAV, OGG");
openButton.SetPos(XMFLOAT2(x, y));
openButton.SetSize(XMFLOAT2(wid, hei));
openButton.OnClick([&](wi::gui::EventArgs args) {
openButton.OnClick([this](wi::gui::EventArgs args) {
SoundComponent* sound = editor->GetCurrentScene().sounds.GetComponent(entity);
if (sound != nullptr)
{
@@ -187,7 +187,7 @@ void SoundWindow::Create(EditorComponent* _editor)
reverbComboBox.Create("Reverb: ");
reverbComboBox.SetPos(XMFLOAT2(x, y += step));
reverbComboBox.SetSize(XMFLOAT2(wid, hei));
reverbComboBox.OnSelect([&](wi::gui::EventArgs args) {
reverbComboBox.OnSelect([](wi::gui::EventArgs args) {
wi::audio::SetReverb((wi::audio::REVERB_PRESET)args.iValue);
});
reverbComboBox.AddItem("DEFAULT");