summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-10-02 02:55:26 +0200
committerRoman Masanin <36927roma@gmail.com>2020-10-02 02:55:26 +0200
commit63e5faef1155af66af12e6bff3a087c0200abc14 (patch)
treeee62e706ac42ab731a190ec085c0ae401af8b5d4 /src/audio/AudioManager.cpp
parentfinal processActiveQueues (diff)
downloadre3-63e5faef1155af66af12e6bff3a087c0200abc14.tar
re3-63e5faef1155af66af12e6bff3a087c0200abc14.tar.gz
re3-63e5faef1155af66af12e6bff3a087c0200abc14.tar.bz2
re3-63e5faef1155af66af12e6bff3a087c0200abc14.tar.lz
re3-63e5faef1155af66af12e6bff3a087c0200abc14.tar.xz
re3-63e5faef1155af66af12e6bff3a087c0200abc14.tar.zst
re3-63e5faef1155af66af12e6bff3a087c0200abc14.zip
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 1da80352..c0827040 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -510,7 +510,7 @@ cAudioManager::ComputePan(float dist, CVector *vec)
return Min(107, PanTable[index] + 63);
}
-int32
+uint32
cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, float speedMultiplier) const
{
uint32 newFreq = oldFreq;
@@ -519,11 +519,7 @@ cAudioManager::ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1,
if (dist != 0.0f) {
float speedOfSource = (dist / m_nTimeSpent) * speedMultiplier;
if (m_fSpeedOfSound > Abs(speedOfSource)) {
- if (speedOfSource < 0.0f) {
- speedOfSource = Max(speedOfSource, -1.5f);
- } else {
- speedOfSource = Min(speedOfSource, 1.5f);
- }
+ speedOfSource = clamp2(speedOfSource, 0.0f, 1.5f);
newFreq = (oldFreq * m_fSpeedOfSound) / (speedOfSource + m_fSpeedOfSound);
}
}
@@ -952,7 +948,7 @@ cAudioManager::ClearRequestedQueue()
void
cAudioManager::ClearActiveSamples()
{
- for (int32 i = 0; i < m_nActiveSamples; i++) {
+ for (uint8 i = 0; i < m_nActiveSamples; i++) {
m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE;
m_asActiveSamples[i].m_nCounter = 0;
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;