diff options
author | Chris Robinson <[email protected]> | 2017-05-02 04:54:59 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-05-02 04:54:59 -0700 |
commit | 53c3d48fe0714f3b7a6cf4d12b28ed611277224d (patch) | |
tree | c9df100395d61ff1fe3280e08f8a1274c22d0aeb /Alc/effects/modulator.c | |
parent | 1e5334176eb2bd9bae367218570a5fd24597f827 (diff) |
Change some ALuint parameters to ALsizei
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r-- | Alc/effects/modulator.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index 6d096048..e9026a62 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -33,10 +33,10 @@ typedef struct ALmodulatorState { DERIVE_FROM_TYPE(ALeffectState); - void (*Process)(ALfloat*, const ALfloat*, ALuint, const ALuint, ALuint); + void (*Process)(ALfloat*, const ALfloat*, ALsizei, const ALsizei, ALsizei); - ALuint index; - ALuint step; + ALsizei index; + ALsizei step; ALfloat Gain[MAX_EFFECT_CHANNELS][MAX_OUTPUT_CHANNELS]; @@ -46,7 +46,7 @@ typedef struct ALmodulatorState { static ALvoid ALmodulatorState_Destruct(ALmodulatorState *state); static ALboolean ALmodulatorState_deviceUpdate(ALmodulatorState *state, ALCdevice *device); static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice *Device, const ALeffectslot *Slot, const ALeffectProps *props); -static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALuint SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels); +static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels); DECLARE_DEFAULT_ALLOCATORS(ALmodulatorState) DEFINE_ALEFFECTSTATE_VTABLE(ALmodulatorState); @@ -56,26 +56,26 @@ DEFINE_ALEFFECTSTATE_VTABLE(ALmodulatorState); #define WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS) #define WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1) -static inline ALfloat Sin(ALuint index) +static inline ALfloat Sin(ALsizei index) { return sinf(index*(F_TAU/WAVEFORM_FRACONE) - F_PI)*0.5f + 0.5f; } -static inline ALfloat Saw(ALuint index) +static inline ALfloat Saw(ALsizei index) { return (ALfloat)index / WAVEFORM_FRACONE; } -static inline ALfloat Square(ALuint index) +static inline ALfloat Square(ALsizei index) { return (ALfloat)((index >> (WAVEFORM_FRACBITS - 1)) & 1); } #define DECL_TEMPLATE(func) \ static void Modulate##func(ALfloat *restrict dst, const ALfloat *restrict src,\ - ALuint index, const ALuint step, ALuint todo) \ + ALsizei index, const ALsizei step, ALsizei todo) \ { \ - ALuint i; \ + ALsizei i; \ for(i = 0;i < todo;i++) \ { \ index += step; \ @@ -118,7 +118,7 @@ static ALboolean ALmodulatorState_deviceUpdate(ALmodulatorState *UNUSED(state), static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice *Device, const ALeffectslot *Slot, const ALeffectProps *props) { ALfloat cw, a; - ALuint i; + ALsizei i; if(props->Modulator.Waveform == AL_RING_MODULATOR_SINUSOID) state->Process = ModulateSin; @@ -151,17 +151,17 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice * Slot->Params.Gain, state->Gain[i]); } -static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALuint SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels) +static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) { - const ALuint step = state->step; - ALuint index = state->index; - ALuint base; + const ALsizei step = state->step; + ALsizei index = state->index; + ALsizei base; for(base = 0;base < SamplesToDo;) { ALfloat temps[2][128]; - ALuint td = minu(128, SamplesToDo-base); - ALuint i, j, k; + ALsizei td = mini(128, SamplesToDo-base); + ALsizei i, j, k; for(j = 0;j < MAX_EFFECT_CHANNELS;j++) { |