diff options
author | Stijn Buys <ingar@osirion.org> | 2008-06-18 21:42:38 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-06-18 21:42:38 +0000 |
commit | fd6f22924fd0d85ee20fb1d5e4588ac441675ea9 (patch) | |
tree | 8a3db75e46390c3801a820589ffe628323bb46ab /src | |
parent | c5dddd62db3e070b89cb774abfd90cc3387a6d52 (diff) |
ui sounds
Diffstat (limited to 'src')
-rw-r--r-- | src/audio/audio.cc | 2 | ||||
-rw-r--r-- | src/client/console.cc | 3 | ||||
-rw-r--r-- | src/client/input.cc | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc index 842395f..729f3d2 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -71,6 +71,8 @@ void shutdown() void play(const char *name) { + Buffers::load(std::string(name)); + if (Sources::available(0)) { alSourceRewind(Sources::ui()); Buffers::bind(Sources::ui(), std::string(name)); diff --git a/src/client/console.cc b/src/client/console.cc index c5feb86..6d286a9 100644 --- a/src/client/console.cc +++ b/src/client/console.cc @@ -9,6 +9,7 @@ #include <cmath> #include "auxiliary/functions.h" +#include "audio/audio.h" #include "client/chat.h" #include "client/console.h" #include "client/video.h" @@ -93,6 +94,8 @@ void Console::toggle() } setkeyboardmode(console()->visible() || (core::application()->connected() && chat::visible())); + + audio::play("ui/console"); } void Console::keypressed(unsigned int key) diff --git a/src/client/input.cc b/src/client/input.cc index cb54e32..d3feefe 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -4,6 +4,7 @@ the terms and conditions of the GNU General Public License version 2 */ +#include "audio/audio.h" #include "core/core.h" #include "client/client.h" #include "client/input.h" @@ -78,6 +79,7 @@ void func_ui_control(std::string const &args) render::Camera::set_direction(0.0f); render::Camera::set_pitch(0.0f); } + audio::play("ui/control"); } void func_ui_console(std::string const &args) @@ -99,6 +101,7 @@ void func_ui_view(std::string const &args) local_roll = 0; local_pitch = 0; local_direction = 0; + audio::play("ui/view"); } } |