summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2017-09-27 22:03:41 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-09-27 23:03:41 +0200
commit0df3671a3462f020f798e375ca9943a032225733 (patch)
tree77a21a1bb375a233a2bda57c4859a81af9cfbe43 /src
parent43951cf6460008a01014fa4ee256b6ddcdc842a6 (diff)
downloadminetest-0df3671a3462f020f798e375ca9943a032225733.tar.gz
minetest-0df3671a3462f020f798e375ca9943a032225733.tar.bz2
minetest-0df3671a3462f020f798e375ca9943a032225733.zip
Fix recent commit: std::max -> std::fmax for floats (#6469)
Fixes commit a455297d297c0819a7eff89e51e5f01a5ac731c3 <cmath> header was already present in commit.
Diffstat (limited to 'src')
-rw-r--r--src/sound_openal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp
index 1f21f24ab..b33a85703 100644
--- a/src/sound_openal.cpp
+++ b/src/sound_openal.cpp
@@ -406,7 +406,7 @@ public:
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 @@ public:
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);