Correct fmod usage
This commit is contained in:
parent
75f585a727
commit
078da6ccf7
1 changed files with 2 additions and 2 deletions
|
@ -169,7 +169,7 @@ void SOUNDBUFFER::Mix(float *buffer, size_t frames)
|
||||||
const float sample2 = ((looping || (((size_t)samplePosition) + 1) < size) ? data[(((size_t)samplePosition) + 1) % size] : 128.0f);
|
const float sample2 = ((looping || (((size_t)samplePosition) + 1) < size) ? data[(((size_t)samplePosition) + 1) % size] : 128.0f);
|
||||||
|
|
||||||
//Interpolate sample
|
//Interpolate sample
|
||||||
const float subPos = (float)std::fmod(samplePosition, 1.0);
|
const float subPos = (float)fmod(samplePosition, 1.0);
|
||||||
const float sampleA = sample1 + (sample2 - sample1) * subPos;
|
const float sampleA = sample1 + (sample2 - sample1) * subPos;
|
||||||
|
|
||||||
//Convert sample to float32
|
//Convert sample to float32
|
||||||
|
@ -186,7 +186,7 @@ void SOUNDBUFFER::Mix(float *buffer, size_t frames)
|
||||||
{
|
{
|
||||||
if (looping)
|
if (looping)
|
||||||
{
|
{
|
||||||
samplePosition = std::fmod(samplePosition, size);
|
samplePosition = fmod(samplePosition, size);
|
||||||
looped = true;
|
looped = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue