diff options
Diffstat (limited to 'al')
-rw-r--r-- | al/effect.h | 5 | ||||
-rw-r--r-- | al/listener.cpp | 8 | ||||
-rw-r--r-- | al/listener.h | 35 | ||||
-rw-r--r-- | al/state.cpp | 8 |
4 files changed, 9 insertions, 47 deletions
diff --git a/al/effect.h b/al/effect.h index c30a749a..d543828a 100644 --- a/al/effect.h +++ b/al/effect.h @@ -4,8 +4,8 @@ #include "AL/al.h" #include "AL/efx.h" -#include "effects/base.h" #include "al/effects/effects.h" +#include "alc/effects/base.h" enum { @@ -53,9 +53,6 @@ struct ALeffect { DISABLE_ALLOC() }; -inline bool IsReverbEffect(const ALenum type) noexcept -{ return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; } - EffectStateFactory *getFactoryByType(ALenum type); void InitEffect(ALeffect *effect); diff --git a/al/listener.cpp b/al/listener.cpp index 1f045d08..cef96fb0 100644 --- a/al/listener.cpp +++ b/al/listener.cpp @@ -419,12 +419,12 @@ END_API_FUNC void UpdateListenerProps(ALCcontext *context) { /* Get an unused proprty container, or allocate a new one as needed. */ - ALlistenerProps *props{context->mFreeListenerProps.load(std::memory_order_acquire)}; + ListenerProps *props{context->mFreeListenerProps.load(std::memory_order_acquire)}; if(!props) - props = new ALlistenerProps{}; + props = new ListenerProps{}; else { - ALlistenerProps *next; + ListenerProps *next; do { next = props->next.load(std::memory_order_relaxed); } while(context->mFreeListenerProps.compare_exchange_weak(props, next, @@ -441,7 +441,7 @@ void UpdateListenerProps(ALCcontext *context) props->MetersPerUnit = listener.mMetersPerUnit; /* Set the new container for updating internal parameters. */ - props = listener.Params.Update.exchange(props, std::memory_order_acq_rel); + props = context->mParams.ListenerUpdate.exchange(props, std::memory_order_acq_rel); if(props) { /* If there was an unused update container, put it back in the diff --git a/al/listener.h b/al/listener.h index e30f45c3..5f3ce3ec 100644 --- a/al/listener.h +++ b/al/listener.h @@ -9,23 +9,7 @@ #include "AL/efx.h" #include "almalloc.h" -#include "vecmat.h" -enum class DistanceModel; - - -struct ALlistenerProps { - std::array<float,3> Position; - std::array<float,3> Velocity; - std::array<float,3> OrientAt; - std::array<float,3> OrientUp; - float Gain; - float MetersPerUnit; - - std::atomic<ALlistenerProps*> next; - - DEF_NEWDEL(ALlistenerProps) -}; struct ALlistener { std::array<float,3> Position{{0.0f, 0.0f, 0.0f}}; @@ -37,25 +21,6 @@ struct ALlistener { std::atomic_flag PropsClean; - struct { - /* Pointer to the most recent property values that are awaiting an - * update. - */ - std::atomic<ALlistenerProps*> Update{nullptr}; - - alu::Matrix Matrix; - alu::Vector Velocity; - - float Gain; - float MetersPerUnit; - - float DopplerFactor; - float SpeedOfSound; /* in units per sec! */ - - bool SourceDistanceModel; - DistanceModel mDistanceModel; - } Params; - ALlistener() { PropsClean.test_and_set(std::memory_order_relaxed); } DISABLE_ALLOC() diff --git a/al/state.cpp b/al/state.cpp index ee05d3b9..f70d3689 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -834,12 +834,12 @@ END_API_FUNC void UpdateContextProps(ALCcontext *context) { /* Get an unused proprty container, or allocate a new one as needed. */ - ALcontextProps *props{context->mFreeContextProps.load(std::memory_order_acquire)}; + ContextProps *props{context->mFreeContextProps.load(std::memory_order_acquire)}; if(!props) - props = new ALcontextProps{}; + props = new ContextProps{}; else { - ALcontextProps *next; + ContextProps *next; do { next = props->next.load(std::memory_order_relaxed); } while(context->mFreeContextProps.compare_exchange_weak(props, next, @@ -855,7 +855,7 @@ void UpdateContextProps(ALCcontext *context) props->mDistanceModel = context->mDistanceModel; /* Set the new container for updating internal parameters. */ - props = context->mUpdate.exchange(props, std::memory_order_acq_rel); + props = context->mParams.ContextUpdate.exchange(props, std::memory_order_acq_rel); if(props) { /* If there was an unused update container, put it back in the |