aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-11 01:26:09 -0700
committerChris Robinson <[email protected]>2011-09-11 01:26:09 -0700
commitccd8cbc2a944a0822d1277b1524d05455564b0e5 (patch)
tree24c50c51fea4f40b769a7a1bd1534ea32acb6db0
parent1075cce7b3dc6fd6592a925224735437f6b6f3ed (diff)
Make some listener properties volatile
-rw-r--r--Alc/ALu.c16
-rw-r--r--OpenAL32/Include/alListener.h8
2 files changed, 15 insertions, 9 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 052a415a..3c80b7bc 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -378,9 +378,11 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
Frequency = Device->Frequency;
//Get listener properties
- ListenerGain = ALContext->Listener.Gain;
- MetersPerUnit = ALContext->Listener.MetersPerUnit;
- memcpy(ListenerVel, ALContext->Listener.Velocity, sizeof(ALContext->Listener.Velocity));
+ ListenerGain = ALContext->Listener.Gain;
+ MetersPerUnit = ALContext->Listener.MetersPerUnit;
+ ListenerVel[0] = ALContext->Listener.Velocity[0];
+ ListenerVel[1] = ALContext->Listener.Velocity[1];
+ ListenerVel[2] = ALContext->Listener.Velocity[2];
//Get source properties
SourceVolume = ALSource->flGain;
@@ -452,9 +454,13 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALfloat Matrix[4][4];
// Build transform matrix
- memcpy(N, ALContext->Listener.Forward, sizeof(N)); // At-vector
+ N[0] = ALContext->Listener.Forward[0]; // At-vector
+ N[1] = ALContext->Listener.Forward[1];
+ N[2] = ALContext->Listener.Forward[2];
aluNormalize(N); // Normalized At-vector
- memcpy(V, ALContext->Listener.Up, sizeof(V)); // Up-vector
+ V[0] = ALContext->Listener.Up[0]; // Up-vector
+ V[1] = ALContext->Listener.Up[1];
+ V[2] = ALContext->Listener.Up[2];
aluNormalize(V); // Normalized Up-vector
aluCrossproduct(N, V, U); // Right-vector
aluNormalize(U); // Normalized Right-vector
diff --git a/OpenAL32/Include/alListener.h b/OpenAL32/Include/alListener.h
index 2bda3197..0f399e5f 100644
--- a/OpenAL32/Include/alListener.h
+++ b/OpenAL32/Include/alListener.h
@@ -9,10 +9,10 @@ extern "C" {
typedef struct ALlistener_struct
{
- ALfloat Position[3];
- ALfloat Velocity[3];
- ALfloat Forward[3];
- ALfloat Up[3];
+ volatile ALfloat Position[3];
+ volatile ALfloat Velocity[3];
+ volatile ALfloat Forward[3];
+ volatile ALfloat Up[3];
volatile ALfloat Gain;
volatile ALfloat MetersPerUnit;
} ALlistener;