Browse Source

This fixes exclusively the panning bug, where after a certain distance is exceeded, sound samples get played without panning.

pull/1667/head
thebigMuh 5 years ago committed by Anders Jenbo
parent
commit
281533e82d
  1. 2
      Source/utils/soundsample.cpp

2
Source/utils/soundsample.cpp

@ -54,7 +54,7 @@ void SoundSample::Play(int lVolume, int lPan, int channel)
Mix_Volume(channel, pow((double)10, (double)lVolume / 2000.0) * MIX_MAX_VOLUME); Mix_Volume(channel, pow((double)10, (double)lVolume / 2000.0) * MIX_MAX_VOLUME);
int pan = copysign(pow((double)10, -abs(lPan) / 2000.0) * 255, (double)lPan); int pan = copysign(pow((double)10, -abs(lPan) / 2000.0) * 255, (double)lPan);
Mix_SetPanning(channel, pan > 0 ? pan : 255, pan < 0 ? abs(pan) : 255); Mix_SetPanning(channel, lPan > 0 ? pan : 255, lPan < 0 ? abs(pan) : 255);
}; };
/** /**

Loading…
Cancel
Save