diff options
author | Chris Robinson <[email protected]> | 2010-05-01 19:59:41 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-05-01 19:59:41 -0700 |
commit | 0378422fcb4badba0a0dcdce503dcbe9d253f9a8 (patch) | |
tree | b7bf68507f0b8fa7716c821db445c88df060af29 /OpenAL32/alState.c | |
parent | 0760415d08031eea36abf193537c8c8a120cb2e6 (diff) |
Use a map to store sources and buffers
And do a lookup using a binary search instead of linear
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 4393d189..953b1a17 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -63,11 +63,11 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability) if(updateSources) { - ALsource *source = Context->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < Context->SourceMap.size;pos++) { + ALsource *source = Context->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } @@ -96,11 +96,11 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability) if(updateSources) { - ALsource *source = Context->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < Context->SourceMap.size;pos++) { + ALsource *source = Context->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } @@ -552,11 +552,11 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value) // relative sources are affected if(updateSources) { - ALsource *source = Context->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < Context->SourceMap.size;pos++) { + ALsource *source = Context->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } @@ -581,11 +581,11 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) if(updateSources) { - ALsource *source = Context->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < Context->SourceMap.size;pos++) { + ALsource *source = Context->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } @@ -610,11 +610,11 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound) if(updateSources) { - ALsource *source = pContext->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < pContext->SourceMap.size;pos++) { + ALsource *source = pContext->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } @@ -649,11 +649,11 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value) if(updateSources) { - ALsource *source = Context->SourceList; - while(source) + ALsizei pos; + for(pos = 0;pos < Context->SourceMap.size;pos++) { + ALsource *source = Context->SourceMap.array[pos].value; source->NeedsUpdate = AL_TRUE; - source = source->next; } } |