summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-09-02 17:49:49 +0200
committerSergeanur <s.anureev@yandex.ua>2021-09-02 17:49:49 +0200
commita15d5589b360ff95dc42dbeda95910fa1c4b19ae (patch)
treea340bf7e6783dcfd855b906263517b43a44bc3d5 /src/audio/AudioManager.cpp
parentAudio: small refactoring (diff)
downloadre3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar.gz
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar.bz2
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar.lz
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar.xz
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.tar.zst
re3-a15d5589b360ff95dc42dbeda95910fa1c4b19ae.zip
Diffstat (limited to '')
-rw-r--r--src/audio/AudioManager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 12738c75..5d832698 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -723,6 +723,7 @@ cAudioManager::AddReflectionsToRequestedQueue()
{
float reflectionDistance;
int32 noise;
+ uint32 oldCounter = m_sQueueSample.m_nCounter;
uint8 emittingVolume = (m_sQueueSample.m_nVolume >> 1) + (m_sQueueSample.m_nVolume >> 3);
for (uint32 i = 0; i < ARRAY_SIZE(m_afReflectionsDistances); i++) {
@@ -734,7 +735,7 @@ cAudioManager::AddReflectionsToRequestedQueue()
SET_EMITTING_VOLUME(emittingVolume);
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance);
if (m_sQueueSample.m_nVolume > emittingVolume >> 4) {
- m_sQueueSample.m_nCounter += (i + 1) << 8;
+ m_sQueueSample.m_nCounter = oldCounter + ((i + 1) << 8);
if (m_sQueueSample.m_nLoopCount > 0) {
noise = RandomDisplacement(m_sQueueSample.m_nFrequency >> 5);
if (noise > 0)