Change double to float
A quick test with godbolt shows this produces smaller (and presumably faster) code.
This commit is contained in:
parent
545948584a
commit
ba9ccec945
1 changed files with 1 additions and 1 deletions
|
@ -151,7 +151,7 @@ ATTRIBUTE_HOT void Mixer_MixSounds(float *stream, unsigned int frames_total)
|
||||||
for (unsigned int frames_done = 0; frames_done < frames_total; ++frames_done)
|
for (unsigned int frames_done = 0; frames_done < frames_total; ++frames_done)
|
||||||
{
|
{
|
||||||
const size_t position_integral = (size_t)sound->position;
|
const size_t position_integral = (size_t)sound->position;
|
||||||
const double position_fractional = sound->position - position_integral;
|
const float position_fractional = sound->position - position_integral;
|
||||||
|
|
||||||
// Get two samples, and normalise them to 0-1
|
// Get two samples, and normalise them to 0-1
|
||||||
const float sample1 = (sound->samples[position_integral] - 128.0f) / 128.0f;
|
const float sample1 = (sound->samples[position_integral] - 128.0f) / 128.0f;
|
||||||
|
|
Loading…
Add table
Reference in a new issue