aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.c
diff options
context:
space:
mode:
authorkcat <[email protected]>2018-05-31 19:38:42 -0700
committerGitHub <[email protected]>2018-05-31 19:38:42 -0700
commitd5dd4937eb72ac44af19d4c12c133afdc06ec958 (patch)
tree9fabf7d077e3113b7d96222e5c5969c8a384921e /Alc/effects/modulator.c
parent0b7f35b28922e2250f06d1aee1ebb60bfecf91d6 (diff)
parent1bba276aaf007c8ef5b5ca495b300f63c8f1c5f7 (diff)
Merge pull request #197 from Raulshc/Modulator
EFX: Modulator fixes
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 7985f03e..b629b584 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -63,17 +63,17 @@ DEFINE_ALEFFECTSTATE_VTABLE(ALmodulatorState);
static inline ALfloat Sin(ALsizei index)
{
- return sinf(index*(F_TAU/WAVEFORM_FRACONE) - F_PI)*0.5f + 0.5f;
+ return sinf(index * (F_TAU / WAVEFORM_FRACONE));
}
static inline ALfloat Saw(ALsizei index)
{
- return (ALfloat)index / WAVEFORM_FRACONE;
+ return index*(2.0f/WAVEFORM_FRACONE) - 1.0f;
}
static inline ALfloat Square(ALsizei index)
{
- return (ALfloat)((index >> (WAVEFORM_FRACBITS - 1)) & 1);
+ return ((index>>(WAVEFORM_FRACBITS-1))&1)*2.0f - 1.0f;
}
#define DECL_TEMPLATE(func) \