Sound output gain now controls listener gain instead of source gain. Fixes gain control when using OpenAL Soft.

This commit is contained in:
SarahW 2017-12-16 17:56:50 +00:00
commit d28cdb49e7

View file

@ -183,7 +183,7 @@ void givealbuffer(int32_t *buf)
ALuint buffer;
double gain = pow(10.0, (double)sound_gain / 20.0);
alSourcef(source[0], AL_GAIN, gain);
alListenerf(AL_GAIN, gain);
alSourceUnqueueBuffers(source[0], 1, &buffer);
// printf("U ");
@ -250,7 +250,7 @@ void givealbuffer_cd(int16_t *buf)
ALuint buffer;
double gain = pow(10.0, (double)sound_gain / 20.0);
alSourcef(source[1], AL_GAIN, gain);
alListenerf(AL_GAIN, gain);
alSourceUnqueueBuffers(source[1], 1, &buffer);
// printf("U ");