Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/audio
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-07-14 21:05:56 +0000
committerStijn Buys <ingar@osirion.org>2008-07-14 21:05:56 +0000
commit44b249a4afd19e62b56b52e7b9ec8790bd9c6a33 (patch)
treec36bb3f33c158151d14807585991f8f857899a82 /src/audio
parent61c081e77a8e445bb92bbda4fcbd8cfea707e6de (diff)
fixing glorious stupid audio bugs
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/audio.cc12
-rw-r--r--src/audio/sources.cc2
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;
}