diff options
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r-- | src/audio/AudioManager.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 8d9d867d..1f758dd2 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -13,10 +13,6 @@ cAudioManager AudioManager; -const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples); -const int policeChannel = channels + 1; -const int allChannels = channels + 2; - #define SPEED_OF_SOUND 343.f #define TIME_SPENT 50 @@ -26,7 +22,7 @@ cAudioManager::cAudioManager() m_bReverb = TRUE; m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT; m_nTimeSpent = TIME_SPENT; - m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS; + m_nActiveSamples = NUM_CHANNELS_GENERIC; m_nActiveSampleQueue = 1; ClearRequestedQueue(); m_nActiveSampleQueue = 0; @@ -267,7 +263,7 @@ cAudioManager::ResetTimers(uint32 time) } ClearActiveSamples(); ClearMissionAudio(); - SampleManager.StopChannel(policeChannel); + SampleManager.StopChannel(CHANNEL_POLICE_RADIO); SampleManager.SetEffectsFadeVolume(0); SampleManager.SetMusicFadeVolume(0); MusicManager.ResetMusicAfterReload(); @@ -429,7 +425,7 @@ cAudioManager::ServiceSoundEffects() { m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0; if (m_nUserPause && !m_nPreviousUserPause) { - for (int32 i = 0; i < allChannels; i++) + for (int32 i = 0; i < NUM_CHANNELS; i++) SampleManager.StopChannel(i); ClearRequestedQueue(); @@ -692,7 +688,12 @@ cAudioManager::UpdateReflections() void cAudioManager::AddReleasingSounds() { - bool8 toProcess[44]; // why not 27? because PS2? + // in case someone would want to increase it +#ifdef FIX_BUGS + bool8 toProcess[NUM_CHANNELS_GENERIC]; +#else + bool8 toProcess[44]; +#endif int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0; |