]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix recent commit: std::max -> std::fmax for floats (#6469)
authorParamat <paramat@users.noreply.github.com>
Wed, 27 Sep 2017 21:03:41 +0000 (22:03 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Wed, 27 Sep 2017 21:03:41 +0000 (23:03 +0200)
Fixes commit a455297d297c0819a7eff89e51e5f01a5ac731c3
<cmath> header was already present in commit.

src/sound_openal.cpp

index 1f21f24abb960f8fd9d2f5046f0aebf6e631517f..b33a85703f340255e1c61ef9110c5e50f3e78410 100644 (file)
@@ -406,7 +406,7 @@ class OpenALSoundManager: public ISoundManager
                alSource3f(sound->source_id, AL_POSITION, 0, 0, 0);
                alSource3f(sound->source_id, AL_VELOCITY, 0, 0, 0);
                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_PITCH, pitch);
                alSourcePlay(sound->source_id);
@@ -435,7 +435,7 @@ class OpenALSoundManager: public ISoundManager
                alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE);
                // Multiply by 3 to compensate for reducing AL_REFERENCE_DISTANCE from
                // 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_PITCH, pitch);
                alSourcePlay(sound->source_id);