summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audio/AudioManager.cpp11
-rw-r--r--src/audio/AudioManager.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index 9fd43930..614511f3 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;
@@ -981,6 +981,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;
@@ -1106,7 +1107,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;
@@ -1185,6 +1186,7 @@ cAudioManager::ProcessActiveQueues()
SampleManager.StartChannel(k);
}
m_asActiveSamples[k].m_bIsBeingPlayed = TRUE;
+ channelOffset++;
sample.m_bIsBeingPlayed = TRUE;
sample.m_nVolumeChange = -1;
break;
@@ -1193,7 +1195,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 de47f3f9..6580fb12 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;