aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorSignpostMarv2012-10-05 14:01:29 +0100
committerJustin Clark-Casey (justincc)2012-10-29 23:38:57 +0000
commit375fb6658909f619f3210590743c228834d0d2c0 (patch)
treea4d1ab6427536a075989ccaf452dfab42c9fec45 /OpenSim/Region/CoreModules
parentConverting the ISoundModule implementation from an IRegionModule to an INonSh... (diff)
downloadopensim-SC_OLD-375fb6658909f619f3210590743c228834d0d2c0.zip
opensim-SC_OLD-375fb6658909f619f3210590743c228834d0d2c0.tar.gz
opensim-SC_OLD-375fb6658909f619f3210590743c228834d0d2c0.tar.bz2
opensim-SC_OLD-375fb6658909f619f3210590743c228834d0d2c0.tar.xz
making the max distance for sounds to be heard from their origin a configurable option exposed via a public field on ISoundModule (with private setter in the implementation)
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
index 9fd0a36..ff052ba 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModuleNonShared.cs
@@ -48,13 +48,19 @@ namespace OpenSim.Region.CoreModules.World.Sound
48 48
49 public bool Enabled { get; private set; } 49 public bool Enabled { get; private set; }
50 50
51 public float MaxDistance { get; private set; }
52
51 #region INonSharedRegionModule 53 #region INonSharedRegionModule
52 54
53 public void Initialise(IConfigSource configSource) 55 public void Initialise(IConfigSource configSource)
54 { 56 {
55 IConfig config = configSource.Configs["Sounds"]; 57 IConfig config = configSource.Configs["Sounds"];
56 58
57 Enabled = (config != null && config.GetString("Module", "SoundModuleNonShared") == "SoundModuleNonShared"); 59 if (config == null)
60 return;
61
62 Enabled = config.GetString("Module", "SoundModuleNonShared") == "SoundModuleNonShared";
63 MaxDistance = config.GetFloat("MaxDistance", 100.0f);
58 } 64 }
59 65
60 public void AddRegion(Scene scene) { } 66 public void AddRegion(Scene scene) { }
@@ -109,7 +115,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
109 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 115 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
110 { 116 {
111 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 117 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
112 if (dis > 100.0) // Max audio distance 118 if (dis > MaxDistance) // Max audio distance
113 return; 119 return;
114 120
115 if (grp.IsAttachment) 121 if (grp.IsAttachment)
@@ -158,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
158 { 164 {
159 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position); 165 double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
160 166
161 if (dis > 100.0) // Max audio distance 167 if (dis > MaxDistance) // Max audio distance
162 return; 168 return;
163 169
164 float thisSpGain; 170 float thisSpGain;