aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-05-31 19:43:02 -0700
committerChris Robinson <[email protected]>2018-05-31 19:43:02 -0700
commitf76509950308df52bd29a988a109e9cb0e53e3ec (patch)
treeac43932f348ff51d998d3f8cd859d9b92a17fec6 /Alc
parentd5dd4937eb72ac44af19d4c12c133afdc06ec958 (diff)
Slightly simplify the modulator square wave generator
Diffstat (limited to 'Alc')
-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 b629b584..f743a2b2 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));
+ return sinf((ALfloat)index * (F_TAU / WAVEFORM_FRACONE));
}
static inline ALfloat Saw(ALsizei index)
{
- return index*(2.0f/WAVEFORM_FRACONE) - 1.0f;
+ return (ALfloat)index*(2.0f/WAVEFORM_FRACONE) - 1.0f;
}
static inline ALfloat Square(ALsizei index)
{
- return ((index>>(WAVEFORM_FRACBITS-1))&1)*2.0f - 1.0f;
+ return (ALfloat)(((index>>(WAVEFORM_FRACBITS-2))&2) - 1);
}
#define DECL_TEMPLATE(func) \