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-18 22:07:46 +0000
committerStijn Buys <ingar@osirion.org>2008-07-18 22:07:46 +0000
commitc3d90b226bdd83592d08704aa918f155f4c757e2 (patch)
treedd9ef9b9ebec66c707744de05ad39fd8918452fa /src/audio
parent2698d8cd1d28cd9649fcfe35a3397d52b28f1b34 (diff)
reset spacedust on ship change, audio distance model changes (should fix win32 ui sound dissapearing in the distance)
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/audio.cc5
-rw-r--r--src/audio/sources.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc
index 20f6b1d..8b65879 100644
--- a/src/audio/audio.cc
+++ b/src/audio/audio.cc
@@ -84,6 +84,9 @@ void play(const char *name)
Buffers::bind(source, buffer);
alSourcef(source, AL_PITCH, 1.0);
alSourcef(source, AL_GAIN, 1.0);
+ alSourcei(source, AL_SOURCE_RELATIVE, AL_TRUE);
+ ALfloat location[] = {0.0f, 0.0f, 0.0f};
+ alSourcefv(source, AL_POSITION, location);
alSourceRewind(source);
alSourcePlay(source);
return;
@@ -108,6 +111,8 @@ void loop( size_t source_index, const char *name, float pitch, float gain)
ALuint source = Sources::source(source_index);
Buffers::bind(source, Buffers::load(std::string(name)));
+ alSourcef(source, AL_REFERENCE_DISTANCE, 4.0f);
+ alSourcei(source, AL_SOURCE_RELATIVE, AL_FALSE);
alSourcef(source, AL_PITCH, pitch);
alSourcef(source, AL_GAIN, gain);
diff --git a/src/audio/sources.cc b/src/audio/sources.cc
index 3a6b3fc..b52c5a4 100644
--- a/src/audio/sources.cc
+++ b/src/audio/sources.cc
@@ -59,7 +59,7 @@ size_t Sources::get()
if (source_available[i]) {
source_available[i] = false;
alSourcef(sources[i], AL_PITCH, 1.0);
- alSourcef(sources[i], AL_GAIN, 1.0);
+ alSourcef(sources[i], AL_GAIN, 0.0);
//con_debug << "reserved source " << i << std::endl;
return i;
}