diff options
author | Chris Robinson <[email protected]> | 2014-12-16 07:20:27 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-12-16 07:20:27 -0800 |
commit | 3b8f54d572b586cd60e6b0c8d839c71edeabbdae (patch) | |
tree | 18ceb20f443075707db5a56db4dcc5e40c5b72f3 /OpenAL32/alSource.c | |
parent | 97f6d302fe61529ca590d67af9c32bb42e75cdf5 (diff) |
Use aluVector in some more places
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index be3768f3..b05b85c5 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -519,9 +519,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp CHECKVAL(isfinite(values[0]) && isfinite(values[1]) && isfinite(values[2])); LockContext(Context); - Source->Position[0] = values[0]; - Source->Position[1] = values[1]; - Source->Position[2] = values[2]; + aluVectorSet(&Source->Position, values[0], values[1], values[2], 1.0f); UnlockContext(Context); ATOMIC_STORE(&Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -530,9 +528,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp CHECKVAL(isfinite(values[0]) && isfinite(values[1]) && isfinite(values[2])); LockContext(Context); - Source->Velocity[0] = values[0]; - Source->Velocity[1] = values[1]; - Source->Velocity[2] = values[2]; + aluVectorSet(&Source->Velocity, values[0], values[1], values[2], 0.0f); UnlockContext(Context); ATOMIC_STORE(&Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -541,9 +537,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp CHECKVAL(isfinite(values[0]) && isfinite(values[1]) && isfinite(values[2])); LockContext(Context); - Source->Direction[0] = values[0]; - Source->Direction[1] = values[1]; - Source->Direction[2] = values[2]; + aluVectorSet(&Source->Direction, values[0], values[1], values[2], 0.0f); UnlockContext(Context); ATOMIC_STORE(&Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -1054,25 +1048,25 @@ static ALboolean GetSourcedv(ALsource *Source, ALCcontext *Context, SrcFloatProp case AL_POSITION: LockContext(Context); - values[0] = Source->Position[0]; - values[1] = Source->Position[1]; - values[2] = Source->Position[2]; + values[0] = Source->Position.v[0]; + values[1] = Source->Position.v[1]; + values[2] = Source->Position.v[2]; UnlockContext(Context); return AL_TRUE; case AL_VELOCITY: LockContext(Context); - values[0] = Source->Velocity[0]; - values[1] = Source->Velocity[1]; - values[2] = Source->Velocity[2]; + values[0] = Source->Velocity.v[0]; + values[1] = Source->Velocity.v[1]; + values[2] = Source->Velocity.v[2]; UnlockContext(Context); return AL_TRUE; case AL_DIRECTION: LockContext(Context); - values[0] = Source->Direction[0]; - values[1] = Source->Direction[1]; - values[2] = Source->Direction[2]; + values[0] = Source->Direction.v[0]; + values[1] = Source->Direction.v[1]; + values[2] = Source->Direction.v[2]; UnlockContext(Context); return AL_TRUE; @@ -2464,15 +2458,9 @@ static ALvoid InitSourceParams(ALsource *Source) Source->InnerAngle = 360.0f; Source->OuterAngle = 360.0f; Source->Pitch = 1.0f; - Source->Position[0] = 0.0f; - Source->Position[1] = 0.0f; - Source->Position[2] = 0.0f; - Source->Velocity[0] = 0.0f; - Source->Velocity[1] = 0.0f; - Source->Velocity[2] = 0.0f; - Source->Direction[0] = 0.0f; - Source->Direction[1] = 0.0f; - Source->Direction[2] = 0.0f; + aluVectorSet(&Source->Position, 0.0f, 0.0f, 0.0f, 1.0f); + aluVectorSet(&Source->Velocity, 0.0f, 0.0f, 0.0f, 0.0f); + aluVectorSet(&Source->Direction, 0.0f, 0.0f, 0.0f, 0.0f); Source->Orientation[0][0] = 0.0f; Source->Orientation[0][1] = 0.0f; Source->Orientation[0][2] = -1.0f; |