diff options
author | Chris Robinson <[email protected]> | 2009-04-11 18:16:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-04-11 18:16:05 -0700 |
commit | 30f57d0824826c38d8991f041ea8870e19b44033 (patch) | |
tree | 56a9ccc9e009a56853aeba1654aca5b92bdc94df | |
parent | 1c540181116a875f708890bc9c380b71cd1fd6ba (diff) |
Make auxiliary effect slot count configurable
-rw-r--r-- | Alc/ALc.c | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 3 | ||||
-rw-r--r-- | alsoftrc.sample | 5 |
4 files changed, 10 insertions, 2 deletions
@@ -479,6 +479,8 @@ static ALvoid InitContext(ALCcontext *pContext) pContext->lNumStereoSources = 1; pContext->lNumMonoSources = pContext->Device->MaxNoOfSources - pContext->lNumStereoSources; + pContext->AuxiliaryEffectSlotMax = GetConfigValueInt(NULL, "slots", 4); + pContext->ExtensionList = "AL_EXTX_buffer_sub_data AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET AL_EXTX_source_distance_model AL_LOKI_quadriphonic"; level = GetConfigValueInt(NULL, "cf_level", 0); diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 68b176e4..66102b8b 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -194,6 +194,8 @@ struct ALCcontext_struct struct ALeffectslot *AuxiliaryEffectSlot; ALuint AuxiliaryEffectSlotCount; + // Maximum number of slots that can be created + ALuint AuxiliaryEffectSlotMax; ALenum LastError; ALboolean InUse; diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 65db34b3..85a7c6ee 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -50,8 +50,7 @@ ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) if (n > 0) { - /* NOTE: We only support one slot currently */ - if(n == 1 && Context->AuxiliaryEffectSlotCount == 0) + if(Context->AuxiliaryEffectSlotCount+n <= Context->AuxiliaryEffectSlotMax) { // Check that enough memory has been allocted in the 'effectslots' array for n Effect Slots if (!IsBadWritePtr((void*)effectslots, n * sizeof(ALuint))) diff --git a/alsoftrc.sample b/alsoftrc.sample index 438eba4a..8408ab78 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -67,6 +67,11 @@ excludefx = # Sets which effects to exclude, preventing apps from using them. # reverb # Default is empty (all available effects enabled) +slots = 4 # Sets the maximum number of Auxiliary Effect Slots an app can + # create. A slot can use a non-negligible amount of CPU time if an + # effect is set on it even if no sources are feeding it, so this may + # help when apps use more than the system can handle. Default is 4 + layout_STEREO = # Sets the speaker layout when using stereo output. Values are # specified in degrees, where 0 is straight in front, negative # goes left, and positive goes right. The values must define a |