diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-20 15:45:58 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-20 15:45:58 +0300 |
commit | 071dbc3086cb557666bd9f182638b4c315126a6e (patch) | |
tree | 3c8a4e3d8d8231e7435586df8e2c65cb51c18398 | |
parent | 6ad85725d9e56d78f908f882b054d0d2f564b5a6 (diff) | |
parent | 239367663b53a49b60e655e8e406362bf66daa38 (diff) |
Merge branch 'miami' into lcs
-rw-r--r-- | src/audio/AudioManager.cpp | 11 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 6ecb5d70..9068b4dd 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -21,7 +21,7 @@ cAudioManager::cAudioManager() { m_bIsInitialised = FALSE; m_bIsSurround = TRUE; - field_6 = 0; + m_nChannelOffset = 0; m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT; m_nTimeSpent = TIME_SPENT; m_nActiveSamples = NUM_CHANNELS_GENERIC; @@ -991,6 +991,7 @@ cAudioManager::ProcessActiveQueues() CVector position; bool8 missionState; + uint8 channelOffset = 0; for (int32 i = 0; i < m_nActiveSamples; i++) { m_asSamples[m_nActiveSampleQueue][i].m_bIsBeingPlayed = FALSE; @@ -1116,7 +1117,7 @@ cAudioManager::ProcessActiveQueues() #endif { for (uint8 j = 0; j < m_nActiveSamples; j++) { - uint8 k = (j + field_6) % m_nActiveSamples; + uint8 k = (j + m_nChannelOffset) % m_nActiveSamples; if (!m_asActiveSamples[k].m_bIsBeingPlayed) { if (sample.m_nLoopCount > 0) { samplesPerFrame = sample.m_nFrequency / m_nTimeSpent; @@ -1195,6 +1196,7 @@ cAudioManager::ProcessActiveQueues() SampleManager.StartChannel(k); } m_asActiveSamples[k].m_bIsBeingPlayed = TRUE; + channelOffset++; sample.m_bIsBeingPlayed = TRUE; sample.m_nVolumeChange = -1; break; @@ -1203,7 +1205,10 @@ cAudioManager::ProcessActiveQueues() } } } - field_6 %= m_nActiveSamples; +#ifdef GTA_PS2 + m_nChannelOffset += channelOffset; +#endif + m_nChannelOffset %= m_nActiveSamples; } void diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index a3e351dd..eeb2581c 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -240,7 +240,7 @@ public: uint8 m_nActiveSamples; bool8 m_bDoubleVolume; // unused bool8 m_bDynamicAcousticModelingStatus; - int8 field_6; + uint8 m_nChannelOffset; float m_fSpeedOfSound; bool8 m_bTimerJustReset; int32 m_nTimer; |