diff options
-rw-r--r-- | Alc/ALu.c | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alSource.h | 1 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 7 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 2 |
4 files changed, 15 insertions, 3 deletions
@@ -1355,6 +1355,7 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, ALboolean forc ATOMIC_REPLACE_HEAD(struct ALvoiceProps*, &voice->FreeList, props); } + props = voice->Props; BufferListItem = ATOMIC_LOAD(&voice->current_buffer, almemory_order_relaxed); while(BufferListItem != NULL) @@ -1362,10 +1363,11 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, ALboolean forc const ALbuffer *buffer; if((buffer=BufferListItem->buffer) != NULL) { - if(buffer->FmtChannels == FmtMono) - CalcAttnSourceParams(voice, voice->Props, buffer, context); + if(props->SpatializeMode == SpatializeOn || + (props->SpatializeMode == SpatializeAuto && buffer->FmtChannels == FmtMono)) + CalcAttnSourceParams(voice, props, buffer, context); else - CalcNonAttnSourceParams(voice, voice->Props, buffer, context); + CalcNonAttnSourceParams(voice, props, buffer, context); break; } BufferListItem = ATOMIC_LOAD(&BufferListItem->next, almemory_order_acquire); diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index f9cbc55b..7d2ff59a 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -45,6 +45,7 @@ typedef struct ALsource { enum DistanceModel DistanceModel; enum Resampler Resampler; ALboolean DirectChannels; + enum SpatializeMode Spatialize; ALboolean DryGainHFAuto; ALboolean WetGainAuto; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 168a754f..cccc9719 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -40,6 +40,12 @@ struct ALvoice; struct ALeffectslot; +enum SpatializeMode { + SpatializeOff, + SpatializeOn, + SpatializeAuto +}; + enum Resampler { PointResampler, LinearResampler, @@ -189,6 +195,7 @@ struct ALvoiceProps { enum DistanceModel DistanceModel; enum Resampler Resampler; ALboolean DirectChannels; + enum SpatializeMode SpatializeMode; ALboolean DryGainHFAuto; ALboolean WetGainAuto; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index a1ba0ebc..9ef9a4eb 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2984,6 +2984,7 @@ static void InitSourceParams(ALsource *Source, ALsizei num_sends) Source->DistanceModel = DefaultDistanceModel; Source->Resampler = ResamplerDefault; Source->DirectChannels = AL_FALSE; + Source->Spatialize = SpatializeAuto; Source->StereoPan[0] = DEG2RAD( 30.0f); Source->StereoPan[1] = DEG2RAD(-30.0f); @@ -3093,6 +3094,7 @@ static void UpdateSourceProps(ALsource *source, ALvoice *voice, ALsizei num_send props->DistanceModel = source->DistanceModel; props->Resampler = source->Resampler; props->DirectChannels = source->DirectChannels; + props->SpatializeMode = source->Spatialize; props->DryGainHFAuto = source->DryGainHFAuto; props->WetGainAuto = source->WetGainAuto; |