mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(sound): apply channel group volume in SESoundInternal::GetVolume
This commit is contained in:
parent
a063aaa0c7
commit
9af59d47a6
@ -20,11 +20,26 @@ float SESoundInternal::GetVolume() {
|
||||
|
||||
float volume = this->m_volume;
|
||||
|
||||
// Apply fade volume
|
||||
|
||||
if (this->m_fadeIn || this->m_fadeOut) {
|
||||
volume *= this->m_fadeVolume;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// Apply channel group volume
|
||||
|
||||
if (SESound::s_ChannelGroups.Count()) {
|
||||
auto channelGroupIndex = this->m_channelGroup;
|
||||
|
||||
while (channelGroupIndex != -1) {
|
||||
auto channelGroup = &SESound::s_ChannelGroups[this->m_channelGroup];
|
||||
auto channelGroupVolume = channelGroup->m_volume * channelGroup->m_muteVolume;
|
||||
|
||||
volume *= channelGroupVolume;
|
||||
|
||||
channelGroupIndex = channelGroup->m_parentChannelGroup;
|
||||
}
|
||||
}
|
||||
|
||||
return volume;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user