summaryrefslogtreecommitdiffstats
path: root/src/sound/oalsound/channel.cpp
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2013-03-30 16:03:25 +0100
committererihel <erihel@gmail.com>2013-03-30 16:03:25 +0100
commitb7b5f002a636154033166a2c828765386c14e5a5 (patch)
tree46950e3f29d20272a9d6344253f5cdf2f29da3b1 /src/sound/oalsound/channel.cpp
parent3569adb10377d83beeb705870f015cc1f40aeffc (diff)
downloadcolobot-b7b5f002a636154033166a2c828765386c14e5a5.tar.gz
colobot-b7b5f002a636154033166a2c828765386c14e5a5.tar.bz2
colobot-b7b5f002a636154033166a2c828765386c14e5a5.zip
* Removed warning while compiling brain.cpp
* Fix for issue #130 * Fix for issue #128 with wrong sound pitch
Diffstat (limited to 'src/sound/oalsound/channel.cpp')
-rw-r--r--src/sound/oalsound/channel.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 19394c6..f5967ab 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -17,8 +17,6 @@
#include "channel.h"
-#define MIN(a, b) (a > b ? b : a)
-
Channel::Channel() {
alGenSources(1, &mSource);
@@ -89,15 +87,6 @@ bool Channel::SetFrequency(float freq)
}
-bool Channel::AdjustFrequency(float freq)
-{
- if (!mReady || mBuffer == nullptr)
- return false;
-
- return SetFrequency(mInitFrequency + fabs(freq));
-}
-
-
float Channel::GetFrequency()
{
ALfloat freq;
@@ -119,7 +108,7 @@ bool Channel::SetVolume(float vol)
if (!mReady || vol < 0 || mBuffer == nullptr)
return false;
- alSourcef(mSource, AL_GAIN, MIN(powf(vol, 0.2f), 1.0f));
+ alSourcef(mSource, AL_GAIN, vol);
if (alCheck()) {
GetLogger()->Warn("Could not set sound volume to '%f'. Code: %d\n", vol, alGetCode());
return false;