diff options
author | Chris Robinson <[email protected]> | 2019-08-05 12:15:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-05 12:15:14 -0700 |
commit | d24401c3f3fbed3f0aa7fd5e4777e0d83797fa10 (patch) | |
tree | 292d6a7d4e928c70ee6785ece26d04bcb2d1b44b /alc | |
parent | 3154a915b1f811416f3c29c6af0c0f13fc3acd3e (diff) |
Move the meters per unit property to the listener
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 2 | ||||
-rw-r--r-- | alc/alcontext.h | 2 | ||||
-rw-r--r-- | alc/alu.cpp | 3 |
3 files changed, 2 insertions, 5 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index ca7ce4fb..143c2e4e 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -2445,7 +2445,7 @@ void ALCcontext::init() mListener.Params.Matrix = alu::Matrix::Identity(); mListener.Params.Velocity = alu::Vector{}; mListener.Params.Gain = mListener.Gain; - mListener.Params.MetersPerUnit = mMetersPerUnit; + mListener.Params.MetersPerUnit = mListener.mMetersPerUnit; mListener.Params.DopplerFactor = mDopplerFactor; mListener.Params.SpeedOfSound = mSpeedOfSound * mDopplerVelocity; mListener.Params.SourceDistanceModel = mSourceDistanceModel; diff --git a/alc/alcontext.h b/alc/alcontext.h index 70215e9c..f30a4bd0 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -48,7 +48,6 @@ struct ALcontextProps { ALfloat SpeedOfSound; ALboolean SourceDistanceModel; DistanceModel mDistanceModel; - ALfloat MetersPerUnit; std::atomic<ALcontextProps*> next; }; @@ -102,7 +101,6 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext> { ALfloat mDopplerFactor{1.0f}; ALfloat mDopplerVelocity{1.0f}; ALfloat mSpeedOfSound{SPEEDOFSOUNDMETRESPERSEC}; - ALfloat mMetersPerUnit{AL_DEFAULT_METERS_PER_UNIT}; std::atomic_flag mPropsClean; std::atomic<bool> mDeferUpdates{false}; diff --git a/alc/alu.cpp b/alc/alu.cpp index 4044c712..f2c843fe 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -271,8 +271,6 @@ bool CalcContextParams(ALCcontext *Context) if(!props) return false; ALlistener &Listener = Context->mListener; - Listener.Params.MetersPerUnit = props->MetersPerUnit; - Listener.Params.DopplerFactor = props->DopplerFactor; Listener.Params.SpeedOfSound = props->SpeedOfSound * props->DopplerVelocity; @@ -314,6 +312,7 @@ bool CalcListenerParams(ALCcontext *Context) Listener.Params.Velocity = Listener.Params.Matrix * vel; Listener.Params.Gain = props->Gain * Context->mGainBoost; + Listener.Params.MetersPerUnit = props->MetersPerUnit; AtomicReplaceHead(Context->mFreeListenerProps, props); return true; |