1
0
Fork 0

Fix recent commit: std::max -> std::fmax for floats (#6469)

Fixes commit a455297d29
<cmath> header was already present in commit.
mutilcraft-mt53
Paramat 2017-09-27 22:03:41 +01:00 committed by Loïc Blot
parent 43951cf646
commit 0df3671a34
1 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ public:
alSource3f(sound->source_id, AL_POSITION, 0, 0, 0); alSource3f(sound->source_id, AL_POSITION, 0, 0, 0);
alSource3f(sound->source_id, AL_VELOCITY, 0, 0, 0); alSource3f(sound->source_id, AL_VELOCITY, 0, 0, 0);
alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE); alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE);
volume = std::max(0.0f, volume); volume = std::fmax(0.0f, volume);
alSourcef(sound->source_id, AL_GAIN, volume); alSourcef(sound->source_id, AL_GAIN, volume);
alSourcef(sound->source_id, AL_PITCH, pitch); alSourcef(sound->source_id, AL_PITCH, pitch);
alSourcePlay(sound->source_id); alSourcePlay(sound->source_id);
@ -435,7 +435,7 @@ public:
alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE); alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE);
// Multiply by 3 to compensate for reducing AL_REFERENCE_DISTANCE from // Multiply by 3 to compensate for reducing AL_REFERENCE_DISTANCE from
// the previous value of 30 to the new value of 10 // the previous value of 30 to the new value of 10
volume = std::max(0.0f, volume * 3.0f); volume = std::fmax(0.0f, volume * 3.0f);
alSourcef(sound->source_id, AL_GAIN, volume); alSourcef(sound->source_id, AL_GAIN, volume);
alSourcef(sound->source_id, AL_PITCH, pitch); alSourcef(sound->source_id, AL_PITCH, pitch);
alSourcePlay(sound->source_id); alSourcePlay(sound->source_id);