Skip to content
Permalink
Browse files

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

Fixes commit a455297
<cmath> header was already present in commit.
  • Loading branch information...
paramat authored and nerzhul committed Sep 27, 2017
1 parent 43951cf commit 0df3671a3462f020f798e375ca9943a032225733
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/sound_openal.cpp
@@ -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);

0 comments on commit 0df3671

Please sign in to comment.
You can’t perform that action at this time.