Skip to content

Commit

Permalink
🔧 Only iterate over hardware source in use
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiradur committed Oct 1, 2024
1 parent 05dd2f5 commit 8025c52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/main/audio/SoundManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,14 @@ void SoundManager::recomputeAllSources()

if(App::audio_enable_efx->getBool())
{
for(hardware_sources_num = 0; hardware_sources_num < MAX_HARDWARE_SOURCES; hardware_sources_num++)
for(int source_index = 0; source_index < hardware_sources_in_use_count; source_index++)
{
// update air absorption factor
alSourcef(hardware_sources[hardware_sources_num], AL_AIR_ABSORPTION_FACTOR, App::audio_air_absorption_factor->getFloat());
alSourcef(hardware_sources[source_index], AL_AIR_ABSORPTION_FACTOR, App::audio_air_absorption_factor->getFloat());

if(App::audio_enable_obstruction->getBool())
{
updateObstructionFilter(hardware_sources[hardware_sources_num]);
updateObstructionFilter(hardware_sources[source_index]);
}
}
}
Expand Down

0 comments on commit 8025c52

Please sign in to comment.