From 52cfc041425a80ffd7ec63b3aaa94289ec61a977 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 3 Oct 2019 12:47:40 -0400 Subject: controlled sound fading --- src/audio.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/audio.cpp b/src/audio.cpp index 2f14c97..7a5934f 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -57,10 +57,13 @@ void AudioSystem::configure([[maybe_unused]] entityx::EntityManager& entities, if (alutInitWithoutContext(nullptr, nullptr) != AL_TRUE) return; // TODO Third uh oh + // Set up listener ALfloat listenerOri[] = { 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f }; alListener3f(AL_POSITION, 0, 0, 0.0f); alListener3f(AL_VELOCITY, 0, 0, 0); alListenerfv(AL_ORIENTATION, listenerOri); + + alDistanceModel(AL_LINEAR_DISTANCE); } void AudioSystem::update(entityx::EntityManager& entities, @@ -85,6 +88,9 @@ void AudioSystem::receive(const entityx::ComponentAddedEvent