mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 07:41:47 +00:00
Fix volume of looped sounds in OpenAL backend, fixes #111
AL_PlayChannel() is only called by AL_AddLoopSounds() and S_IssuePlaysound() - but only the latter set a volume there. Because of that, loopsounds weren't hearable anymore after the last commit which removed adding s_volume to all volumes in AL_PlayChannel(). This is fixed by setting the volume for looped sounds in AL_AddLoopSounds() as well. Looped sounds don't seem to have a customizable volume and are always played at full volume (the volume is only changed by distance, but OpenAL does that automatically).
This commit is contained in:
parent
4e13e3ee69
commit
4cbe5f25e0
1 changed files with 5 additions and 0 deletions
|
@ -445,6 +445,11 @@ AL_AddLoopSounds(void)
|
||||||
ch->dist_mult = SOUND_LOOPATTENUATE;
|
ch->dist_mult = SOUND_LOOPATTENUATE;
|
||||||
ch->end = paintedtime + sc->length;
|
ch->end = paintedtime + sc->length;
|
||||||
|
|
||||||
|
/* it seems like looped sounds are always played at full volume
|
||||||
|
* see SDL_AddLoopSounds() which calls SDL_SpatializeOrigin() with volume 255.0f
|
||||||
|
* so set it to full volume (1.0 * s_volume). */
|
||||||
|
ch->oal_vol = s_volume->value;
|
||||||
|
|
||||||
AL_PlayChannel(ch);
|
AL_PlayChannel(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue