mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
audio-related minor refactor
This commit is contained in:
parent
c8ca56fb8e
commit
1549a02731
5 changed files with 20 additions and 28 deletions
|
|
@ -383,13 +383,12 @@ void audio::update(double delta) {
|
|||
entry.second->update(delta);
|
||||
}
|
||||
|
||||
float masterVolume = channels.at(0)->getVolume();
|
||||
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||
auto speaker = it->second.get();
|
||||
int speakerChannel = speaker->getChannel();
|
||||
auto channel = get_channel(speakerChannel);
|
||||
if (channel != nullptr) {
|
||||
speaker->update(channel, speakerChannel == 0 ? 1.0f : masterVolume);
|
||||
speaker->update(channel);
|
||||
}
|
||||
if (speaker->isStopped()) {
|
||||
streams.erase(it->first);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue