aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-18 06:15:02 -0800
committerChris Robinson <[email protected]>2018-11-18 06:35:45 -0800
commite194d896de6cbeec2a06041dc73ba1a0ff0d992e (patch)
treec3c68ff384c73a9de9d5de3658394b59cc7ea411 /Alc/alc.cpp
parentad82a70a655f3b1172a2b1c49b3eea2feb699c16 (diff)
Use constructors/destructors for ALeffectslot
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r--Alc/alc.cpp41
1 files changed, 2 insertions, 39 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 2ab2df8e..8cc8fb2d 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2584,31 +2584,8 @@ static ALvoid InitContext(ALCcontext *Context)
ALlistener &listener = Context->Listener;
struct ALeffectslotArray *auxslots;
- //Initialise listener
- listener.Gain = 1.0f;
- listener.Position[0] = 0.0f;
- listener.Position[1] = 0.0f;
- listener.Position[2] = 0.0f;
- listener.Velocity[0] = 0.0f;
- listener.Velocity[1] = 0.0f;
- listener.Velocity[2] = 0.0f;
- listener.Forward[0] = 0.0f;
- listener.Forward[1] = 0.0f;
- listener.Forward[2] = -1.0f;
- listener.Up[0] = 0.0f;
- listener.Up[1] = 1.0f;
- listener.Up[2] = 0.0f;
- ATOMIC_INIT(&listener.PropsClean, AL_TRUE);
-
- ATOMIC_INIT(&listener.Update, static_cast<ALlistenerProps*>(nullptr));
-
//Validate Context
- InitRef(&Context->UpdateCount, 0);
- ATOMIC_INIT(&Context->HoldUpdates, AL_FALSE);
- Context->GainBoost = 1.0f;
almtx_init(&Context->PropLock, almtx_plain);
- ATOMIC_INIT(&Context->LastError, AL_NO_ERROR);
- Context->NumSources = 0;
almtx_init(&Context->SourceLock, almtx_plain);
almtx_init(&Context->EffectSlotLock, almtx_plain);
@@ -2637,17 +2614,7 @@ static ALvoid InitContext(ALCcontext *Context)
ATOMIC_INIT(&Context->PropsClean, AL_TRUE);
ATOMIC_INIT(&Context->DeferUpdates, AL_FALSE);
alsem_init(&Context->EventSem, 0);
- Context->AsyncEvents = nullptr;
- ATOMIC_INIT(&Context->EnabledEvts, 0u);
almtx_init(&Context->EventCbLock, almtx_plain);
- Context->EventCb = nullptr;
- Context->EventParam = nullptr;
-
- ATOMIC_INIT(&Context->Update, static_cast<ALcontextProps*>(nullptr));
- ATOMIC_INIT(&Context->FreeContextProps, static_cast<ALcontextProps*>(nullptr));
- ATOMIC_INIT(&Context->FreeListenerProps, static_cast<ALlistenerProps*>(nullptr));
- ATOMIC_INIT(&Context->FreeVoiceProps, static_cast<ALvoiceProps*>(nullptr));
- ATOMIC_INIT(&Context->FreeEffectslotProps, static_cast<ALeffectslotProps*>(nullptr));
Context->ExtensionList = alExtList;
@@ -2696,12 +2663,8 @@ ALCcontext_struct::~ALCcontext_struct()
}
TRACE("Freed " SZFMT " context property object%s\n", count, (count==1)?"":"s");
- if(DefaultSlot)
- {
- DeinitEffectSlot(DefaultSlot);
- delete DefaultSlot;
- DefaultSlot = nullptr;
- }
+ delete DefaultSlot;
+ DefaultSlot = nullptr;
al_free(ActiveAuxSlots.exchange(nullptr, std::memory_order_relaxed));