Rename a variable
This commit is contained in:
parent
47543eb382
commit
b68eb076ca
1 changed files with 5 additions and 5 deletions
|
@ -174,7 +174,7 @@ ATTRIBUTE_HOT void Mixer_MixSounds(long *stream, size_t frames_total)
|
||||||
{
|
{
|
||||||
#ifdef LANCZOS_RESAMPLER
|
#ifdef LANCZOS_RESAMPLER
|
||||||
// Perform Lanczos resampling
|
// Perform Lanczos resampling
|
||||||
float accumulator = 0;
|
float output_sample = 0;
|
||||||
|
|
||||||
for (int i = -LANCZOS_KERNEL_RADIUS + 1; i <= LANCZOS_KERNEL_RADIUS; ++i)
|
for (int i = -LANCZOS_KERNEL_RADIUS + 1; i <= LANCZOS_KERNEL_RADIUS; ++i)
|
||||||
{
|
{
|
||||||
|
@ -184,20 +184,20 @@ ATTRIBUTE_HOT void Mixer_MixSounds(long *stream, size_t frames_total)
|
||||||
|
|
||||||
if (kernel_input == 0.0f)
|
if (kernel_input == 0.0f)
|
||||||
{
|
{
|
||||||
accumulator += input_sample;
|
output_sample += input_sample;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const float nx = 3.14159265358979323846f * kernel_input;
|
const float nx = 3.14159265358979323846f * kernel_input;
|
||||||
const float nxa = nx / LANCZOS_KERNEL_RADIUS;
|
const float nxa = nx / LANCZOS_KERNEL_RADIUS;
|
||||||
|
|
||||||
accumulator += input_sample * (sin(nx) * sin(nxa) / (nx * nxa));
|
output_sample += input_sample * (sin(nx) * sin(nxa) / (nx * nxa));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mix, and apply volume
|
// Mix, and apply volume
|
||||||
*stream_pointer++ += (short)(accumulator * sound->volume_l);
|
*stream_pointer++ += (short)(output_sample * sound->volume_l);
|
||||||
*stream_pointer++ += (short)(accumulator * sound->volume_r);
|
*stream_pointer++ += (short)(output_sample * sound->volume_r);
|
||||||
#else
|
#else
|
||||||
// Perform linear interpolation
|
// Perform linear interpolation
|
||||||
const unsigned char interpolation_scale = sound->position_subsample >> 8;
|
const unsigned char interpolation_scale = sound->position_subsample >> 8;
|
||||||
|
|
Loading…
Add table
Reference in a new issue