Avoid naming a struct member the same as an enum type
This commit is contained in:
+2
-2
@@ -2628,7 +2628,7 @@ static ALvoid InitContext(ALCcontext *Context)
|
||||
ATOMIC_INIT(&Context->ActiveAuxSlots, auxslots);
|
||||
|
||||
//Set globals
|
||||
Context->DistanceModel = DistanceModel::Default;
|
||||
Context->mDistanceModel = DistanceModel::Default;
|
||||
Context->SourceDistanceModel = AL_FALSE;
|
||||
Context->DopplerFactor = 1.0f;
|
||||
Context->DopplerVelocity = 1.0f;
|
||||
@@ -2661,7 +2661,7 @@ static ALvoid InitContext(ALCcontext *Context)
|
||||
listener.Params.ReverbSpeedOfSound = listener.Params.SpeedOfSound *
|
||||
listener.Params.MetersPerUnit;
|
||||
listener.Params.SourceDistanceModel = Context->SourceDistanceModel;
|
||||
listener.Params.DistanceModel = Context->DistanceModel;
|
||||
listener.Params.mDistanceModel = Context->mDistanceModel;
|
||||
|
||||
|
||||
Context->AsyncEvents = ll_ringbuffer_create(63, sizeof(AsyncEvent), false);
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ struct ALCcontext_struct {
|
||||
|
||||
ATOMIC(ALenum) LastError;
|
||||
|
||||
enum DistanceModel DistanceModel;
|
||||
DistanceModel mDistanceModel;
|
||||
ALboolean SourceDistanceModel;
|
||||
|
||||
ALfloat DopplerFactor;
|
||||
@@ -171,7 +171,7 @@ struct ALcontextProps {
|
||||
ALfloat DopplerVelocity;
|
||||
ALfloat SpeedOfSound;
|
||||
ALboolean SourceDistanceModel;
|
||||
enum DistanceModel DistanceModel;
|
||||
DistanceModel mDistanceModel;
|
||||
ALfloat MetersPerUnit;
|
||||
|
||||
ATOMIC(struct ALcontextProps*) next;
|
||||
|
||||
+2
-2
@@ -328,7 +328,7 @@ static bool CalcContextParams(ALCcontext *Context)
|
||||
Listener.Params.MetersPerUnit;
|
||||
|
||||
Listener.Params.SourceDistanceModel = props->SourceDistanceModel;
|
||||
Listener.Params.DistanceModel = props->DistanceModel;
|
||||
Listener.Params.mDistanceModel = props->mDistanceModel;
|
||||
|
||||
ATOMIC_REPLACE_HEAD(struct ALcontextProps*, &Context->FreeContextProps, props);
|
||||
return true;
|
||||
@@ -1210,7 +1210,7 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop
|
||||
ClampedDist = Distance;
|
||||
|
||||
switch(Listener.Params.SourceDistanceModel ?
|
||||
props->DistanceModel : Listener.Params.DistanceModel)
|
||||
props->mDistanceModel : Listener.Params.mDistanceModel)
|
||||
{
|
||||
case DistanceModel::InverseClamped:
|
||||
ClampedDist = clampf(ClampedDist, props->RefDistance, props->MaxDistance);
|
||||
|
||||
@@ -46,7 +46,7 @@ struct ALlistener {
|
||||
ALfloat ReverbSpeedOfSound; /* in meters per sec! */
|
||||
|
||||
ALboolean SourceDistanceModel;
|
||||
enum DistanceModel DistanceModel;
|
||||
DistanceModel mDistanceModel;
|
||||
} Params;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct ALsource {
|
||||
ALfloat Orientation[2][3];
|
||||
ALboolean HeadRelative;
|
||||
ALboolean Looping;
|
||||
enum DistanceModel DistanceModel;
|
||||
DistanceModel mDistanceModel;
|
||||
enum Resampler Resampler;
|
||||
ALboolean DirectChannels;
|
||||
enum SpatializeMode Spatialize;
|
||||
|
||||
@@ -161,7 +161,7 @@ struct ALvoiceProps {
|
||||
ALfloat Direction[3];
|
||||
ALfloat Orientation[2][3];
|
||||
ALboolean HeadRelative;
|
||||
enum DistanceModel DistanceModel;
|
||||
DistanceModel mDistanceModel;
|
||||
enum Resampler Resampler;
|
||||
ALboolean DirectChannels;
|
||||
enum SpatializeMode SpatializeMode;
|
||||
|
||||
@@ -964,7 +964,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
|
||||
*values == AL_EXPONENT_DISTANCE ||
|
||||
*values == AL_EXPONENT_DISTANCE_CLAMPED);
|
||||
|
||||
Source->DistanceModel = static_cast<DistanceModel>(*values);
|
||||
Source->mDistanceModel = static_cast<DistanceModel>(*values);
|
||||
if(Context->SourceDistanceModel)
|
||||
DO_UPDATEPROPS();
|
||||
return AL_TRUE;
|
||||
@@ -1468,7 +1468,7 @@ static ALboolean GetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
|
||||
return AL_TRUE;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
*values = static_cast<int>(Source->DistanceModel);
|
||||
*values = static_cast<int>(Source->mDistanceModel);
|
||||
return AL_TRUE;
|
||||
|
||||
case AL_SOURCE_RESAMPLER_SOFT:
|
||||
@@ -3082,7 +3082,7 @@ static void InitSourceParams(ALsource *Source, ALsizei num_sends)
|
||||
Source->DopplerFactor = 1.0f;
|
||||
Source->HeadRelative = AL_FALSE;
|
||||
Source->Looping = AL_FALSE;
|
||||
Source->DistanceModel = DistanceModel::Default;
|
||||
Source->mDistanceModel = DistanceModel::Default;
|
||||
Source->Resampler = ResamplerDefault;
|
||||
Source->DirectChannels = AL_FALSE;
|
||||
Source->Spatialize = SpatializeAuto;
|
||||
@@ -3196,7 +3196,7 @@ static void UpdateSourceProps(ALsource *source, ALvoice *voice, ALsizei num_send
|
||||
props->Orientation[i][j] = source->Orientation[i][j];
|
||||
}
|
||||
props->HeadRelative = source->HeadRelative;
|
||||
props->DistanceModel = source->DistanceModel;
|
||||
props->mDistanceModel = source->mDistanceModel;
|
||||
props->Resampler = source->Resampler;
|
||||
props->DirectChannels = source->DirectChannels;
|
||||
props->SpatializeMode = source->Spatialize;
|
||||
|
||||
@@ -149,7 +149,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
|
||||
break;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
if(context->DistanceModel == DistanceModel::Default)
|
||||
if(context->mDistanceModel == DistanceModel::Default)
|
||||
value = AL_TRUE;
|
||||
break;
|
||||
|
||||
@@ -202,7 +202,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
|
||||
break;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
value = (ALdouble)context->DistanceModel;
|
||||
value = (ALdouble)context->mDistanceModel;
|
||||
break;
|
||||
|
||||
case AL_SPEED_OF_SOUND:
|
||||
@@ -251,7 +251,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
|
||||
break;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
value = (ALfloat)context->DistanceModel;
|
||||
value = (ALfloat)context->mDistanceModel;
|
||||
break;
|
||||
|
||||
case AL_SPEED_OF_SOUND:
|
||||
@@ -300,7 +300,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
|
||||
break;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
value = (ALint)context->DistanceModel;
|
||||
value = (ALint)context->mDistanceModel;
|
||||
break;
|
||||
|
||||
case AL_SPEED_OF_SOUND:
|
||||
@@ -349,7 +349,7 @@ extern "C" AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname)
|
||||
break;
|
||||
|
||||
case AL_DISTANCE_MODEL:
|
||||
value = (ALint64SOFT)context->DistanceModel;
|
||||
value = (ALint64SOFT)context->mDistanceModel;
|
||||
break;
|
||||
|
||||
case AL_SPEED_OF_SOUND:
|
||||
@@ -708,7 +708,7 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
|
||||
else
|
||||
{
|
||||
std::lock_guard<almtx_t> _{context->PropLock};
|
||||
context->DistanceModel = static_cast<enum DistanceModel>(value);
|
||||
context->mDistanceModel = static_cast<DistanceModel>(value);
|
||||
if(!context->SourceDistanceModel)
|
||||
DO_UPDATEPROPS();
|
||||
}
|
||||
@@ -785,7 +785,7 @@ void UpdateContextProps(ALCcontext *context)
|
||||
props->SpeedOfSound = context->SpeedOfSound;
|
||||
|
||||
props->SourceDistanceModel = context->SourceDistanceModel;
|
||||
props->DistanceModel = context->DistanceModel;
|
||||
props->mDistanceModel = context->mDistanceModel;
|
||||
|
||||
/* Set the new container for updating internal parameters. */
|
||||
props = static_cast<ALcontextProps*>(ATOMIC_EXCHANGE_PTR(&context->Update, props,
|
||||
|
||||
Reference in New Issue
Block a user