From ebb56ee4815325675ee878782e2ffa2f40da03d0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 15 Jun 2008 17:39:34 +0000 Subject: time command, alRewindSource for ui sounds --- src/audio/audio.cc | 1 + src/audio/sources.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/audio') diff --git a/src/audio/audio.cc b/src/audio/audio.cc index 308667b..842395f 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -72,6 +72,7 @@ void shutdown() void play(const char *name) { if (Sources::available(0)) { + alSourceRewind(Sources::ui()); Buffers::bind(Sources::ui(), std::string(name)); alSourcePlay(Sources::ui()); } diff --git a/src/audio/sources.h b/src/audio/sources.h index f3d6470..08a2a41 100644 --- a/src/audio/sources.h +++ b/src/audio/sources.h @@ -25,6 +25,8 @@ public: static bool available(size_t index) { return source_available[index]; } + static ALuint source(size_t index) { return sources[index]; } + /// the sources for user interface sounds static inline ALuint ui() { return sources[0]; } -- cgit v1.2.3