diff options
author | erihel <erihel@gmail.com> | 2013-02-24 18:04:38 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2013-02-24 18:04:38 +0100 |
commit | 3a594dc3a814cff4ae4db02985f4b1ce643a0604 (patch) | |
tree | 2162a2be423fc6397beb3a82d595079220e10fe4 /src/sound/oalsound/channel.cpp | |
parent | ba2df2cb4201597c9dc01365641413dcbf6812d9 (diff) | |
download | colobot-3a594dc3a814cff4ae4db02985f4b1ce643a0604.tar.gz colobot-3a594dc3a814cff4ae4db02985f4b1ce643a0604.tar.bz2 colobot-3a594dc3a814cff4ae4db02985f4b1ce643a0604.zip |
* Changed AdjustFrequency formula
* Changed SetVolume to match orginal game formula
Diffstat (limited to 'src/sound/oalsound/channel.cpp')
-rw-r--r-- | src/sound/oalsound/channel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp index 3c8bc50..0faecd0 100644 --- a/src/sound/oalsound/channel.cpp +++ b/src/sound/oalsound/channel.cpp @@ -94,7 +94,7 @@ bool Channel::AdjustFrequency(float freq) if (!mReady || mBuffer == nullptr) return false; - return SetFrequency(mInitFrequency - freq); + return SetFrequency(mInitFrequency + freq); } @@ -119,7 +119,7 @@ bool Channel::SetVolume(float vol) if (!mReady || vol < 0 || mBuffer == nullptr) return false; - alSourcef(mSource, AL_GAIN, MIN(vol, 1.0f)); + alSourcef(mSource, AL_GAIN, MIN(powf(vol, 0.2f), 1.0f)); if (alCheck()) { GetLogger()->Warn("Could not set sound volume to '%f'. Code: %d\n", vol, alGetCode()); return false; |