aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-04-13 20:33:41 -0700
committerChris Robinson <[email protected]>2009-04-13 20:33:41 -0700
commitf245f0ef87cfefd053c656b7f93cc618d46c6532 (patch)
treea0501dd5b2666f5f991def77a6d111c992d1ae6f /Alc/ALc.c
parenta30f431b63efdcd6a17f2cad5dca205984243723 (diff)
Make the number of source sends variable
The highest value is clamped to MAX_SENDS
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 3c0b1e62..013370fa 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -481,6 +481,9 @@ static ALvoid InitContext(ALCcontext *pContext)
pContext->lNumMonoSources = pContext->Device->MaxNoOfSources - pContext->lNumStereoSources;
pContext->AuxiliaryEffectSlotMax = GetConfigValueInt(NULL, "slots", 4);
+ pContext->NumSends = GetConfigValueInt(NULL, "sends", MAX_SENDS);
+ if(pContext->NumSends > MAX_SENDS)
+ pContext->NumSends = MAX_SENDS;
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";
@@ -819,6 +822,8 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
case ALC_MAX_AUXILIARY_SENDS:
if(!size)
SetALCError(ALC_INVALID_VALUE);
+ else if(device && device->Context)
+ *data = device->Context->NumSends;
else
*data = MAX_SENDS;
break;
@@ -860,7 +865,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsize
data[i++] = device->Context->lNumStereoSources;
data[i++] = ALC_MAX_AUXILIARY_SENDS;
- data[i++] = MAX_SENDS;
+ data[i++] = device->Context->NumSends;
}
ProcessContext(NULL);
@@ -1025,6 +1030,7 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
{
ALCcontext *ALContext = NULL;
ALuint ulAttributeIndex, ulRequestedStereoSources;
+ ALuint RequestedSends;
if ((device)&&(!device->IsCaptureDevice))
{
@@ -1054,7 +1060,7 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
ProcessContext(NULL);
- // Check for Voice Count attributes
+ // Check for attributes
if (attrList)
{
ulAttributeIndex = 0;
@@ -1069,7 +1075,16 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
ALContext->lNumStereoSources = ulRequestedStereoSources;
ALContext->lNumMonoSources = ALContext->Device->MaxNoOfSources - ALContext->lNumStereoSources;
- break;
+ }
+
+ if(attrList[ulAttributeIndex] == ALC_MAX_AUXILIARY_SENDS)
+ {
+ RequestedSends = attrList[ulAttributeIndex + 1];
+
+ if(RequestedSends > ALContext->NumSends)
+ RequestedSends = ALContext->NumSends;
+
+ ALContext->NumSends = RequestedSends;
}
ulAttributeIndex += 2;