diff options
author | Chris Robinson <[email protected]> | 2009-10-20 11:54:04 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-10-20 11:54:04 -0700 |
commit | 93361118b7b8c1417e4a717d94818764fb5ffe9e (patch) | |
tree | ea3849494057e51400fe88d113114bfb5c9767c9 /Alc/ALu.c | |
parent | 50f963f6c67f9c4f2ec6caaad8edc1679e70b8b9 (diff) |
Store a device's contexts in a dynamic array
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1203,7 +1203,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALeffectslot *ALEffectSlot; ALCcontext *ALContext; int fpuState; - ALuint i; + ALuint i, c; SuspendContext(NULL); @@ -1226,9 +1226,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) /* Clear mixing buffer */ memset(DryBuffer, 0, SamplesToDo*OUTPUTCHANNELS*sizeof(ALfloat)); - ALContext = device->Context; - if(ALContext) + for(c = 0;c < device->NumContexts;c++) { + ALContext = device->Contexts[c]; MixSomeSources(ALContext, DryBuffer, SamplesToDo); /* effect slot processing */ @@ -1378,13 +1378,15 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) ALvoid aluHandleDisconnect(ALCdevice *device) { - if(device->Context) + ALuint i; + + for(i = 0;i < device->NumContexts;i++) { ALsource *source; - SuspendContext(device->Context); + SuspendContext(device->Contexts[i]); - source = device->Context->Source; + source = device->Contexts[i]->Source; while(source) { if(source->state == AL_PLAYING) @@ -1405,7 +1407,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device) } source = source->next; } - ProcessContext(device->Context); + ProcessContext(device->Contexts[i]); } device->Connected = ALC_FALSE; |