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>2010-02-25 19:28:14 +0000
committerStijn Buys <ingar@osirion.org>2010-02-25 19:28:14 +0000
commit90fbc4c5caf5afd54920894319448b74967399ba (patch)
treed4a8fe5ccdcbe94f4a3e5e1115f5baed26e8c2e3 /src/audio
parent83757353860fa447c36d4078602efea36d7da94e (diff)
added initial support for model sound tags,
moved sound code from client/targets.cc to client/soundext.cc, added master volume cvar snd_volume
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/audio.cc3
-rw-r--r--src/audio/audio.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc
index e1eb0d3..2c8a7c1 100644
--- a/src/audio/audio.cc
+++ b/src/audio/audio.cc
@@ -182,7 +182,7 @@ size_t loop(size_t source_index, const char *name, float pitch, float gain)
return buffer_index;
}
-void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity)
+void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity, float gain)
{
if (!audio_context)
return;
@@ -195,6 +195,7 @@ void update_listener(math::Vector3f const &location, math::Axis const &axis, mat
orientation[i+3] = axis.up()[i];
}
alListenerfv(AL_ORIENTATION, orientation);
+ alListenerf(AL_GAIN, gain);
//alListenerfv(AL_VELOCITY, velocity.ptr());
}
diff --git a/src/audio/audio.h b/src/audio/audio.h
index 72a8fa4..ecfdf3e 100644
--- a/src/audio/audio.h
+++ b/src/audio/audio.h
@@ -57,7 +57,7 @@ size_t loop(size_t source_index, size_t buffer_index, float pitch, float gain);
void update_source(size_t source_index, math::Vector3f const & location, math::Vector3f const & velocity, float pitch = 1.0f, float gain = 1.0f);
/// update listener parameters
-void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity);
+void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity, float gain = 1.0f);
}
#endif // __INCLUDED_AUDIO_AUDIO_H__