[Fix] Fixed bug with sound volumes.
This commit is contained in:
parent
5c7cc1c452
commit
76e6ddd90b
@ -311,6 +311,7 @@ int sound_playPos(int sound, double x, double y) {
|
|||||||
*/
|
*/
|
||||||
int sound_updatePos(int voice, double x, double y) {
|
int sound_updatePos(int voice, double x, double y) {
|
||||||
alVoice* v;
|
alVoice* v;
|
||||||
|
int idist;
|
||||||
double angle, dist;
|
double angle, dist;
|
||||||
double px, py;
|
double px, py;
|
||||||
|
|
||||||
@ -329,7 +330,10 @@ int sound_updatePos(int voice, double x, double y) {
|
|||||||
angle = sound_pos[2] - ANGLE(px, py)/M_PI*180.;
|
angle = sound_pos[2] - ANGLE(px, py)/M_PI*180.;
|
||||||
dist = MOD(px, py);
|
dist = MOD(px, py);
|
||||||
|
|
||||||
if(Mix_SetPosition(v->channel, (int)angle, (int)dist/10) < 0) {
|
idist = (int)dist / 13.;
|
||||||
|
if(idist > 255) idist = 255;
|
||||||
|
|
||||||
|
if(Mix_SetPosition(v->channel, (Sint16)angle, (Uint8)idist) < 0) {
|
||||||
WARN("Unable to set sound position: %s", Mix_GetError());
|
WARN("Unable to set sound position: %s", Mix_GetError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user