diff options
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r-- | src/audio/AudioManager.cpp | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 8921ff7b..c339ea43 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -15,7 +15,7 @@ cAudioManager AudioManager; #define SPEED_OF_SOUND 343.f -#define TIME_SPENT 40 +#define TIME_SPENT 30 cAudioManager::cAudioManager() { @@ -337,6 +337,8 @@ cAudioManager::ResetTimers(uint32 time) ClearMissionAudio(0); ClearMissionAudio(1); SampleManager.StopChannel(CHANNEL_POLICE_RADIO); + SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_1); + SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_2); SampleManager.SetEffectsFadeVolume(0); SampleManager.SetMusicFadeVolume(0); MusicManager.ResetMusicAfterReload(); @@ -532,27 +534,17 @@ cAudioManager::ServiceSoundEffects() #endif m_bReduceReleasingPriority = (m_FrameCounter++ % 5) == 0; if (m_bIsPaused && !m_bWasPaused) { -#ifdef GTA_PS2 - if (m_bIsSurround) { - for (uint32 i = 0; i < NUM_CHANNELS_DTS_GENERIC; i++) - SampleManager.StopChannel(i); - - SampleManager.SetChannelFrequency(CHANNEL_DTS_POLICE_RADIO, 0); - SampleManager.SetChannelFrequency(CHANNEL_DTS_MISSION_AUDIO_1, 0); - SampleManager.SetChannelFrequency(CHANNEL_DTS_MISSION_AUDIO_2, 0); - SampleManager.SetChannelFrequency(CHANNEL_DTS_PLAYER_VEHICLE_ENGINE, 0); - } else { - for (uint32 i = 0; i < NUM_CHANNELS_GENERIC; i++) - SampleManager.StopChannel(i); - - SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0); - SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0); - SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0); - SampleManager.SetChannelFrequency(CHANNEL_PLAYER_VEHICLE_ENGINE, 0); - } -#else - for (uint32 i = 0; i < NUM_CHANNELS; i++) + for (uint32 i = 0; i < NUM_CHANNELS_GENERIC; i++) SampleManager.StopChannel(i); + SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0); + SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0); + SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0); + SampleManager.StopChannel(CHANNEL_PLAYER_VEHICLE_ENGINE); +#if defined(GTA_PS2) || defined(GTA_PSP) + // PSP and PS2 just stop the sound, mobile doesn't. Let's not have it on PC either + uint8 missionAudioChannel = m_bIsSurround ? CHANNEL_DTS_MISSION_AUDIO_1 : CHANNEL_MISSION_AUDIO_1; + SampleManager.StopChannel(missionAudioChannel); + SampleManager.StopChannel(missionAudioChannel+1); #endif ClearRequestedQueue(); if (m_nActiveQueue) { @@ -573,11 +565,14 @@ cAudioManager::ServiceSoundEffects() ProcessSpecial(); ClearRequestedQueue(); InterrogateAudioEntities(); - m_sPedComments.Process(); - ServicePoliceRadio(); - ServiceCollisions(); + if (!m_bIsPaused) { + m_sPedComments.Process(); + //ServicePoliceRadio(); // LCS: removed + ServiceCollisions(); + } AddReleasingSounds(); - ProcessMissionAudio(); + if (!m_bIsPaused) + ProcessMissionAudio(); #ifdef EXTERNAL_3D_SOUND AdjustSamplesVolume(); #endif @@ -788,15 +783,15 @@ cAudioManager::AddReflectionsToRequestedQueue() for (uint32 i = 0; i < ARRAY_SIZE(m_afReflectionsDistances); i++) { #ifndef USE_TIME_SCALE_FOR_AUDIO if ( CTimer::GetIsSlowMotionActive() ) - m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 100.f / 8.f; + m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 50.f / 8.f; #endif reflectionDistance = m_afReflectionsDistances[i]; if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_MaxDistance) { #ifndef USE_TIME_SCALE_FOR_AUDIO - m_sQueueSample.m_nReflectionDelay = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 800.f / 1029.f) : (reflectionDistance * 500.f / 1029.f); + m_sQueueSample.m_nReflectionDelay = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 600.f / 1029.f) : (reflectionDistance * 300.f / 1029.f); #else - m_sQueueSample.m_nReflectionDelay = reflectionDistance * 500.f / 1029.f; + m_sQueueSample.m_nReflectionDelay = reflectionDistance * 300.f / 1029.f; #endif if (m_sQueueSample.m_nReflectionDelay > 3) { m_sQueueSample.m_fDistance = m_afReflectionsDistances[i]; |