Rename some variables to be less confusing
This commit is contained in:
parent
f98bf32be8
commit
7e498012ff
64
Alc/mixer.c
64
Alc/mixer.c
@ -389,7 +389,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
|
|||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
static void MixSource(ALsource *Source, ALCcontext *Context,
|
||||||
float (*DryBuffer)[OUTPUTCHANNELS], ALuint SamplesToDo,
|
float (*DryBuffer)[OUTPUTCHANNELS], ALuint SamplesToDo,
|
||||||
ALfloat *ClickRemoval, ALfloat *PendingClicks)
|
ALfloat *ClickRemoval, ALfloat *PendingClicks)
|
||||||
{
|
{
|
||||||
@ -412,37 +412,37 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
ALboolean Looping;
|
ALboolean Looping;
|
||||||
ALenum State;
|
ALenum State;
|
||||||
|
|
||||||
if(ALSource->NeedsUpdate)
|
if(Source->NeedsUpdate)
|
||||||
{
|
{
|
||||||
ALsource_Update(ALSource, ALContext);
|
ALsource_Update(Source, Context);
|
||||||
ALSource->NeedsUpdate = AL_FALSE;
|
Source->NeedsUpdate = AL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get source info */
|
/* Get source info */
|
||||||
Resampler = ALSource->Resampler;
|
Resampler = Source->Resampler;
|
||||||
State = ALSource->state;
|
State = Source->state;
|
||||||
BuffersPlayed = ALSource->BuffersPlayed;
|
BuffersPlayed = Source->BuffersPlayed;
|
||||||
DataPosInt = ALSource->position;
|
DataPosInt = Source->position;
|
||||||
DataPosFrac = ALSource->position_fraction;
|
DataPosFrac = Source->position_fraction;
|
||||||
Looping = ALSource->bLooping;
|
Looping = Source->bLooping;
|
||||||
|
|
||||||
for(i = 0;i < OUTPUTCHANNELS;i++)
|
for(i = 0;i < OUTPUTCHANNELS;i++)
|
||||||
DrySend[i] = ALSource->Params.DryGains[i];
|
DrySend[i] = Source->Params.DryGains[i];
|
||||||
for(i = 0;i < MAX_SENDS;i++)
|
for(i = 0;i < MAX_SENDS;i++)
|
||||||
WetSend[i] = ALSource->Params.WetGains[i];
|
WetSend[i] = Source->Params.WetGains[i];
|
||||||
|
|
||||||
/* Get fixed point step */
|
/* Get fixed point step */
|
||||||
increment = ALSource->Params.Step;
|
increment = Source->Params.Step;
|
||||||
|
|
||||||
DryFilter = &ALSource->Params.iirFilter;
|
DryFilter = &Source->Params.iirFilter;
|
||||||
for(i = 0;i < MAX_SENDS;i++)
|
for(i = 0;i < MAX_SENDS;i++)
|
||||||
{
|
{
|
||||||
WetFilter[i] = &ALSource->Params.Send[i].iirFilter;
|
WetFilter[i] = &Source->Params.Send[i].iirFilter;
|
||||||
if(ALSource->Send[i].Slot)
|
if(Source->Send[i].Slot)
|
||||||
{
|
{
|
||||||
WetBuffer[i] = ALSource->Send[i].Slot->WetBuffer;
|
WetBuffer[i] = Source->Send[i].Slot->WetBuffer;
|
||||||
WetClickRemoval[i] = ALSource->Send[i].Slot->ClickRemoval;
|
WetClickRemoval[i] = Source->Send[i].Slot->ClickRemoval;
|
||||||
WetPendingClicks[i] = ALSource->Send[i].Slot->PendingClicks;
|
WetPendingClicks[i] = Source->Send[i].Slot->PendingClicks;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -453,7 +453,7 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get current buffer queue item */
|
/* Get current buffer queue item */
|
||||||
BufferListItem = ALSource->queue;
|
BufferListItem = Source->queue;
|
||||||
for(i = 0;i < BuffersPlayed;i++)
|
for(i = 0;i < BuffersPlayed;i++)
|
||||||
BufferListItem = BufferListItem->next;
|
BufferListItem = BufferListItem->next;
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
|
|
||||||
LoopStart = 0;
|
LoopStart = 0;
|
||||||
LoopEnd = DataSize;
|
LoopEnd = DataSize;
|
||||||
if(Looping && ALSource->lSourceType == AL_STATIC)
|
if(Looping && Source->lSourceType == AL_STATIC)
|
||||||
{
|
{
|
||||||
/* If current pos is beyond the loop range, do not loop */
|
/* If current pos is beyond the loop range, do not loop */
|
||||||
if(DataPosInt >= LoopEnd)
|
if(DataPosInt >= LoopEnd)
|
||||||
@ -511,7 +511,7 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
}
|
}
|
||||||
else if(Looping)
|
else if(Looping)
|
||||||
{
|
{
|
||||||
ALbuffer *NextBuf = ALSource->queue->buffer;
|
ALbuffer *NextBuf = Source->queue->buffer;
|
||||||
if(NextBuf && NextBuf->size)
|
if(NextBuf && NextBuf->size)
|
||||||
{
|
{
|
||||||
ALint ulExtraSamples = BUFFER_PADDING*Channels*Bytes;
|
ALint ulExtraSamples = BUFFER_PADDING*Channels*Bytes;
|
||||||
@ -543,7 +543,7 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
/* Handle looping sources */
|
/* Handle looping sources */
|
||||||
if(DataPosInt >= LoopEnd)
|
if(DataPosInt >= LoopEnd)
|
||||||
{
|
{
|
||||||
if(BuffersPlayed < (ALSource->BuffersInQueue-1))
|
if(BuffersPlayed < (Source->BuffersInQueue-1))
|
||||||
{
|
{
|
||||||
BufferListItem = BufferListItem->next;
|
BufferListItem = BufferListItem->next;
|
||||||
BuffersPlayed++;
|
BuffersPlayed++;
|
||||||
@ -551,9 +551,9 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
}
|
}
|
||||||
else if(Looping)
|
else if(Looping)
|
||||||
{
|
{
|
||||||
BufferListItem = ALSource->queue;
|
BufferListItem = Source->queue;
|
||||||
BuffersPlayed = 0;
|
BuffersPlayed = 0;
|
||||||
if(ALSource->lSourceType == AL_STATIC)
|
if(Source->lSourceType == AL_STATIC)
|
||||||
DataPosInt = ((DataPosInt-LoopStart)%(LoopEnd-LoopStart)) + LoopStart;
|
DataPosInt = ((DataPosInt-LoopStart)%(LoopEnd-LoopStart)) + LoopStart;
|
||||||
else
|
else
|
||||||
DataPosInt -= DataSize;
|
DataPosInt -= DataSize;
|
||||||
@ -561,8 +561,8 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
State = AL_STOPPED;
|
State = AL_STOPPED;
|
||||||
BufferListItem = ALSource->queue;
|
BufferListItem = Source->queue;
|
||||||
BuffersPlayed = ALSource->BuffersInQueue;
|
BuffersPlayed = Source->BuffersInQueue;
|
||||||
DataPosInt = 0;
|
DataPosInt = 0;
|
||||||
DataPosFrac = 0;
|
DataPosFrac = 0;
|
||||||
}
|
}
|
||||||
@ -570,11 +570,11 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
|
|||||||
} while(State == AL_PLAYING && j < SamplesToDo);
|
} while(State == AL_PLAYING && j < SamplesToDo);
|
||||||
|
|
||||||
/* Update source info */
|
/* Update source info */
|
||||||
ALSource->state = State;
|
Source->state = State;
|
||||||
ALSource->BuffersPlayed = BuffersPlayed;
|
Source->BuffersPlayed = BuffersPlayed;
|
||||||
ALSource->position = DataPosInt;
|
Source->position = DataPosInt;
|
||||||
ALSource->position_fraction = DataPosFrac;
|
Source->position_fraction = DataPosFrac;
|
||||||
ALSource->Buffer = BufferListItem->buffer;
|
Source->Buffer = BufferListItem->buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef DO_MIX_MC
|
#undef DO_MIX_MC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user