audio-related minor refactor
This commit is contained in:
+1
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user