mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-12 13:12:14 +00:00
Use a separate function to update an openal stream's volume
This commit is contained in:
parent
c73d97af44
commit
7908116fef
1 changed files with 7 additions and 2 deletions
|
@ -297,7 +297,12 @@ public:
|
||||||
|
|
||||||
virtual void SetVolume(float vol)
|
virtual void SetVolume(float vol)
|
||||||
{
|
{
|
||||||
if(vol >= 0.0f) Volume = vol;
|
Volume = vol;
|
||||||
|
UpdateVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateVolume()
|
||||||
|
{
|
||||||
alSourcef(Source, AL_GAIN, Renderer->MusicVolume*Volume);
|
alSourcef(Source, AL_GAIN, Renderer->MusicVolume*Volume);
|
||||||
getALError();
|
getALError();
|
||||||
}
|
}
|
||||||
|
@ -875,7 +880,7 @@ void OpenALSoundRenderer::SetMusicVolume(float volume)
|
||||||
{
|
{
|
||||||
MusicVolume = volume;
|
MusicVolume = volume;
|
||||||
for(uint32 i = 0;i < Streams.Size();++i)
|
for(uint32 i = 0;i < Streams.Size();++i)
|
||||||
Streams[i]->SetVolume(-1.f);
|
Streams[i]->UpdateVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int OpenALSoundRenderer::GetMSLength(SoundHandle sfx)
|
unsigned int OpenALSoundRenderer::GetMSLength(SoundHandle sfx)
|
||||||
|
|
Loading…
Reference in a new issue