aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-29 19:48:18 -0800
committerChris Robinson <[email protected]>2010-11-29 19:48:18 -0800
commit0cf32e29465830e7d79eb3d40bb85e328d43625a (patch)
tree6c54363145fbb3a84eb0ebef99a56460a2292da6
parent693ab4d8bc34cdc5a394eca45b2648f21613c917 (diff)
Reorder some parameters for consistency
-rw-r--r--Alc/ALu.c8
-rw-r--r--Alc/mixer.c2
-rw-r--r--OpenAL32/Include/alBuffer.h10
-rw-r--r--OpenAL32/alBuffer.c2
-rw-r--r--OpenAL32/alSource.c8
5 files changed, 15 insertions, 15 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 03e1f6ca..43178d66 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -220,8 +220,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALbuffer *ALBuffer;
if((ALBuffer=BufferListItem->buffer) != NULL)
{
- ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtType,
- ALBuffer->FmtChannels);
+ ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtChannels,
+ ALBuffer->FmtType);
maxstep -= ResamplerPadding[ALSource->Resampler] +
ResamplerPrePadding[ALSource->Resampler] + 1;
maxstep = min(maxstep, INT_MAX>>FRACTIONBITS);
@@ -698,8 +698,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALbuffer *ALBuffer;
if((ALBuffer=BufferListItem->buffer) != NULL)
{
- ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtType,
- ALBuffer->FmtChannels);
+ ALint maxstep = STACK_DATA_SIZE / FrameSizeFromFmt(ALBuffer->FmtChannels,
+ ALBuffer->FmtType);
maxstep -= ResamplerPadding[ALSource->Resampler] +
ResamplerPrePadding[ALSource->Resampler] + 1;
maxstep = min(maxstep, INT_MAX>>FRACTIONBITS);
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 020375da..9f19d5df 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -705,7 +705,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
{
FmtChannels = ALBuffer->FmtChannels;
FmtType = ALBuffer->FmtType;
- FrameSize = FrameSizeFromFmt(FmtType, FmtChannels);
+ FrameSize = FrameSizeFromFmt(FmtChannels, FmtType);
break;
}
BufferListItem = BufferListItem->next;
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h
index 0bfd9eff..1007e4d7 100644
--- a/OpenAL32/Include/alBuffer.h
+++ b/OpenAL32/Include/alBuffer.h
@@ -34,10 +34,10 @@ void DecomposeInputFormat(ALenum format, enum SrcFmtChannels *chans,
enum SrcFmtType *type);
ALuint BytesFromSrcFmt(enum SrcFmtType type);
ALuint ChannelsFromSrcFmt(enum SrcFmtChannels chans);
-static __inline ALuint FrameSizeFromSrcFmt(enum SrcFmtType type,
- enum SrcFmtChannels chans)
+static __inline ALuint FrameSizeFromSrcFmt(enum SrcFmtChannels chans,
+ enum SrcFmtType type)
{
- return BytesFromSrcFmt(type) * ChannelsFromSrcFmt(chans);
+ return ChannelsFromSrcFmt(chans) * BytesFromSrcFmt(type);
}
@@ -60,9 +60,9 @@ enum FmtChannels {
void DecomposeFormat(ALenum format, enum FmtChannels *chans, enum FmtType *type);
ALuint BytesFromFmt(enum FmtType type);
ALuint ChannelsFromFmt(enum FmtChannels chans);
-static __inline ALuint FrameSizeFromFmt(enum FmtType type, enum FmtChannels chans)
+static __inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
{
- return BytesFromFmt(type) * ChannelsFromFmt(chans);
+ return ChannelsFromFmt(chans) * BytesFromFmt(type);
}
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 27997e40..b6ded027 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -704,7 +704,7 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* pl
else
{
ALint maxlen = ALBuf->size /
- FrameSizeFromFmt(ALBuf->FmtType, ALBuf->FmtChannels);
+ FrameSizeFromFmt(ALBuf->FmtChannels, ALBuf->FmtType);
if(plValues[0] > maxlen || plValues[1] > maxlen)
alSetError(pContext, AL_INVALID_VALUE);
else
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 1f0594b2..837d6b95 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1953,7 +1953,7 @@ static ALboolean ApplyOffset(ALsource *Source)
// SW Mixer Positions are in Samples
Source->position = (lByteOffset - lTotalBufferSize) /
- FrameSizeFromFmt(Buffer->FmtType, Buffer->FmtChannels);
+ FrameSizeFromFmt(Buffer->FmtChannels, Buffer->FmtType);
return AL_TRUE;
}
@@ -2014,17 +2014,17 @@ static ALint GetByteOffset(ALsource *Source)
}
else
ByteOffset /= FrameSizeFromSrcFmt(Buffer->OriginalChannels, Buffer->OriginalType);
- ByteOffset *= FrameSizeFromFmt(Buffer->FmtType, Buffer->FmtChannels);
+ ByteOffset *= FrameSizeFromFmt(Buffer->FmtChannels, Buffer->FmtType);
break;
case AL_SAMPLE_OFFSET:
- ByteOffset = Source->lOffset * FrameSizeFromFmt(Buffer->FmtType, Buffer->FmtChannels);
+ ByteOffset = Source->lOffset * FrameSizeFromFmt(Buffer->FmtChannels, Buffer->FmtType);
break;
case AL_SEC_OFFSET:
// Note - lOffset is internally stored as Milliseconds
ByteOffset = (ALint)(Source->lOffset / 1000.0 * Buffer->Frequency);
- ByteOffset *= FrameSizeFromFmt(Buffer->FmtType, Buffer->FmtChannels);
+ ByteOffset *= FrameSizeFromFmt(Buffer->FmtChannels, Buffer->FmtType);
break;
}
// Clear Offset