From b639bc99132015217ff173680e1a43f44fad2ce3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 4 May 2017 12:17:50 -0700 Subject: Add a property to force source spatialization on or off --- OpenAL32/Include/alSource.h | 1 + OpenAL32/Include/alu.h | 7 +++++++ OpenAL32/alSource.c | 2 ++ 3 files changed, 10 insertions(+) (limited to 'OpenAL32') 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; -- cgit v1.2.3