Consolidate some code

This commit is contained in:
Chris Robinson
2010-09-21 19:49:47 -07:00
parent 97daaade8a
commit 9b1ad6c873
+12 -13
View File
@@ -162,23 +162,22 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
Data = ALBuffer->data;
DataSize = ALBuffer->size;
DataSize /= aluFrameSizeFromFormat(ALBuffer->format);
LoopStart = ALBuffer->LoopStart;
LoopEnd = ALBuffer->LoopEnd;
Channels = aluChannelsFromFormat(ALBuffer->format);
Bytes = aluBytesFromFormat(ALBuffer->format);
}
if(Looping && ALSource->lSourceType == AL_STATIC)
{
/* If current offset is beyond the loop range, do not loop */
if(DataPosInt >= LoopEnd)
Looping = AL_FALSE;
}
if(!Looping || ALSource->lSourceType != AL_STATIC)
{
/* Non-looping and non-static sources ignore loop points */
LoopStart = 0;
LoopEnd = DataSize;
LoopEnd = DataSize;
if(Looping && ALSource->lSourceType == AL_STATIC)
{
/* If current pos is beyond the loop range, do not loop */
if(DataPosInt >= LoopEnd)
Looping = AL_FALSE;
else
{
LoopStart = ALBuffer->LoopStart;
LoopEnd = ALBuffer->LoopEnd;
}
}
}
if(DataPosInt >= DataSize)