From 2f92559fc7b7c6d64b2f5d7cd0435da20689e67a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Mar 2012 09:05:38 -0700 Subject: [PATCH] Use OpenAL's linear attenuation model We should use the inverse distance clamped model (the default), but we first need to handle muting sounds that are beyond their max distance. Linear attenuation doesn't give a proper rolloff, but it makes the sounds silent at max distance. --- apps/openmw/mwsound/openal_output.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index e37924088..5ce793168 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -303,6 +303,8 @@ bool OpenAL_Output::Initialize(const std::string &devname) Device = 0; return false; } + alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED); + throwALerror(); return true; }