diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-14 21:05:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-14 21:05:56 +0000 |
commit | 44b249a4afd19e62b56b52e7b9ec8790bd9c6a33 (patch) | |
tree | c36bb3f33c158151d14807585991f8f857899a82 /src/audio | |
parent | 61c081e77a8e445bb92bbda4fcbd8cfea707e6de (diff) |
fixing glorious stupid audio bugs
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/audio.cc | 12 | ||||
-rw-r--r-- | src/audio/sources.cc | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc index 8880780..1895d21 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -76,19 +76,17 @@ void play(const char *name) size_t buffer = Buffers::load(std::string(name)); - ALint state; for (size_t i = 0; i < MAXUISOURCES; i++) { + ALint srcstate = 0; ALuint source = Sources::source(i); - alGetSourcei(source , AL_SOURCE_STATE , &state); - if (state != AL_PLAYING) { - //alSourceRewind(Sources::source(i)); + alGetSourcei(source , AL_SOURCE_STATE , &srcstate); + if (srcstate != AL_PLAYING) { Buffers::bind(source, buffer); alSourcef(source, AL_PITCH, 1.0); alSourcef(source, AL_GAIN, 1.0); + alSourceRewind(source); alSourcePlay(source); - - } else { - con_debug << "source " << Sources::source(i) << " playing!" << std::endl; + return; } } } diff --git a/src/audio/sources.cc b/src/audio/sources.cc index dd736e7..2c67304 100644 --- a/src/audio/sources.cc +++ b/src/audio/sources.cc @@ -26,7 +26,7 @@ void Sources::init() } // all sources are available for use - for (size_t i=MAXUISOURCES; i < MAXSOURCES; i++) { + for (size_t i = MAXUISOURCES; i < MAXSOURCES; i++) { source_available[i] = true; } |