summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-07-09 22:32:24 +0200
committerGitHub <noreply@github.com>2022-07-09 22:32:24 +0200
commite51f474613c5d4bd53a8d213785bcb51f5cf447f (patch)
tree1278a6dbf5e9507ed97a4ed66afcbcb71da3639d /src/gui
parent051181fa6ee00d8379e8a7dc7442b58342d4352b (diff)
downloadminetest-e51f474613c5d4bd53a8d213785bcb51f5cf447f.tar.gz
minetest-e51f474613c5d4bd53a8d213785bcb51f5cf447f.tar.bz2
minetest-e51f474613c5d4bd53a8d213785bcb51f5cf447f.zip
Sounds: Various little improvements (#12486)
Use SimpleSoundSpec where reasonable (OpenAL) Ensure the sound IDs do not underflow or get overwritten -> loop in u16 Proper use of an enum.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiFormSpecMenu.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index e4ea9ff58..342f74b16 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -4498,7 +4498,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
if ((s.ftype == f_TabHeader) &&
(s.fid == event.GUIEvent.Caller->getID())) {
if (!s.sound.empty() && m_sound_manager)
- m_sound_manager->playSound(s.sound, false, 1.0f);
+ m_sound_manager->playSound(SimpleSoundSpec(s.sound, false, 1.0f));
s.send = true;
acceptInput();
s.send = false;
@@ -4543,7 +4543,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
if (s.ftype == f_Button || s.ftype == f_CheckBox) {
if (!s.sound.empty() && m_sound_manager)
- m_sound_manager->playSound(s.sound, false, 1.0f);
+ m_sound_manager->playSound(SimpleSoundSpec(s.sound, false, 1.0f));
s.send = true;
if (s.is_exit) {
@@ -4568,7 +4568,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
}
}
if (!s.sound.empty() && m_sound_manager)
- m_sound_manager->playSound(s.sound, false, 1.0f);
+ m_sound_manager->playSound(SimpleSoundSpec(s.sound, false, 1.0f));
s.send = true;
acceptInput(quit_mode_no);
@@ -4586,7 +4586,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
s.fdefault = L"";
} else if (s.ftype == f_Unknown || s.ftype == f_HyperText) {
if (!s.sound.empty() && m_sound_manager)
- m_sound_manager->playSound(s.sound, false, 1.0f);
+ m_sound_manager->playSound(SimpleSoundSpec(s.sound, false, 1.0f));
s.send = true;
acceptInput();
s.send = false;