From 2b02a04114c63dbc51a3994abd2b0aa405bfb7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 11 Nov 2015 08:05:52 +0100 Subject: [PATCH] Use C++'s std::abs instead of C's to get floats C's abs() will only work on int values, only std::abs will get floats. --- src/audio/mixer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio/mixer.cpp b/src/audio/mixer.cpp index fa692f1787..d8c4bcfb19 100644 --- a/src/audio/mixer.cpp +++ b/src/audio/mixer.cpp @@ -26,6 +26,7 @@ extern "C" { #include "audio.h" } #include "mixer.h" +#include Mixer gMixer; @@ -393,7 +394,7 @@ void Channel::SetPan(float pan) if (pan < 0) { Channel::pan = 0; } - double decibels = (abs(Channel::pan - 0.5) * 2.0) * 100.0; + double decibels = (std::abs(Channel::pan - 0.5) * 2.0) * 100.0; double attenuation = pow(10, decibels / 20.0); if (Channel::pan <= 0.5) { volume_l = 1.0;