summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-10-09 02:32:47 -0700
committerChris Robinson <[email protected]>2008-10-09 02:32:47 -0700
commit87ff8a65e9e34ac26d34045b8bba373b6b2bd870 (patch)
treef2593046ca8f4fcd27158306433bd64ccf052910 /Alc
parent7b6f207790b07c9fa071e7a432229759ada30c2f (diff)
Simplify the lerp function
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 0262ca1c..94b3a9a6 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -641,7 +641,7 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
static __inline ALshort lerp(ALshort val1, ALshort val2, ALint frac)
{
- return (val1*((1<<FRACTIONBITS)-frac) + val2*frac) >> FRACTIONBITS;
+ return val1 + (((val2-val1)*frac)>>FRACTIONBITS);
}
ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum format)