Skip to content

Commit 0df3671

Browse files
paramatnerzhul
authored andcommittedSep 27, 2017
Fix recent commit: std::max -> std::fmax for floats (#6469)
Fixes commit a455297 <cmath> header was already present in commit.
1 parent 43951cf commit 0df3671

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/sound_openal.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class OpenALSoundManager: public ISoundManager
406406
alSource3f(sound->source_id, AL_POSITION, 0, 0, 0);
407407
alSource3f(sound->source_id, AL_VELOCITY, 0, 0, 0);
408408
alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE);
409-
volume = std::max(0.0f, volume);
409+
volume = std::fmax(0.0f, volume);
410410
alSourcef(sound->source_id, AL_GAIN, volume);
411411
alSourcef(sound->source_id, AL_PITCH, pitch);
412412
alSourcePlay(sound->source_id);
@@ -435,7 +435,7 @@ class OpenALSoundManager: public ISoundManager
435435
alSourcei(sound->source_id, AL_LOOPING, loop ? AL_TRUE : AL_FALSE);
436436
// Multiply by 3 to compensate for reducing AL_REFERENCE_DISTANCE from
437437
// the previous value of 30 to the new value of 10
438-
volume = std::max(0.0f, volume * 3.0f);
438+
volume = std::fmax(0.0f, volume * 3.0f);
439439
alSourcef(sound->source_id, AL_GAIN, volume);
440440
alSourcef(sound->source_id, AL_PITCH, pitch);
441441
alSourcePlay(sound->source_id);

0 commit comments

Comments
 (0)
Please sign in to comment.