aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-09 04:44:27 -0700
committerChris Robinson <[email protected]>2012-10-09 04:44:27 -0700
commitc22408cb2af607ce65846a4ade31251b714c183b (patch)
tree3bfea812a9c297b4991cfcf77cb883dda8fe220e /Alc/ALc.c
parent8c3419ed48b0221816314f605b0a7c6e045d95dc (diff)
Store a pointer to the listener in the context
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 917faf08..f08ee597 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1802,24 +1802,24 @@ static ALvoid InitContext(ALCcontext *Context)
ALint i, j;
//Initialise listener
- Context->Listener.Gain = 1.0f;
- Context->Listener.MetersPerUnit = 1.0f;
- Context->Listener.Position[0] = 0.0f;
- Context->Listener.Position[1] = 0.0f;
- Context->Listener.Position[2] = 0.0f;
- Context->Listener.Velocity[0] = 0.0f;
- Context->Listener.Velocity[1] = 0.0f;
- Context->Listener.Velocity[2] = 0.0f;
- Context->Listener.Forward[0] = 0.0f;
- Context->Listener.Forward[1] = 0.0f;
- Context->Listener.Forward[2] = -1.0f;
- Context->Listener.Up[0] = 0.0f;
- Context->Listener.Up[1] = 1.0f;
- Context->Listener.Up[2] = 0.0f;
+ Context->Listener->Gain = 1.0f;
+ Context->Listener->MetersPerUnit = 1.0f;
+ Context->Listener->Position[0] = 0.0f;
+ Context->Listener->Position[1] = 0.0f;
+ Context->Listener->Position[2] = 0.0f;
+ Context->Listener->Velocity[0] = 0.0f;
+ Context->Listener->Velocity[1] = 0.0f;
+ Context->Listener->Velocity[2] = 0.0f;
+ Context->Listener->Forward[0] = 0.0f;
+ Context->Listener->Forward[1] = 0.0f;
+ Context->Listener->Forward[2] = -1.0f;
+ Context->Listener->Up[0] = 0.0f;
+ Context->Listener->Up[1] = 1.0f;
+ Context->Listener->Up[2] = 0.0f;
for(i = 0;i < 4;i++)
{
for(j = 0;j < 4;j++)
- Context->Listener.Matrix[i][j] = ((i==j) ? 1.0f : 0.0f);
+ Context->Listener->Matrix[i][j] = ((i==j) ? 1.0f : 0.0f);
}
//Validate Context
@@ -2461,10 +2461,11 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
return NULL;
}
- ALContext = calloc(1, sizeof(ALCcontext));
+ ALContext = calloc(1, sizeof(ALCcontext)+15+sizeof(ALlistener));
if(ALContext)
{
ALContext->ref = 1;
+ ALContext->Listener = (ALlistener*)(((ALintptrEXT)(ALContext+1)+15)&~15);
ALContext->MaxActiveSources = 256;
ALContext->ActiveSources = malloc(sizeof(ALContext->ActiveSources[0]) *