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/alsound.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/alsound.cpp')
-rw-r--r-- | src/sound/oalsound/alsound.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index 83cbeb6..17a46fe 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -386,7 +386,8 @@ bool ALSound::Frequency(int channel, float frequency) return false; } - mChannels[channel]->SetFrequency(frequency); + mChannels[channel]->SetFrequency(frequency * mChannels[channel]->GetInitFrequency()); + mChannels[channel]->SetChangeFrequency(frequency); return true; } @@ -461,11 +462,13 @@ void ALSound::FrameMove(float delta) // setting volume volume = progress * (oper.finalAmplitude - it.second->GetStartAmplitude()); - it.second->SetVolume((volume + it.second->GetStartAmplitude()) * mAudioVolume); + volume = (volume + it.second->GetStartAmplitude()) * mAudioVolume; + it.second->SetVolume(volume); // setting frequency frequency = progress * (oper.finalFrequency - it.second->GetStartFrequency()) * it.second->GetStartFrequency() * it.second->GetChangeFrequency() * it.second->GetInitFrequency(); it.second->AdjustFrequency(frequency); + GetLogger()->Error("%f\n", frequency); if (oper.totalTime <= oper.currentTime) { if (oper.nextOper == SOPER_LOOP) { |