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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user