Browse Source

fixed maxDistance handling, fixed soundGroup/channelGroup order

ncannasse 8 years ago
parent
commit
843d2f44de
2 changed files with 2 additions and 5 deletions
  1. 1 1
      hxd/snd/Driver.hx
  2. 1 4
      hxd/snd/effect/Spatialization.hx

+ 1 - 1
hxd/snd/Driver.hx

@@ -177,7 +177,7 @@ class Driver {
 		ALC.closeDevice(alDevice);
 	}
 
-	public function play(sound : hxd.res.Sound, ?soundGroup : SoundGroup, ?channelGroup : ChannelGroup) {
+	public function play(sound : hxd.res.Sound, ?channelGroup : ChannelGroup, ?soundGroup : SoundGroup) {
 		if (soundGroup   == null) soundGroup   = masterSoundGroup;
 		if (channelGroup == null) channelGroup = masterChannelGroup;
 		var c = new Channel();

+ 1 - 4
hxd/snd/effect/Spatialization.hx

@@ -48,10 +48,7 @@ class Spatialization extends Effect {
 		AL.sourcef(s.inst, AL.ROLLOFF_FACTOR, rollOffFactor);
 		AL.sourcef(s.inst, AL.MIN_GAIN, 0);
 
-		if (maxDistance != null) {
-			var md : Float = maxDistance;
-			AL.sourcef(s.inst, AL.MAX_DISTANCE, md);
-		}
+		AL.sourcef(s.inst, AL.MAX_DISTANCE, maxDistance == null ? 3.40282347e38 /* FLT_MAX */ : (maxDistance:Float) );
 	}
 	#end