feat(sound): apply channel group volume in SESoundInternal::GetVolume

This commit is contained in:
fallenoak 2025-11-29 12:42:35 -06:00
parent a063aaa0c7
commit 9af59d47a6
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -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;
}