Skip to content

Commit

Permalink
Fix recent commit: std::max -> std::fmax for floats (#6469)
Browse files Browse the repository at this point in the history
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 0df3671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sound_openal.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0df3671

Please sign in to comment.