summaryrefslogtreecommitdiff
path: root/src/sound_openal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound_openal.cpp')
-rw-r--r--src/sound_openal.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp
index edcb9e8d4..26ad6fa4c 100644
--- a/src/sound_openal.cpp
+++ b/src/sound_openal.cpp
@@ -482,6 +482,24 @@ public:
maintain();
deleteSound(sound);
}
+ bool soundExists(int sound)
+ {
+ maintain();
+ return (m_sounds_playing.count(sound) != 0);
+ }
+ void updateSoundPosition(int id, v3f pos)
+ {
+ std::map<int, PlayingSound*>::iterator i =
+ m_sounds_playing.find(id);
+ if(i == m_sounds_playing.end())
+ return;
+ PlayingSound *sound = i->second;
+
+ alSourcei(sound->source_id, AL_SOURCE_RELATIVE, false);
+ alSource3f(sound->source_id, AL_POSITION, pos.X, pos.Y, pos.Z);
+ alSource3f(sound->source_id, AL_VELOCITY, 0, 0, 0);
+ alSourcef(sound->source_id, AL_REFERENCE_DISTANCE, 30.0);
+ }
};
ISoundManager *createOpenALSoundManager(OnDemandSoundFetcher *fetcher)