Skip to content

Commit

Permalink
Optimize|SFX: Reverb updates are not needed when 3D SFX disabled
Browse files Browse the repository at this point in the history
It seems currently the sector reverb update calculations are extremely
slow. They should be moved to a continuously running background thread,
if the update algorithm cannot be optimized to run faster.

This commit improves performance when "sound-3d" is set to zero by
skipping the sector reverb calculations entirely.
  • Loading branch information
skyjake committed Aug 30, 2012
1 parent c0217e8 commit 724109d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions doomsday/engine/portable/src/s_environ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,16 +401,21 @@ void S_ResetReverb(void)

void S_UpdateReverb(void)
{
if(reverbUpdateRequested.empty()) return;

for(ReverbUpdateRequested::iterator i = reverbUpdateRequested.begin(); i != reverbUpdateRequested.end(); ++i)
if(sfx3D)
{
Sector_CalculateReverb(*i);
if(reverbUpdateRequested.empty()) return;

for(ReverbUpdateRequested::iterator i = reverbUpdateRequested.begin(); i != reverbUpdateRequested.end(); ++i)
{
Sector_CalculateReverb(*i);
}
}
reverbUpdateRequested.clear();
}

void S_CalcSectorReverb(Sector* sec)
{
if(!sfx3D) return;

reverbUpdateRequested.insert(sec);
}

0 comments on commit 724109d

Please sign in to comment.