From 1075cce7b3dc6fd6592a925224735437f6b6f3ed Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 11 Sep 2011 01:18:57 -0700 Subject: [PATCH] Mark some source properties volatile --- Alc/ALu.c | 38 +++++++++++++++------------ OpenAL32/Include/alSource.h | 62 ++++++++++++++++++++++----------------------- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index 3ce7a3b1..052a415a 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -383,23 +383,29 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) memcpy(ListenerVel, ALContext->Listener.Velocity, sizeof(ALContext->Listener.Velocity)); //Get source properties - SourceVolume = ALSource->flGain; - MinVolume = ALSource->flMinGain; - MaxVolume = ALSource->flMaxGain; - Pitch = ALSource->flPitch; - Resampler = ALSource->Resampler; - memcpy(Position, ALSource->vPosition, sizeof(ALSource->vPosition)); - memcpy(Direction, ALSource->vOrientation, sizeof(ALSource->vOrientation)); - memcpy(Velocity, ALSource->vVelocity, sizeof(ALSource->vVelocity)); - MinDist = ALSource->flRefDistance; - MaxDist = ALSource->flMaxDistance; - Rolloff = ALSource->flRollOffFactor; - InnerAngle = ALSource->flInnerAngle * ConeScale; - OuterAngle = ALSource->flOuterAngle * ConeScale; + SourceVolume = ALSource->flGain; + MinVolume = ALSource->flMinGain; + MaxVolume = ALSource->flMaxGain; + Pitch = ALSource->flPitch; + Resampler = ALSource->Resampler; + Position[0] = ALSource->vPosition[0]; + Position[1] = ALSource->vPosition[1]; + Position[2] = ALSource->vPosition[2]; + Direction[0] = ALSource->vOrientation[0]; + Direction[1] = ALSource->vOrientation[1]; + Direction[2] = ALSource->vOrientation[2]; + Velocity[0] = ALSource->vVelocity[0]; + Velocity[1] = ALSource->vVelocity[1]; + Velocity[2] = ALSource->vVelocity[2]; + MinDist = ALSource->flRefDistance; + MaxDist = ALSource->flMaxDistance; + Rolloff = ALSource->flRollOffFactor; + InnerAngle = ALSource->flInnerAngle * ConeScale; + OuterAngle = ALSource->flOuterAngle * ConeScale; AirAbsorptionFactor = ALSource->AirAbsorptionFactor; - DryGainHFAuto = ALSource->DryGainHFAuto; - WetGainAuto = ALSource->WetGainAuto; - WetGainHFAuto = ALSource->WetGainHFAuto; + DryGainHFAuto = ALSource->DryGainHFAuto; + WetGainAuto = ALSource->WetGainAuto; + WetGainHFAuto = ALSource->WetGainHFAuto; RoomRolloffBase = ALSource->RoomRolloffFactor; for(i = 0;i < NumSends;i++) { diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 920de683..ee2a5cd1 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -30,30 +30,30 @@ typedef struct ALbufferlistitem typedef struct ALsource { - ALfloat flPitch; - ALfloat flGain; - ALfloat flOuterGain; - ALfloat flMinGain; - ALfloat flMaxGain; - ALfloat flInnerAngle; - ALfloat flOuterAngle; - ALfloat flRefDistance; - ALfloat flMaxDistance; - ALfloat flRollOffFactor; - ALfloat vPosition[3]; - ALfloat vVelocity[3]; - ALfloat vOrientation[3]; - ALboolean bHeadRelative; - ALboolean bLooping; - enum DistanceModel DistanceModel; - ALboolean VirtualChannels; + volatile ALfloat flPitch; + volatile ALfloat flGain; + volatile ALfloat flOuterGain; + volatile ALfloat flMinGain; + volatile ALfloat flMaxGain; + volatile ALfloat flInnerAngle; + volatile ALfloat flOuterAngle; + volatile ALfloat flRefDistance; + volatile ALfloat flMaxDistance; + volatile ALfloat flRollOffFactor; + volatile ALfloat vPosition[3]; + volatile ALfloat vVelocity[3]; + volatile ALfloat vOrientation[3]; + volatile ALboolean bHeadRelative; + volatile ALboolean bLooping; + volatile enum DistanceModel DistanceModel; + volatile ALboolean VirtualChannels; enum Resampler Resampler; - ALenum state; - ALenum new_state; - ALuint position; - ALuint position_fraction; + volatile ALenum state; + ALenum new_state; + ALuint position; + ALuint position_fraction; ALbufferlistitem *queue; // Linked list of buffers in queue ALuint BuffersInQueue; // Number of buffers in queue @@ -68,20 +68,20 @@ typedef struct ALsource ALfloat WetGainHF; } Send[MAX_SENDS]; - ALboolean DryGainHFAuto; - ALboolean WetGainAuto; - ALboolean WetGainHFAuto; - ALfloat OuterGainHF; + volatile ALboolean DryGainHFAuto; + volatile ALboolean WetGainAuto; + volatile ALboolean WetGainHFAuto; + volatile ALfloat OuterGainHF; - ALfloat AirAbsorptionFactor; - ALfloat RoomRolloffFactor; - ALfloat DopplerFactor; + volatile ALfloat AirAbsorptionFactor; + volatile ALfloat RoomRolloffFactor; + volatile ALfloat DopplerFactor; - ALint lOffset; - ALint lOffsetType; + ALint lOffset; + ALint lOffsetType; // Source Type (Static, Streaming, or Undetermined) - ALint lSourceType; + volatile ALint lSourceType; ALuint NumChannels; ALuint SampleSize; -- 2.11.4.GIT