diff options
author | Chris Robinson <[email protected]> | 2011-08-22 17:13:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-22 17:13:03 -0700 |
commit | 65d42083e1d88e3ef024325f08e6266a87dc03d7 (patch) | |
tree | 76358068ad3334a73057144ff592e4ac2356314f /Alc/ALu.c | |
parent | 6992a67dd9a496e1440517b1d49a03f3d5a46f45 (diff) |
Prevent source and effect slot updates from occuring while updates are deferred
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -979,10 +979,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ctx_end = ctx + device->NumContexts; while(ctx != ctx_end) { - ALboolean UpdateSources; + ALboolean DeferUpdates = (*ctx)->DeferUpdates; + ALboolean UpdateSources = AL_FALSE; - UpdateSources = (*ctx)->UpdateSources; - (*ctx)->UpdateSources = AL_FALSE; + if(!DeferUpdates) + { + UpdateSources = (*ctx)->UpdateSources; + (*ctx)->UpdateSources = AL_FALSE; + } src = (*ctx)->ActiveSources; src_end = src + (*ctx)->ActiveSourceCount; @@ -995,7 +999,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) continue; } - if((*src)->NeedsUpdate || UpdateSources) + if(!DeferUpdates && ((*src)->NeedsUpdate || UpdateSources)) { (*src)->NeedsUpdate = AL_FALSE; ALsource_Update(*src, *ctx); @@ -1021,7 +1025,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALEffectSlot->PendingClicks[i] = 0.0f; } - if(ALEffectSlot->NeedsUpdate) + if(!DeferUpdates && ALEffectSlot->NeedsUpdate) { ALEffectSlot->NeedsUpdate = AL_FALSE; ALEffect_Update(ALEffectSlot->EffectState, *ctx, ALEffectSlot); |