diff options
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioCollision.cpp | 14 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 1029 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 194 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 70 | ||||
-rw-r--r-- | src/audio/PolRadio.cpp | 8 | ||||
-rw-r--r-- | src/vehicles/Boat.cpp | 2 |
6 files changed, 670 insertions, 647 deletions
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp index 5289cc16..147db001 100644 --- a/src/audio/AudioCollision.cpp +++ b/src/audio/AudioCollision.cpp @@ -263,13 +263,13 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col) m_sQueueSample.m_vecPos = col.m_vecPosition; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 11; + m_sQueueSample.m_nPriority = 11; m_sQueueSample.m_nLoopCount = 1; SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_MaxDistance = CollisionSoundIntensity; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -292,14 +292,14 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun m_sQueueSample.m_vecPos = col.m_vecPosition; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = CollisionSoundIntensity; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index c61ec38d..c7605126 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -44,6 +44,9 @@ #include "Wanted.h" #include "KeyGen.h" +// TODO: Get rid of *intensity* consts (and get rid of term 'intensity' in general) +// Make them defines, not floats because they were not floats on PS2 + #ifndef GTA_PS2 #define CHANNEL_PLAYER_VEHICLE_ENGINE m_nActiveSamples #endif @@ -260,7 +263,7 @@ cAudioManager::ProcessReverb() if (SampleManager.UpdateReverb() && m_bDynamicAcousticModelingStatus) { #ifndef GTA_PS2 for (uint32 i = 0; i < numChannels; i++) { - if (m_asActiveSamples[i].m_bReverbFlag) + if (m_asActiveSamples[i].m_bReverb) SampleManager.SetChannelReverbFlag(i, TRUE); } #endif @@ -921,14 +924,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); } m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -972,14 +975,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000 + freq; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = 140.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -997,14 +1000,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) freqFrontPrev = m_sQueueSample.m_nFrequency; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = 140.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1013,14 +1016,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = 140.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1057,14 +1060,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freq; } m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 140.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = 140.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1090,14 +1093,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nCounter = 12; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 30; + m_sQueueSample.m_MaxDistance = 30.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 30; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1125,14 +1128,14 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 12; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(propellerSpeed * 100.0f); SET_LOOP_OFFSETS(SFX_SEAPLANE_PRO4) m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_SoundIntensity = 20.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_MaxDistance = 20.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 7; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1155,15 +1158,15 @@ cAudioManager::ProcessCarHeli(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = hunterBool ? SFX_HELI_APACHE_3 : SFX_CAR_HELI_REA; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = (volumeModifier + 1.0f) * 16000; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(volumeModifier * 25.0f); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 27.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = 27.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1201,14 +1204,14 @@ cAudioManager::ProcessRainOnVehicle(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = (m_anRandomTable[1] & 3) + SFX_CAR_RAIN_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 9; + m_sQueueSample.m_nPriority = 9; m_sQueueSample.m_nFrequency = m_anRandomTable[1] % 4000 + 28000; m_sQueueSample.m_nLoopCount = 1; SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(FALSE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1253,15 +1256,15 @@ cAudioManager::ProcessReverseGear(cVehicleParams& params) } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nFrequency = (6000.0f * modificator) + 7000; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = reverseGearIntensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = reverseGearIntensity; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1310,15 +1313,15 @@ cAudioManager::ProcessModelHeliVehicle(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_CAR_RC_HELI; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(70); SET_LOOP_OFFSETS(SFX_CAR_RC_HELI) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1373,15 +1376,15 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_RC_REV; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(SFX_RC_REV) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1429,22 +1432,22 @@ cAudioManager::ProcessModelVehicle(cVehicleParams& params) if (vehSlowdown) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nSampleIndex = SFX_RC_IDLE; - m_sQueueSample.m_nReleasingVolumeDivider = 6; + m_sQueueSample.m_nFramesToPlay = 6; } else { m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nSampleIndex = SFX_RC_REV; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_nFramesToPlay = 4; } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1505,16 +1508,16 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams& params) m_sQueueSample.m_nCounter = 95; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_nSampleIndex = SFX_TYRE_BURST_L; m_sQueueSample.m_nFrequency = (5500.0f * modifier) + 8000; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(SFX_TYRE_BURST_L) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1559,7 +1562,7 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; if (params.m_pVehicle->m_nSurfaceTouched == SURFACE_WATER) { m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; freq = 6050 * emittingVol / 30 + 16000; @@ -1574,9 +1577,9 @@ cAudioManager::ProcessVehicleRoadNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1625,7 +1628,7 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_ROAD_NOISE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; multiplier = (m_sQueueSample.m_fDistance / SOUND_INTENSITY) * 0.5f; freq = SampleManager.GetSampleBaseFrequency(SFX_ROAD_NOISE); m_sQueueSample.m_nFrequency = freq + freq * multiplier; @@ -1633,9 +1636,9 @@ cAudioManager::ProcessWetRoadNoise(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1848,16 +1851,16 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams& params) } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; if (m_sQueueSample.m_nSampleIndex == SFX_CAR_IDLE_TRUCK || m_sQueueSample.m_nSampleIndex == SFX_CAR_REV_TRUCK) m_sQueueSample.m_nFrequency /= 2; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 8; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1911,19 +1914,19 @@ cAudioManager::AddPlayerCarSample(uint8 emittingVolume, uint32 freq, uint32 samp m_sQueueSample.m_nBankIndex = SFX_BANK_0; #endif // GTA_PS2 m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nFrequency = freq; if (notLooping) { m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_nFramesToPlay = 8; } else { m_sQueueSample.m_nLoopCount = 1; } SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 6.0f; - m_sQueueSample.m_SoundIntensity = 50.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_MaxDistance = 50.0f; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1941,15 +1944,15 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nFrequency = 12500; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_nFramesToPlay = 8; SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = 200.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_MaxDistance = 200.0f; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -1961,15 +1964,15 @@ cAudioManager::ProcessCesna(cVehicleParams ¶ms) m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nFrequency = 25000; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_nFramesToPlay = 4; SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = 90.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_MaxDistance = 90.0f; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2290,7 +2293,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh } else { TranslateEntity(&m_sQueueSample.m_vecPos, &pos); #ifndef EXTERNAL_3D_SOUND - m_sQueueSample.m_nOffset = ComputePan(m_sQueueSample.m_fDistance, &pos); + m_sQueueSample.m_nPan = ComputePan(m_sQueueSample.m_fDistance, &pos); #endif if (bAccelSampleStopped) { if (CurrentPretendGear != 1 || currentGear != 2) @@ -2326,7 +2329,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.0f, 50.0f * 0.25f); #else SampleManager.SetChannelVolume(nChannel, ComputeVolume(120, 50.0f, m_sQueueSample.m_fDistance)); - SampleManager.SetChannelPan(nChannel, m_sQueueSample.m_nOffset); + SampleManager.SetChannelPan(nChannel, m_sQueueSample.m_nPan); #endif freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; if (engineSoundType == SFX_BANK_TRUCK) @@ -2469,14 +2472,14 @@ cAudioManager::ProcessVehicleSkidding(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 8; + m_sQueueSample.m_nPriority = 8; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2570,7 +2573,7 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = aVehicleSettings[params.m_nIndex].m_nHornSample; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_nFrequency = aVehicleSettings[params.m_nIndex].m_nHornFrequency; m_sQueueSample.m_nLoopCount = 0; #ifdef FIX_BUGS @@ -2580,9 +2583,9 @@ cAudioManager::ProcessVehicleHorn(cVehicleParams& params) #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2656,14 +2659,14 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams& params) } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(volume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 7.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2697,7 +2700,7 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_REVERSE_WARNING; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_nFrequency = (100 * m_sQueueSample.m_nEntityIndex & 1023) + SampleManager.GetSampleBaseFrequency(SFX_REVERSE_WARNING); m_sQueueSample.m_nLoopCount = 0; #ifdef FIX_BUGS @@ -2707,9 +2710,9 @@ cAudioManager::ProcessVehicleReverseWarning(cVehicleParams& params) #endif SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2747,13 +2750,13 @@ cAudioManager::ProcessVehicleDoors(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) + RandomDisplacement(1000); m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; m_sQueueSample.m_nLoopCount = 1; SET_EMITTING_VOLUME(emittingVol); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 1.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(TRUE); AddSampleToRequestedQueue(); @@ -2792,13 +2795,13 @@ cAudioManager::ProcessAirBrakes(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; m_sQueueSample.m_nLoopCount = 1; SET_EMITTING_VOLUME(volume); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2833,12 +2836,12 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params) if (health < 250.0f) { emittingVolume = 60; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); } else { emittingVolume = 30; m_sQueueSample.m_nSampleIndex = SFX_PALM_TREE_LO; - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; m_sQueueSample.m_nFrequency = 27000; } CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); @@ -2853,9 +2856,9 @@ cAudioManager::ProcessEngineDamage(cVehicleParams& params) SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2895,15 +2898,15 @@ cAudioManager::ProcessCarBombTick(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_COUNTDOWN; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COUNTDOWN); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -2968,9 +2971,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) else m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); break; } @@ -3008,9 +3011,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) else m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); break; } @@ -3022,9 +3025,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = 68; emittingVol = m_anRandomTable[1] % 30 + 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; } break; case SOUND_CAR_JUMP: case SOUND_CAR_JUMP_2: { @@ -3050,9 +3053,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); if (params.m_VehicleType == VEHICLE_TYPE_BIKE) m_sQueueSample.m_nFrequency *= 2; - m_sQueueSample.m_nReleasingVolumeModificator = 6; + m_sQueueSample.m_nPriority = 6; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; break; } case SOUND_CAR_TYRE_POP: { @@ -3065,9 +3068,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) WheelIndex = 91; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TYRE_BURST); m_sQueueSample.m_nFrequency += RandomDisplacement(2000); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 10 + 117; break; @@ -3083,9 +3086,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 33; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_STARTER); - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); break; } @@ -3096,9 +3099,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = 37; m_sQueueSample.m_nFrequency = 9 * SampleManager.GetSampleBaseFrequency(SFX_GLASS_SHARD_1) / 10; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 10 + 30; break; @@ -3114,9 +3117,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 51; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[0] % 15 + 55; break; @@ -3127,10 +3130,10 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 86; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SUSPENSION_SLOW_MOVE_LOOP); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_nFramesToPlay = 7; noReflections = TRUE; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[0] % 15 + 55; @@ -3143,9 +3146,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = 87; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SHAG_SUSPENSION); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[1] % 15 + 55; break; @@ -3165,9 +3168,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) if (WaveIndex > 46) WaveIndex = 41; m_sQueueSample.m_nFrequency = (7000.0f * relVol) + 6000; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; emittingVol = (35.0f * relVol); maxDist = SQR(SOUND_INTENSITY); break; @@ -3178,7 +3181,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 47; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_BOAT_THUMB_OFF) + RandomDisplacement(600); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; emittingVol = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; @@ -3193,9 +3196,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 59; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 11025; - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 5.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[1] % 20 + 70; break; @@ -3210,10 +3213,10 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 79; m_sQueueSample.m_nFrequency = (3000.0f * vol * 625.0f / 24.0f) + 9000; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_nFramesToPlay = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; emittingVol = (37.0f * vol * 625.0f / 24.0f) + 90; maxDist = SQR(SOUND_INTENSITY); noReflections = TRUE; @@ -3225,9 +3228,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 80; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BOMB_BEEP); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); SET_SOUND_REFLECTION(TRUE); emittingVol = 60; @@ -3239,9 +3242,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 81; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_LAND_WHEELS); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 25 + 75; break; @@ -3261,9 +3264,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) HeliIndex = 89; m_sQueueSample.m_nFrequency = (8000.0f * relVol) + 16000; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; break; } case SOUND_WEAPON_SHOT_FIRED: { @@ -3308,9 +3311,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) GunIndex = 53; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_M60_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -3362,9 +3365,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_UZI_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); #endif - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); break; } @@ -3378,9 +3381,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = 34; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[3] % 20 + 90; break; @@ -3394,9 +3397,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 36; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARM_BOMB); - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REFLECTION(TRUE); emittingVol = 50; maxDist = SQR(SOUND_INTENSITY); @@ -3434,9 +3437,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 15; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 16000; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); SET_SOUND_REFLECTION(TRUE); emittingVol = m_anRandomTable[4] % 20 + 90; @@ -3449,9 +3452,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 48; m_sQueueSample.m_nFrequency = RandomDisplacement(6000) + 16000; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; ++CrunchOffset; maxDist = SQR(SOUND_INTENSITY); emittingVol = m_anRandomTable[4] % 20 + 55; @@ -3471,9 +3474,9 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) m_sQueueSample.m_nCounter = 50; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; maxDist = SQR(SOUND_INTENSITY); break; } @@ -3482,22 +3485,22 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) } if (params.m_fDistance < maxDist) { CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { if (noReflections) { m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; } else { m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; } SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_EMITTING_VOLUME(emittingVol); SET_SOUND_REVERB(TRUE); if (stereo) { - if(m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) { + if(m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_MaxDistance) { m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nOffset = 0; + m_sQueueSample.m_nPan = 0; } else { stereo = FALSE; m_sQueueSample.m_bIs2D = FALSE; @@ -3505,7 +3508,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) } else m_sQueueSample.m_bIs2D = FALSE; AddSampleToRequestedQueue(); if (stereo) { - m_sQueueSample.m_nOffset = 127; + m_sQueueSample.m_nPan = 127; m_sQueueSample.m_nSampleIndex++; m_sQueueSample.m_nCounter = GunIndex++; if (GunIndex > 58) @@ -3545,15 +3548,15 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_TRAIN; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3567,15 +3570,15 @@ cAudioManager::ProcessTrainNoise(cVehicleParams& params) // m_sQueueSample.m_nSampleIndex = SFX_TRAIN_NEAR; // m_sQueueSample.m_nBankIndex = SFX_BANK_0; // m_sQueueSample.m_bIs2D = FALSE; - // m_sQueueSample.m_nReleasingVolumeModificator = 5; + // m_sQueueSample.m_nPriority = 5; // m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TRAIN_NEAR) + 100 * m_sQueueSample.m_nEntityIndex % 987; // m_sQueueSample.m_nLoopCount = 0; // SET_EMITTING_VOLUME(emittingVol); // SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) // m_sQueueSample.m_fSpeedMultiplier = 6.0f; - // m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - // m_sQueueSample.m_bReleasingSoundFlag = FALSE; - // m_sQueueSample.m_nReleasingVolumeDivider = 3; + // m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + // m_sQueueSample.m_bStatic = FALSE; + // m_sQueueSample.m_nFramesToPlay = 3; // SET_SOUND_REVERB(TRUE); // SET_SOUND_REFLECTION(FALSE); // AddSampleToRequestedQueue(); @@ -3690,14 +3693,14 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_BOAT_CRUISER_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(Vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = intensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_MaxDistance = intensity; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 7; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3714,14 +3717,14 @@ cAudioManager::ProcessBoatEngine(cVehicleParams& params) m_sQueueSample.m_nFrequency += (m_sQueueSample.m_nEntityIndex * 65536) % 1000; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(80); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = intensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_MaxDistance = intensity; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 7; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3760,15 +3763,15 @@ cAudioManager::ProcessBoatMovingOverWater(cVehicleParams& params) m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_nFrequency = (6050.f * multiplier) + 16000; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(vol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = 50.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 6; + m_sQueueSample.m_MaxDistance = 50.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 6; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3927,15 +3930,15 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol) m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = GetJumboTaxiFreq(); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3958,15 +3961,15 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq) m_sQueueSample.m_nSampleIndex = SFX_JUMBO_WHINE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -3988,15 +3991,15 @@ cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq) m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = freq; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 4; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 4; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -4017,15 +4020,15 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) m_sQueueSample.m_nSampleIndex = SFX_JUMBO_DIST_FLY; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_DIST_FLY); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -4047,23 +4050,23 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol) m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_JUMBO_RUMBLE); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 12; - m_sQueueSample.m_nOffset = 0; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 12; + m_sQueueSample.m_nPan = 0; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); m_sQueueSample.m_nCounter = 6; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE; m_sQueueSample.m_nFrequency += 200; - m_sQueueSample.m_nOffset = 127; + m_sQueueSample.m_nPan = 127; AddSampleToRequestedQueue(); } return TRUE; @@ -4201,14 +4204,14 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) default: break; } - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 20.0f; + m_sQueueSample.m_MaxDistance = 20.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_FALL_LAND: @@ -4228,14 +4231,14 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 17); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_FIGHT_37: @@ -4325,16 +4328,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound; narrowSoundRange = TRUE; ++iSound; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 26 + 100; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_WEAPON_BAT_ATTACK: @@ -4380,16 +4383,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) } m_sQueueSample.m_nCounter = iSound++; narrowSoundRange = TRUE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 20 + 100; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; } @@ -4404,17 +4407,17 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) #endif m_sQueueSample.m_nCounter = 70; m_sQueueSample.m_nFrequency = 27000; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 50.0f; + m_sQueueSample.m_MaxDistance = 50.0f; maxDist = SQR(50); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_IDLE) SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; break; case SOUND_WEAPON_CHAINSAW_ATTACK: if (FindVehicleOfPlayer()) @@ -4427,17 +4430,17 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) #endif m_sQueueSample.m_nCounter = 68; m_sQueueSample.m_nFrequency = 27000; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_ATTACK) SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; break; case SOUND_WEAPON_CHAINSAW_MADECONTACT: if (FindVehicleOfPlayer()) @@ -4452,17 +4455,17 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) #endif m_sQueueSample.m_nCounter = 68; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 22000; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; emittingVol = 100; SET_LOOP_OFFSETS(SFX_CAR_CHAINSAW_ATTACK) SET_EMITTING_VOLUME(100); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 5; break; case SOUND_WEAPON_SHOT_FIRED: weapon = ped->GetWeapon(); @@ -4477,16 +4480,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ROCKET_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 80; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4497,16 +4500,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COLT45_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[1] % 10 + 90; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4517,16 +4520,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PYTHON_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4538,16 +4541,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SHOTGUN_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 10 + 100; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4558,16 +4561,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_SPAS12_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 10 + 100; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4577,16 +4580,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound++; narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 17000; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_UZI: @@ -4597,16 +4600,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_UZI_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_SILENCED_INGRAM: @@ -4615,16 +4618,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound++; narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 34000; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_MP5: @@ -4634,16 +4637,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_MP5_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 70; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_M4: @@ -4652,16 +4655,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound++; narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 43150; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 90; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_RUGER: @@ -4671,16 +4674,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_RUGER_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[3] % 15 + 90; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; case WEAPONTYPE_SNIPERRIFLE: @@ -4694,16 +4697,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) else m_sQueueSample.m_nFrequency = 20182; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 110; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); stereo = TRUE; break; @@ -4713,16 +4716,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = 9; emittingVol = 90; m_sQueueSample.m_nFrequency = (10 * m_sQueueSample.m_nEntityIndex & 2047) + SampleManager.GetSampleBaseFrequency(SFX_FLAMETHROWER_LEFT); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_EMITTING_VOLUME(90); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 6; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 6; stereo = TRUE; break; case WEAPONTYPE_M60: @@ -4733,16 +4736,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_M60_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; stereo = TRUE; break; default: @@ -4791,15 +4794,15 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency += RandomDisplacement(300); m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(75); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_WEAPON_AK47_BULLET_ECHO: @@ -4854,16 +4857,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) break; } m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 120.0f; + m_sQueueSample.m_MaxDistance = 120.0f; maxDist = SQR(120); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[4] % 10 + 80; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; } @@ -4873,16 +4876,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_FLAMETHROWER_START_LEFT); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; maxDist = SQR(60); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 70; SET_EMITTING_VOLUME(70); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; break; case SOUND_WEAPON_HIT_PED: m_sQueueSample.m_nSampleIndex = SFX_BULLET_PED; @@ -4891,16 +4894,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BULLET_PED); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 8); - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; maxDist = SQR(30); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[0] % 20 + 90; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; break; case SOUND_SPLASH: if (m_FrameCounter <= iSplashFrame) @@ -4911,16 +4914,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nCounter = iSound++; narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = RandomDisplacement(1400) + 20000; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 40.0f; + m_sQueueSample.m_MaxDistance = 40.0f; maxDist = SQR(40); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = m_anRandomTable[2] % 30 + 70; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_MELEE_ATTACK_START: @@ -4944,9 +4947,9 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) narrowSoundRange = TRUE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; if (weaponType == WEAPONTYPE_UNARMED || weaponType == WEAPONTYPE_BRASSKNUCKLE) emittingVol = m_anRandomTable[1] % 10 + 35; else @@ -4956,7 +4959,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) RESET_LOOP_OFFSETS SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; } @@ -4973,16 +4976,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nFrequency = m_anRandomTable[1] % 1000 + 17000; if (param2 == 0) m_sQueueSample.m_nFrequency = (3 * m_sQueueSample.m_nFrequency) / 4; - m_sQueueSample.m_nReleasingVolumeModificator = 6; + m_sQueueSample.m_nPriority = 6; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 20.0f; + m_sQueueSample.m_MaxDistance = 20.0f; maxDist = SQR(20); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = (m_anRandomTable[2] % 20 + 70) * param1 / 127; SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; } @@ -4991,50 +4994,50 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 68; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_MINIGUN_FIRE_LEFT); - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 150.0f; + m_sQueueSample.m_MaxDistance = 150.0f; emittingVol = 127; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(SFX_MINIGUN_FIRE_LEFT) SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; break; case SOUND_WEAPON_MINIGUN_2: m_sQueueSample.m_nSampleIndex = SFX_MINIGUN_FIRE_RIGHT; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 69; m_sQueueSample.m_nFrequency = 18569; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 150.0f; + m_sQueueSample.m_MaxDistance = 150.0f; emittingVol = 127.0f * m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(SFX_MINIGUN_FIRE_RIGHT) SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; break; case SOUND_WEAPON_MINIGUN_3: m_sQueueSample.m_nSampleIndex = SFX_MINIGUN_STOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 69; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_MINIGUN_STOP); - m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_nPriority = 4; m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = 150.0f; + m_sQueueSample.m_MaxDistance = 150.0f; maxDist = SQR(150); m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS emittingVol = 127; SET_EMITTING_VOLUME(127); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REFLECTION(TRUE); break; case SOUND_SHIRT_WIND_FLAP: @@ -5068,16 +5071,16 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nCounter = 71; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_SoundIntensity = 15.0f; + m_sQueueSample.m_MaxDistance = 15.0f; maxDist = SQR(15); m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_EMITTING_VOLUME(emittingVol); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; } } continue; @@ -5090,12 +5093,12 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) iSound = 21; if (params.m_fDistance < maxDist) { CalculateDistance(params.m_bDistanceCalculated, params.m_fDistance); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { if (stereo) { - if (m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_SoundIntensity) { + if (m_sQueueSample.m_fDistance < 0.2f * m_sQueueSample.m_MaxDistance) { m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nOffset = 0; + m_sQueueSample.m_nPan = 0; } else { stereo = FALSE; } @@ -5103,7 +5106,7 @@ cAudioManager::ProcessPedOneShots(cPedParams ¶ms) SET_SOUND_REVERB(TRUE); AddSampleToRequestedQueue(); if (stereo) { - m_sQueueSample.m_nOffset = 127; + m_sQueueSample.m_nPan = 127; ++m_sQueueSample.m_nSampleIndex; if (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i] != SOUND_WEAPON_SHOT_FIRED || weapon->m_eWeaponType != WEAPONTYPE_FLAMETHROWER) { @@ -8087,7 +8090,7 @@ cPedComments::Process() AudioManager.m_sQueueSample.m_nCounter = 0; AudioManager.m_sQueueSample.m_nSampleIndex = sampleIndex; AudioManager.m_sQueueSample.m_nBankIndex = SFX_BANK_PED_COMMENTS; - AudioManager.m_sQueueSample.m_nReleasingVolumeModificator = 3; + AudioManager.m_sQueueSample.m_nPriority = 3; AudioManager.m_sQueueSample.m_nVolume = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_nVolume; AudioManager.m_sQueueSample.m_fDistance = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_fDistance; AudioManager.m_sQueueSample.m_nLoopCount = 1; @@ -8103,20 +8106,20 @@ cPedComments::Process() #endif // FIX_BUGS #endif // EXTERNAL_3D_SOUND AudioManager.m_sQueueSample.m_fSpeedMultiplier = 3.0f; - AudioManager.m_sQueueSample.m_SoundIntensity = 40.0f; - AudioManager.m_sQueueSample.m_bReleasingSoundFlag = TRUE; + AudioManager.m_sQueueSample.m_MaxDistance = 40.0f; + AudioManager.m_sQueueSample.m_bStatic = TRUE; AudioManager.m_sQueueSample.m_vecPos = m_asPedComments[m_nActiveBank][m_nIndexMap[m_nActiveBank][0]].m_vecPos; #ifdef AUDIO_REVERB - AudioManager.m_sQueueSample.m_bReverbFlag = TRUE; + AudioManager.m_sQueueSample.m_bReverb = TRUE; #endif // AUDIO_REVERB #ifdef AUDIO_REFLECTIONS - AudioManager.m_sQueueSample.m_bRequireReflection = TRUE; + AudioManager.m_sQueueSample.m_bReflections = TRUE; #endif // AUDIO_REFLECTIONS AudioManager.m_sQueueSample.m_bIs2D = FALSE; #ifdef FIX_BUGS if (sampleIndex >= SFX_TONI_ANGRY_BUSTED_01 && sampleIndex <= SFX_TONI_WISECRACKING_SHOOT_26) { // check if player sfx AudioManager.m_sQueueSample.m_bIs2D = TRUE; - AudioManager.m_sQueueSample.m_nOffset = 63; + AudioManager.m_sQueueSample.m_nPan = 63; } #endif // FIX_BUGS AudioManager.m_sQueueSample.m_nFrequency = @@ -8181,37 +8184,37 @@ cAudioManager::ProcessExplosions(int32 explosion) case EXPLOSION_ROCKET: case EXPLOSION_BARREL: case EXPLOSION_TANK_GRENADE: - m_sQueueSample.m_SoundIntensity = 200.0f; + m_sQueueSample.m_MaxDistance = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_2; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nBankIndex = SFX_BANK_0; SET_SOUND_REFLECTION(TRUE); break; case EXPLOSION_MOLOTOV: - m_sQueueSample.m_SoundIntensity = 150.0f; + m_sQueueSample.m_MaxDistance = 150.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_3; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19000; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nBankIndex = SFX_BANK_0; SET_SOUND_REFLECTION(FALSE); break; case EXPLOSION_MINE: case EXPLOSION_HELI_BOMB: - m_sQueueSample.m_SoundIntensity = 200.0f; + m_sQueueSample.m_MaxDistance = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_ROCKET_LEFT; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 12347; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nBankIndex = SFX_BANK_0; SET_SOUND_REFLECTION(TRUE); break; default: - m_sQueueSample.m_SoundIntensity = 200.0f; + m_sQueueSample.m_MaxDistance = 200.0f; m_sQueueSample.m_nSampleIndex = SFX_EXPLOSION_1; m_sQueueSample.m_nFrequency = RandomDisplacement(1000) + 19500; if (type == EXPLOSION_HELI) m_sQueueSample.m_nFrequency = 8 * m_sQueueSample.m_nFrequency / 10; //same *= 8 / 10; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_nBankIndex = SFX_BANK_GENERIC_EXTRA; #ifdef FIX_BUGS SET_SOUND_REFLECTION(TRUE); @@ -8220,15 +8223,15 @@ cAudioManager::ProcessExplosions(int32 explosion) } m_sQueueSample.m_vecPos = *CExplosion::GetExplosionPosition(i); distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_MaxDistance)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(MAX_VOLUME, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS SET_SOUND_REVERB(TRUE); @@ -8252,49 +8255,49 @@ cAudioManager::ProcessFires(int32) if (entity) { switch (entity->GetType()) { case ENTITY_TYPE_BUILDING: - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; emittingVol = 100; m_sQueueSample.m_nFrequency = 8 * SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE) / 10; m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64); - m_sQueueSample.m_nReleasingVolumeModificator = 6; + m_sQueueSample.m_nPriority = 6; break; case ENTITY_TYPE_PED: - m_sQueueSample.m_SoundIntensity = 25.0f; + m_sQueueSample.m_MaxDistance = 25.0f; m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PED_ON_FIRE); emittingVol = 60; m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64); - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; break; default: - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64); emittingVol = 80; - m_sQueueSample.m_nReleasingVolumeModificator = 8; + m_sQueueSample.m_nPriority = 8; } } else { - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_CAR_ON_FIRE; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_ON_FIRE); emittingVol = 80; - m_sQueueSample.m_nReleasingVolumeModificator = 8; + m_sQueueSample.m_nPriority = 8; } m_sQueueSample.m_vecPos = gFireManager.m_aFires[i].m_vecPos; distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_MaxDistance)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 10; + m_sQueueSample.m_nFramesToPlay = 10; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_SOUND_REVERB(TRUE); @@ -8305,19 +8308,19 @@ cAudioManager::ProcessFires(int32) if (gFireManager.m_aFires[i].m_bExtinguishedWithWater) { gFireManager.m_aFires[i].m_bExtinguishedWithWater = FALSE; emittingVol = 100.0f * gFireManager.m_aFires[i].m_fWaterExtinguishCountdown; - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; m_sQueueSample.m_nFrequency = 19591; m_sQueueSample.m_nFrequency += i * (m_sQueueSample.m_nFrequency / 64); - m_sQueueSample.m_nReleasingVolumeModificator = 9; + m_sQueueSample.m_nPriority = 9; m_sQueueSample.m_nCounter = i + 40; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 10; + m_sQueueSample.m_nFramesToPlay = 10; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_SOUND_REVERB(TRUE); @@ -8342,17 +8345,17 @@ cAudioManager::ProcessWaterCannon(int32) m_sQueueSample.m_fDistance = Sqrt(distSquared); m_sQueueSample.m_nVolume = ComputeVolume(50, SOUND_INTENSITY, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 15591; - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_nCounter = i; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_nFramesToPlay = 8; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_EMITTING_VOLUME(50); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) SET_SOUND_REVERB(TRUE); @@ -8394,24 +8397,24 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) switch (sound) { case SCRIPT_SOUND_POLICE_CELL_DOOR_CLUNK: - m_sQueueSample.m_SoundIntensity = 40.0f; + m_sQueueSample.m_MaxDistance = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_COL_GATE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 10600; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; emittingVolume = 60; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); break; case SCRIPT_SOUND_GARAGE_DOOR_CLUNK: - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_PANEL_2; // huh? m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 22000; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_nPriority = 4; emittingVolume = 60; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; @@ -8421,23 +8424,23 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_BULLET_HIT_GROUND_1: case SCRIPT_SOUND_BULLET_HIT_GROUND_2: case SCRIPT_SOUND_BULLET_HIT_GROUND_3: - m_sQueueSample.m_SoundIntensity = 50.0f; + m_sQueueSample.m_MaxDistance = 50.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[iSound % 5] % 3 + SFX_BULLET_WALL_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); - m_sQueueSample.m_nReleasingVolumeModificator = 9; + m_sQueueSample.m_nPriority = 9; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; emittingVolume = m_anRandomTable[2] % 20 + 90; break; case SCRIPT_SOUND_WILLIE_CARD_SWIPE: emittingVolume = 70; - m_sQueueSample.m_SoundIntensity = 40.0f; + m_sQueueSample.m_MaxDistance = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_BOMB_BEEP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 20159; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 1.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(FALSE); @@ -8457,121 +8460,121 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) return; } case SCRIPT_SOUND_SEAPLANE_LOW_FUEL: - m_sQueueSample.m_SoundIntensity = 1000.0f; + m_sQueueSample.m_MaxDistance = 1000.0f; m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_LOW; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 100; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_CAR_HORN_JEEP); // BUG? - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = TRUE; SET_SOUND_REFLECTION(FALSE); break; //case SCRIPT_SOUND_PAYPHONE_RINGING: - // m_sQueueSample.m_SoundIntensity = 80.0f; + // m_sQueueSample.m_MaxDistance = 80.0f; // m_sQueueSample.m_nSampleIndex = SFX_PHONE_RING; // m_sQueueSample.m_nBankIndex = SFX_BANK_0; // emittingVolume = 80; // m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_PHONE_RING); - // m_sQueueSample.m_nReleasingVolumeModificator = 1; + // m_sQueueSample.m_nPriority = 1; // m_sQueueSample.m_fSpeedMultiplier = 2.0f; // m_sQueueSample.m_bIs2D = FALSE; // SET_SOUND_REFLECTION(FALSE); // break; case SCRIPT_SOUND_GLASS_BREAK_L: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 70; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_SMASH); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_GLASS_BREAK_S: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 60; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_SMASH); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_GLASS_CRACK: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 70; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); break; case SCRIPT_SOUND_GLASS_LIGHT_BREAK: - m_sQueueSample.m_SoundIntensity = 55.0f; + m_sQueueSample.m_MaxDistance = 55.0f; m_sQueueSample.m_nSampleIndex = (m_anRandomTable[4] & 3) + SFX_GLASS_SHARD_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(2000) + 19000; - m_sQueueSample.m_nReleasingVolumeModificator = 9; + m_sQueueSample.m_nPriority = 9; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; emittingVolume = RandomDisplacement(11) + 25; break; case SCRIPT_SOUND_BOX_DESTROYED_1: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_WOODEN_BOX_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); emittingVolume = m_anRandomTable[2] % 20 + 80; break; case SCRIPT_SOUND_BOX_DESTROYED_2: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_CARDBOARD_BOX_SMASH; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 18600; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); emittingVolume = m_anRandomTable[2] % 20 + 80; break; case SCRIPT_SOUND_METAL_COLLISION: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 5 + SFX_COL_CAR_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); emittingVolume = m_anRandomTable[2] % 30 + 70; break; case SCRIPT_SOUND_TIRE_COLLISION: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_TYRE_BUMP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); emittingVolume = m_anRandomTable[2] % 30 + 60; break; case SCRIPT_SOUND_HIT_BALL: - m_sQueueSample.m_SoundIntensity = 60.0f; + m_sQueueSample.m_MaxDistance = 60.0f; m_sQueueSample.m_nSampleIndex = SFX_HIT_BALL; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); - m_sQueueSample.m_nReleasingVolumeModificator = 5; + m_sQueueSample.m_nPriority = 5; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; SET_SOUND_REFLECTION(TRUE); @@ -8592,22 +8595,22 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SURFACE_SAND_BEACH: m_sQueueSample.m_nSampleIndex = SFX_BULLET_SHELL_HIT_GROUND_2; m_sQueueSample.m_nFrequency = RandomDisplacement(600) + 10600; - m_sQueueSample.m_nReleasingVolumeModificator = 18; + m_sQueueSample.m_nPriority = 18; break; case SURFACE_WATER: return; default: m_sQueueSample.m_nSampleIndex = SFX_BULLET_SHELL_HIT_GROUND_1; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 30000; - m_sQueueSample.m_nReleasingVolumeModificator = 15; + m_sQueueSample.m_nPriority = 15; break; } } else { m_sQueueSample.m_nSampleIndex = SFX_BULLET_SHELL_HIT_GROUND_1; m_sQueueSample.m_nFrequency = RandomDisplacement(1500) + 30000; - m_sQueueSample.m_nReleasingVolumeModificator = 15; + m_sQueueSample.m_nPriority = 15; } - m_sQueueSample.m_SoundIntensity = 20.0f; + m_sQueueSample.m_MaxDistance = 20.0f; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; @@ -8616,8 +8619,8 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) case SCRIPT_SOUND_GUNSHELL_DROP_SOFT: m_sQueueSample.m_nSampleIndex = SFX_BULLET_SHELL_HIT_GROUND_2; m_sQueueSample.m_nFrequency = RandomDisplacement(500) + 11000; - m_sQueueSample.m_nReleasingVolumeModificator = 18; - m_sQueueSample.m_SoundIntensity = 20.0f; + m_sQueueSample.m_nPriority = 18; + m_sQueueSample.m_MaxDistance = 20.0f; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_fSpeedMultiplier = 0.0f; m_sQueueSample.m_bIs2D = FALSE; @@ -8628,13 +8631,13 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) } distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_MaxDistance)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_EMITTING_VOLUME(emittingVolume); RESET_LOOP_OFFSETS SET_SOUND_REVERB(TRUE); @@ -8651,91 +8654,91 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) switch(sound) { case SCRIPT_SOUND_BANK_ALARM_LOOP: - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_BUILDINGS_BANK_ALARM; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BANK_ALARM; emittingVolume = 90; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BUILDINGS_BANK_ALARM); - m_sQueueSample.m_nReleasingVolumeModificator = 2; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nPriority = 2; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_POLICE_CELL_DOOR_SLIDING_LOOP: case SCRIPT_SOUND_GARAGE_DOOR_SLIDING_LOOP: - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_GARAGE_DOOR_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 90; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GARAGE_DOOR_LOOP); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_SNORING_LOOP: - m_sQueueSample.m_SoundIntensity = 6.0f; + m_sQueueSample.m_MaxDistance = 6.0f; m_sQueueSample.m_nSampleIndex = SFX_BUILDING_SNORE; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_SNORING; emittingVolume = 25; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BUILDING_SNORE); - m_sQueueSample.m_nReleasingVolumeModificator = 6; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nPriority = 6; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_SHOOTING_RANGE_TARGET_MOVING_LOOP: - m_sQueueSample.m_SoundIntensity = 40.0f; + m_sQueueSample.m_MaxDistance = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_TANK_TURRET; m_sQueueSample.m_nBankIndex = SFX_BANK_0; emittingVolume = 60; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_TANK_TURRET); - m_sQueueSample.m_nReleasingVolumeModificator = 4; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nPriority = 4; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_BUILDING_BAR_1: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_1; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_BUILDING_BAR_2: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_2; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_BUILDING_BAR_3: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_3; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_BUILDING_BAR_4: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_BAR_4; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_BAR_4; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8744,11 +8747,11 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_1; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_1); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8757,11 +8760,11 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_2; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_2); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8770,11 +8773,11 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_MAL3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_MALIBU_3; MusicManager.SetMalibuClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_MALIBU_3); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8783,11 +8786,11 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR1; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_1; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_1); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8796,11 +8799,11 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR2; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_2; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_2); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8809,33 +8812,33 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nSampleIndex = SFX_BUILDING_STR3; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_STRIP_3; MusicManager.SetStripClubTrackPos(SCRIPT_SOUND_NEW_BUILDING_STRIP_3); - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_BUILDING_CHURCH: m_sQueueSample.m_nSampleIndex = SFX_BUILDING_CHURCH; m_sQueueSample.m_nBankIndex = SFX_BANK_BUILDING_CHURCH; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; emittingVolume = 127; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_nReleasingVolumeDivider = 15; + m_sQueueSample.m_nPriority = 3; + m_sQueueSample.m_nFramesToPlay = 15; m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_bIs2D = FALSE; break; case SCRIPT_SOUND_NEW_WATERFALL: emittingVolume = 30; - m_sQueueSample.m_SoundIntensity = 80.0f; + m_sQueueSample.m_MaxDistance = 80.0f; m_sQueueSample.m_nSampleIndex = SFX_BOAT_WATER_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 20812; - m_sQueueSample.m_nReleasingVolumeModificator = 4; - m_sQueueSample.m_nReleasingVolumeDivider = 9; + m_sQueueSample.m_nPriority = 4; + m_sQueueSample.m_nFramesToPlay = 9; m_sQueueSample.m_fSpeedMultiplier = 2.0f; m_sQueueSample.m_bIs2D = FALSE; break; @@ -8843,14 +8846,14 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) } distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if(distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { + if(distSquared < SQR(m_sQueueSample.m_MaxDistance)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_EMITTING_VOLUME(emittingVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) @@ -8892,11 +8895,11 @@ cAudioManager::ProcessWeather(int32 id) if (iSound == 4) iSound = 0; m_sQueueSample.m_nCounter = iSound++; - m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_nOffset = (m_anRandomTable[2] & 15) + 55; + m_sQueueSample.m_nPriority = 0; + m_sQueueSample.m_nPan = (m_anRandomTable[2] & 15) + 55; m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS SET_SOUND_REVERB(FALSE); @@ -8909,12 +8912,12 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_nVolume = (uint8)(25.0f * CWeather::Rain); m_sQueueSample.m_nCounter = 4; m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nReleasingVolumeModificator = 0; - m_sQueueSample.m_nOffset = 63; + m_sQueueSample.m_nPriority = 0; + m_sQueueSample.m_nPan = 63; m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 30; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 30; SET_SOUND_REVERB(FALSE); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) @@ -8933,12 +8936,12 @@ cAudioManager::ProcessWeather(int32 id) m_sQueueSample.m_nVolume = (m_anRandomTable[1] % 10 + 45.0f) * (75.0f - CObject::fDistToNearestTree) * (4.0f / 300.0f) * wind; m_sQueueSample.m_nCounter = 5; m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nReleasingVolumeModificator = 1; - m_sQueueSample.m_nOffset = 63; + m_sQueueSample.m_nPriority = 1; + m_sQueueSample.m_nPan = 63; m_sQueueSample.m_bIs2D = TRUE; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 7; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 7; SET_SOUND_REVERB(FALSE); SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) @@ -9129,29 +9132,29 @@ cAudioManager::ProcessFrontEnd() // m_sQueueSample.m_nVolume = (CWeather::Wind - 1.0f) * m_sQueueSample.m_nVolume; m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; m_sQueueSample.m_nBankIndex = SFX_BANK_FRONT_END_MENU; - m_sQueueSample.m_nReleasingVolumeModificator = 0; + m_sQueueSample.m_nPriority = 0; m_sQueueSample.m_bIs2D = TRUE; SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); RESET_LOOP_OFFSETS if (stereo) { - m_sQueueSample.m_nOffset = 0; + m_sQueueSample.m_nPan = 0; m_sQueueSample.m_fDistance = 1.0f; } else { sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]; if (sample == SOUND_BULLETTRACE_1) { - m_sQueueSample.m_nOffset = 20; + m_sQueueSample.m_nPan = 20; m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; m_sQueueSample.m_fDistance = 100.0f; } else if (sample == SOUND_BULLETTRACE_2) { - m_sQueueSample.m_nOffset = 107; + m_sQueueSample.m_nPan = 107; m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; m_sQueueSample.m_fDistance = 100.0f; } else { - m_sQueueSample.m_nOffset = 63; + m_sQueueSample.m_nPan = 63; m_sQueueSample.m_fDistance = 1.0f; } } @@ -9161,13 +9164,13 @@ cAudioManager::ProcessFrontEnd() if (stereo) { ++m_sQueueSample.m_nSampleIndex; m_sQueueSample.m_nCounter = iSound++; - m_sQueueSample.m_nOffset = 127 - m_sQueueSample.m_nOffset; + m_sQueueSample.m_nPan = 127 - m_sQueueSample.m_nPan; AddSampleToRequestedQueue(); } if (center) { ++m_sQueueSample.m_nSampleIndex; m_sQueueSample.m_nCounter = iSound++; - m_sQueueSample.m_nOffset = 63; + m_sQueueSample.m_nPan = 63; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); AddSampleToRequestedQueue(); } @@ -9195,15 +9198,15 @@ cAudioManager::ProcessCrane() m_sQueueSample.m_nSampleIndex = SFX_CRANE_MAGNET; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 2; + m_sQueueSample.m_nPriority = 2; m_sQueueSample.m_nFrequency = 6000; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = intensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -9213,7 +9216,7 @@ cAudioManager::ProcessCrane() m_sQueueSample.m_nSampleIndex = SFX_COL_CAR_2; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_COL_CAR_2); m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(TRUE); AddSampleToRequestedQueue(); @@ -9235,45 +9238,45 @@ cAudioManager::ProcessProjectiles() switch (CProjectileInfo::GetProjectileInfo(i)->m_eWeaponType) { case WEAPONTYPE_TEARGAS: emittingVol = 80; - m_sQueueSample.m_SoundIntensity = 40.0f; + m_sQueueSample.m_MaxDistance = 40.0f; m_sQueueSample.m_nSampleIndex = SFX_PALM_TREE_LO; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 13879; - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; break; case WEAPONTYPE_MOLOTOV: emittingVol = 50; - m_sQueueSample.m_SoundIntensity = 30.0f; + m_sQueueSample.m_MaxDistance = 30.0f; m_sQueueSample.m_nSampleIndex = SFX_PED_ON_FIRE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = 32 * SampleManager.GetSampleBaseFrequency(SFX_PED_ON_FIRE) / 25; - m_sQueueSample.m_nReleasingVolumeModificator = 7; + m_sQueueSample.m_nPriority = 7; break; case WEAPONTYPE_ROCKET: emittingVol = 127; - m_sQueueSample.m_SoundIntensity = 90.0f; + m_sQueueSample.m_MaxDistance = 90.0f; m_sQueueSample.m_nSampleIndex = SFX_ROCKET_FLY; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ROCKET_FLY); - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; break; default: return; } m_sQueueSample.m_fSpeedMultiplier = 4.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_vecPos = CProjectileInfo::ms_apProjectile[i]->GetPosition(); distSquared = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distSquared < SQR(m_sQueueSample.m_SoundIntensity)) { + if (distSquared < SQR(m_sQueueSample.m_MaxDistance)) { m_sQueueSample.m_fDistance = Sqrt(distSquared); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVol, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(emittingVol); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -9303,17 +9306,17 @@ cAudioManager::ProcessEscalators() m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_nFramesToPlay = 5; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; m_sQueueSample.m_nCounter = i; m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(EMITTING_VOLUME); SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) SET_SOUND_REVERB(TRUE); - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); } @@ -9345,15 +9348,15 @@ cAudioManager::ProcessExtraSounds() // m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARCADE); // m_sQueueSample.m_bIs2D = FALSE; // m_sQueueSample.m_nLoopCount = 0; - // m_sQueueSample.m_bReleasingSoundFlag = FALSE; - // m_sQueueSample.m_nReleasingVolumeModificator = 4; + // m_sQueueSample.m_bStatic = FALSE; + // m_sQueueSample.m_nPriority = 4; // m_sQueueSample.m_fSpeedMultiplier = 3.0f; // SET_EMITTING_VOLUME(EMITTING_VOLUME); // SET_LOOP_OFFSETS(SFX_ARCADE) // SET_SOUND_REVERB(TRUE); - // m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + // m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; // SET_SOUND_REFLECTION(FALSE); - // m_sQueueSample.m_nReleasingVolumeDivider = 3; + // m_sQueueSample.m_nFramesToPlay = 3; // AddSampleToRequestedQueue(); // } // } @@ -9401,7 +9404,7 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex) / 2; m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 16); m_sQueueSample.m_nLoopCount = 1; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; m_sQueueSample.m_nCounter = iSound++; if (iSound < 32) iSound = 32; @@ -9412,8 +9415,8 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nCounter = i; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; + m_sQueueSample.m_bStatic = FALSE; } } else { m_sQueueSample.m_nSampleIndex = SFX_GARAGE_DOOR_LOOP; @@ -9421,17 +9424,17 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nCounter = i; m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nReleasingVolumeDivider = 3; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; + m_sQueueSample.m_bStatic = FALSE; } m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_nPriority = 3; SET_EMITTING_VOLUME(90); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REVERB(TRUE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -9458,13 +9461,13 @@ cAudioManager::ProcessGarages() m_sQueueSample.m_nFrequency = 18000; } m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_nPriority = 4; SET_EMITTING_VOLUME(60); m_sQueueSample.m_fSpeedMultiplier = 0.0f; - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; SET_SOUND_REVERB(TRUE); m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_bStatic = TRUE; m_sQueueSample.m_nLoopCount = 1; RESET_LOOP_OFFSETS m_sQueueSample.m_nCounter = iSound++; @@ -9497,7 +9500,7 @@ cAudioManager::ProcessFireHydrant() m_sQueueSample.m_nVolume = ComputeVolume(40, 35.0f, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > 0) { m_sQueueSample.m_nSampleIndex = SFX_JUMBO_TAXI; - m_sQueueSample.m_nReleasingVolumeModificator = 4; + m_sQueueSample.m_nPriority = 4; m_sQueueSample.m_nFrequency = 15591; m_sQueueSample.m_nCounter = 0; SET_EMITTING_VOLUME(40); @@ -9505,10 +9508,10 @@ cAudioManager::ProcessFireHydrant() m_sQueueSample.m_bIs2D = FALSE; m_sQueueSample.m_nLoopCount = 0; SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) - m_sQueueSample.m_SoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_MaxDistance = SOUND_INTENSITY; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REFLECTION(FALSE); - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nFramesToPlay = 3; m_sQueueSample.m_fSpeedMultiplier = 2.0f; AddSampleToRequestedQueue(); } @@ -9559,15 +9562,15 @@ cAudioManager::ProcessBridgeWarning() m_sQueueSample.m_nSampleIndex = SFX_BRIDGE_OPEN_WARNING; m_sQueueSample.m_nBankIndex = SAMPLEBANK_EXTRAS; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_BRIDGE_OPEN_WARNING); m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(100); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = 450.0f; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 8; + m_sQueueSample.m_MaxDistance = 450.0f; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 8; SET_SOUND_REVERB(FALSE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); @@ -9585,15 +9588,15 @@ cAudioManager::ProcessBridgeMotor() m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; // todo check sfx name m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = 5500; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(MAX_VOLUME); SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex) m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = bridgeIntensity; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_MaxDistance = bridgeIntensity; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REVERB(FALSE); AddSampleToRequestedQueue(); } @@ -9619,14 +9622,14 @@ cAudioManager::ProcessBridgeOneShots() m_sQueueSample.m_nCounter = 2; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nReleasingVolumeModificator = 1; + m_sQueueSample.m_nPriority = 1; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_nLoopCount = 1; SET_EMITTING_VOLUME(MAX_VOLUME); RESET_LOOP_OFFSETS m_sQueueSample.m_fSpeedMultiplier = 2.0f; - m_sQueueSample.m_SoundIntensity = bridgeIntensity; - m_sQueueSample.m_bReleasingSoundFlag = TRUE; + m_sQueueSample.m_MaxDistance = bridgeIntensity; + m_sQueueSample.m_bStatic = TRUE; SET_SOUND_REVERB(FALSE); SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 27a90446..79b1fb3e 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -20,7 +20,7 @@ cAudioManager AudioManager; cAudioManager::cAudioManager() { m_bIsInitialised = FALSE; - m_bReverb = TRUE; + m_bIsSurround = TRUE; field_6 = 0; m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT; m_nTimeSpent = TIME_SPENT; @@ -42,7 +42,7 @@ cAudioManager::cAudioManager() } m_nAudioEntitiesTotal = 0; m_FrameCounter = 0; - m_bFifthFrameFlag = FALSE; + m_bReduceReleasingPriority = FALSE; m_bTimerJustReset = FALSE; m_nTimer = 0; } @@ -493,7 +493,7 @@ cAudioManager::ServiceSoundEffects() #ifdef FIX_BUGS if(CTimer::GetLogicalFramesPassed() != 0) #endif - m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0; + m_bReduceReleasingPriority = (m_FrameCounter++ % 5) == 0; if (m_nUserPause && !m_nPreviousUserPause) { for (int32 i = 0; i < NUM_CHANNELS_GENERIC; i++) SampleManager.StopChannel(i); @@ -520,7 +520,7 @@ cAudioManager::ServiceSoundEffects() } m_nActiveSampleQueue = m_nActiveSampleQueue == 1 ? 0 : 1; #ifdef AUDIO_REVERB - if(m_bReverb) ProcessReverb(); + if(m_bIsSurround) ProcessReverb(); #endif ProcessSpecial(); ClearRequestedQueue(); @@ -547,20 +547,20 @@ cAudioManager::ServiceSoundEffects() } uint8 -cAudioManager::ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) +cAudioManager::ComputeVolume(uint8 emittingVolume, float maxDistance, float distance) { - float newSoundIntensity; - float newEmittingVolume; + float minDistance; + uint8 newEmittingVolume; - if (soundIntensity <= 0.0f) + if (maxDistance <= 0.0f) return 0; - newSoundIntensity = soundIntensity / 5.0f; - if (newSoundIntensity > distance) + minDistance = maxDistance / 5.0f; + if (minDistance > distance) return emittingVolume; - newEmittingVolume = emittingVolume * SQR((soundIntensity - newSoundIntensity - (distance - newSoundIntensity)) - / (soundIntensity - newSoundIntensity)); + newEmittingVolume = emittingVolume * SQR((maxDistance - minDistance - (distance - minDistance)) + / (maxDistance - minDistance)); return Min(127, newEmittingVolume); } @@ -646,42 +646,42 @@ cAudioManager::InterrogateAudioEntities() void cAudioManager::AddSampleToRequestedQueue() { - uint32 calculatedVolume; + uint32 finalPriority; uint8 sampleIndex; #ifdef AUDIO_REFLECTIONS bool8 bReflections; #endif if (m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) { - calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * (MAX_VOLUME - m_sQueueSample.m_nVolume); + finalPriority = m_sQueueSample.m_nPriority * (MAX_VOLUME - m_sQueueSample.m_nVolume); sampleIndex = m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; if (sampleIndex >= m_nActiveSamples) { sampleIndex = m_abSampleQueueIndexTable[m_nActiveSampleQueue][m_nActiveSamples - 1]; - if (m_asSamples[m_nActiveSampleQueue][sampleIndex].m_nCalculatedVolume <= calculatedVolume) + if (m_asSamples[m_nActiveSampleQueue][sampleIndex].m_nFinalPriority <= finalPriority) return; } else { ++m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; } - m_sQueueSample.m_nCalculatedVolume = calculatedVolume; - m_sQueueSample.m_bLoopEnded = FALSE; + m_sQueueSample.m_nFinalPriority = finalPriority; + m_sQueueSample.m_bIsPlayingFinished = FALSE; #ifdef AUDIO_REFLECTIONS if (m_sQueueSample.m_bIs2D || CCullZones::InRoomForAudio()) { - m_sQueueSample.m_bRequireReflection = FALSE; - m_sQueueSample.m_nLoopsRemaining = 0; + m_sQueueSample.m_bReflections = FALSE; + m_sQueueSample.m_nReflectionDelay = 0; } if (m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount > 0) { - bReflections = m_sQueueSample.m_bRequireReflection; + bReflections = m_sQueueSample.m_bReflections; } else { bReflections = FALSE; - m_sQueueSample.m_nLoopsRemaining = 0; + m_sQueueSample.m_nReflectionDelay = 0; } - m_sQueueSample.m_bRequireReflection = FALSE; + m_sQueueSample.m_bReflections = FALSE; - if ( m_bReverb && m_sQueueSample.m_bIs2D ) - m_sQueueSample.m_nFrontRearOffset = 30; + if ( m_bIsSurround && m_sQueueSample.m_bIs2D ) + m_sQueueSample.m_nFrontRearPan = 30; #ifdef AUDIO_REVERB if (!m_bDynamicAcousticModelingStatus) - m_sQueueSample.m_bReverbFlag = FALSE; + m_sQueueSample.m_bReverb = FALSE; #endif #endif @@ -701,8 +701,8 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample) uint32 i = 0; if (sample > 0) { for (; i < sample; i++) { - if (m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]].m_nCalculatedVolume > - m_asSamples[m_nActiveSampleQueue][sample].m_nCalculatedVolume) + if (m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]].m_nFinalPriority > + m_asSamples[m_nActiveSampleQueue][sample].m_nFinalPriority) break; } if (i < sample) { @@ -734,7 +734,7 @@ cAudioManager::AddReflectionsToRequestedQueue() } else { emittingVolume = (9 * m_sQueueSample.m_nVolume) / 16; } - m_sQueueSample.m_SoundIntensity /= 2.f; + m_sQueueSample.m_MaxDistance /= 2.f; uint32 halfOldFreq = oldFreq >> 1; @@ -743,12 +743,12 @@ cAudioManager::AddReflectionsToRequestedQueue() m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 50.f / 8.f; reflectionDistance = m_afReflectionsDistances[i]; - if (reflectionDistance > 0.0f && reflectionDistance < 50.f && reflectionDistance < m_sQueueSample.m_SoundIntensity) { - m_sQueueSample.m_nLoopsRemaining = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 600.f / 1029.f) : (reflectionDistance * 300.f / 1029.f); - if (m_sQueueSample.m_nLoopsRemaining > 3) { + if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_MaxDistance) { + m_sQueueSample.m_nReflectionDelay = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 600.f / 1029.f) : (reflectionDistance * 300.f / 1029.f); + if (m_sQueueSample.m_nReflectionDelay > 3) { m_sQueueSample.m_fDistance = m_afReflectionsDistances[i]; SET_EMITTING_VOLUME(emittingVolume); - m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance); + m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_MaxDistance, m_sQueueSample.m_fDistance); if (m_sQueueSample.m_nVolume > emittingVolume / 16) { m_sQueueSample.m_nCounter = oldCounter + (i + 1) * 256; @@ -763,7 +763,7 @@ cAudioManager::AddReflectionsToRequestedQueue() m_sQueueSample.m_nFrequency += noise; } } - m_sQueueSample.m_nReleasingVolumeModificator += 20; + m_sQueueSample.m_nPriority += 20; m_sQueueSample.m_vecPos = m_avecReflectionsPos[i]; AddSampleToRequestedQueue(); } @@ -911,7 +911,7 @@ cAudioManager::AddReleasingSounds() for (int32 i = 0; i < m_SampleRequestQueuesStatus[queue]; i++) { tSound &sample = m_asSamples[queue][m_abSampleQueueIndexTable[queue][i]]; - if (sample.m_bLoopEnded) + if (sample.m_bIsPlayingFinished) continue; toProcess[i] = FALSE; @@ -924,32 +924,44 @@ cAudioManager::AddReleasingSounds() } if(!toProcess[i]) { #ifdef AUDIO_REFLECTIONS - if(sample.m_nCounter <= 255 || sample.m_nLoopsRemaining == 0) // check if not reflection + if(sample.m_nCounter <= 255 || sample.m_nReflectionDelay == 0) // check if not delayed reflection #endif { - if (sample.m_nReleasingVolumeDivider == 0) + if (sample.m_nFramesToPlay == 0) continue; if (sample.m_nLoopCount == 0) { if (sample.m_nVolumeChange == -1) { - sample.m_nVolumeChange = sample.m_nVolume / sample.m_nReleasingVolumeDivider; +#if defined(FIX_BUGS) && defined(EXTERNAL_3D_SOUND) + sample.m_nVolumeChange = sample.m_nEmittingVolume / sample.m_nFramesToPlay; +#else + sample.m_nVolumeChange = sample.m_nVolume / sample.m_nFramesToPlay; +#endif if (sample.m_nVolumeChange <= 0) sample.m_nVolumeChange = 1; } +#if defined(FIX_BUGS) && defined(EXTERNAL_3D_SOUND) + if (sample.m_nEmittingVolume <= sample.m_nVolumeChange) { +#else if (sample.m_nVolume <= sample.m_nVolumeChange) { - sample.m_nReleasingVolumeDivider = 0; +#endif + sample.m_nFramesToPlay = 0; continue; } +#if defined(FIX_BUGS) && defined(EXTERNAL_3D_SOUND) + sample.m_nEmittingVolume -= sample.m_nVolumeChange; +#else sample.m_nVolume -= sample.m_nVolumeChange; +#endif } #ifdef FIX_BUGS if(CTimer::GetLogicalFramesPassed() != 0) #endif - --sample.m_nReleasingVolumeDivider; - if (m_bFifthFrameFlag) { - if (sample.m_nReleasingVolumeModificator < 20) - ++sample.m_nReleasingVolumeModificator; + --sample.m_nFramesToPlay; + if (m_bReduceReleasingPriority) { + if (sample.m_nPriority < 20) + ++sample.m_nPriority; } - sample.m_bReleasingSoundFlag = FALSE; + sample.m_bStatic = FALSE; } memcpy(&m_sQueueSample, &sample, sizeof(tSound)); AddSampleToRequestedQueue(); @@ -981,8 +993,8 @@ cAudioManager::ProcessActiveQueues() bool8 missionState; for (int32 i = 0; i < m_nActiveSamples; i++) { - m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = FALSE; - m_asActiveSamples[i].m_bIsProcessed = FALSE; + m_asSamples[m_nActiveSampleQueue][i].m_bIsBeingPlayed = FALSE; + m_asActiveSamples[i].m_bIsBeingPlayed = FALSE; } for (int32 i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) { @@ -998,19 +1010,19 @@ cAudioManager::ProcessActiveQueues() flag = !(j & 1); if (flag && !SampleManager.GetChannelUsedFlag(j)) { - sample.m_bLoopEnded = TRUE; - m_asActiveSamples[j].m_bLoopEnded = TRUE; + sample.m_bIsPlayingFinished = TRUE; + m_asActiveSamples[j].m_bIsPlayingFinished = TRUE; m_asActiveSamples[j].m_nSampleIndex = NO_SAMPLE; m_asActiveSamples[j].m_nEntityIndex = AEHANDLE_NONE; continue; } - if (sample.m_nReleasingVolumeDivider == 0) - sample.m_nReleasingVolumeDivider = 1; + if (sample.m_nFramesToPlay == 0) + sample.m_nFramesToPlay = 1; } - sample.m_bIsProcessed = TRUE; - m_asActiveSamples[j].m_bIsProcessed = TRUE; + sample.m_bIsBeingPlayed = TRUE; + m_asActiveSamples[j].m_bIsBeingPlayed = TRUE; sample.m_nVolumeChange = -1; - if (!sample.m_bReleasingSoundFlag) { + if (!sample.m_bStatic) { if (sample.m_bIs2D) { #ifdef EXTERNAL_3D_SOUND emittingVol = m_bDoubleVolume ? 2 * Min(63, sample.m_nEmittingVolume) : sample.m_nEmittingVolume; @@ -1021,7 +1033,7 @@ cAudioManager::ProcessActiveQueues() #ifdef EXTERNAL_3D_SOUND SampleManager.SetChannelEmittingVolume(j, emittingVol); #else - SampleManager.SetChannelPan(j, sample.m_nOffset); + SampleManager.SetChannelPan(j, sample.m_nPan); SampleManager.SetChannelVolume(j, emittingVol); #endif } else { @@ -1068,26 +1080,26 @@ cAudioManager::ProcessActiveQueues() TranslateEntity(&sample.m_vecPos, &position); #ifdef EXTERNAL_3D_SOUND SampleManager.SetChannel3DPosition(j, position.x, position.y, position.z); - SampleManager.SetChannel3DDistances(j, sample.m_SoundIntensity, 0.25f * sample.m_SoundIntensity); + SampleManager.SetChannel3DDistances(j, sample.m_MaxDistance, 0.25f * sample.m_MaxDistance); #else - sample.m_nOffset = ComputePan(sample.m_fDistance, &position); - SampleManager.SetChannelPan(j, sample.m_nOffset); + sample.m_nPan = ComputePan(sample.m_fDistance, &position); + SampleManager.SetChannelPan(j, sample.m_nPan); #endif } #if !defined(GTA_PS2) || defined(AUDIO_REVERB) - SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag); + SampleManager.SetChannelReverbFlag(j, sample.m_bReverb); #endif break; //continue for i } - sample.m_bIsProcessed = FALSE; - m_asActiveSamples[j].m_bIsProcessed = FALSE; + sample.m_bIsBeingPlayed = FALSE; + m_asActiveSamples[j].m_bIsBeingPlayed = FALSE; //continue for j } } } } for (int32 i = 0; i < m_nActiveSamples; i++) { - if (m_asActiveSamples[i].m_nSampleIndex != NO_SAMPLE && !m_asActiveSamples[i].m_bIsProcessed) { + if (m_asActiveSamples[i].m_nSampleIndex != NO_SAMPLE && !m_asActiveSamples[i].m_bIsBeingPlayed) { SampleManager.StopChannel(i); m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE; m_asActiveSamples[i].m_nEntityIndex = AEHANDLE_NONE; @@ -1095,29 +1107,29 @@ cAudioManager::ProcessActiveQueues() } for (uint8 i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; i++) { tSound &sample = m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]]; - if (!sample.m_bIsProcessed && !sample.m_bLoopEnded && m_asAudioEntities[sample.m_nEntityIndex].m_bIsUsed && sample.m_nSampleIndex < NO_SAMPLE) { + if (!sample.m_bIsBeingPlayed && !sample.m_bIsPlayingFinished && m_asAudioEntities[sample.m_nEntityIndex].m_bIsUsed && sample.m_nSampleIndex < NO_SAMPLE) { #ifdef AUDIO_REFLECTIONS - if (sample.m_nCounter > 255 && sample.m_nLoopCount > 0 && sample.m_nLoopsRemaining > 0) { // check if reflection - sample.m_nLoopsRemaining--; - sample.m_nReleasingVolumeDivider = 1; + if (sample.m_nCounter > 255 && sample.m_nLoopCount > 0 && sample.m_nReflectionDelay > 0) { // check if reflection + sample.m_nReflectionDelay--; + sample.m_nFramesToPlay = 1; } else #endif { for (uint8 j = 0; j < m_nActiveSamples; j++) { uint8 k = (j + field_6) % m_nActiveSamples; - if (!m_asActiveSamples[k].m_bIsProcessed) { + if (!m_asActiveSamples[k].m_bIsBeingPlayed) { if (sample.m_nLoopCount > 0) { samplesPerFrame = sample.m_nFrequency / m_nTimeSpent; samplesToPlay = sample.m_nLoopCount * SampleManager.GetSampleLength(sample.m_nSampleIndex); if (samplesPerFrame == 0) continue; - sample.m_nReleasingVolumeDivider = samplesToPlay / samplesPerFrame + 1; + sample.m_nFramesToPlay = samplesToPlay / samplesPerFrame + 1; } memcpy(&m_asActiveSamples[k], &sample, sizeof(tSound)); if (!m_asActiveSamples[k].m_bIs2D) { TranslateEntity(&m_asActiveSamples[k].m_vecPos, &position); #ifndef EXTERNAL_3D_SOUND - m_asActiveSamples[j].m_nOffset = ComputePan(m_asActiveSamples[j].m_fDistance, &position); + m_asActiveSamples[j].m_nPan = ComputePan(m_asActiveSamples[j].m_fDistance, &position); #endif } #ifdef EXTERNAL_3D_SOUND @@ -1150,18 +1162,18 @@ cAudioManager::ProcessActiveQueues() SampleManager.SetChannelEmittingVolume(k, vol); #else SampleManager.SetChannelVolume(j, emittingVol); - SampleManager.SetChannelPan(j, m_asActiveSamples[j].m_nOffset); + SampleManager.SetChannelPan(j, m_asActiveSamples[j].m_nPan); #endif #ifndef GTA_PS2 SampleManager.SetChannelLoopPoints(k, m_asActiveSamples[k].m_nLoopStart, m_asActiveSamples[k].m_nLoopEnd); SampleManager.SetChannelLoopCount(k, m_asActiveSamples[k].m_nLoopCount); #endif #if !defined(GTA_PS2) || defined(AUDIO_REVERB) - SampleManager.SetChannelReverbFlag(k, m_asActiveSamples[k].m_bReverbFlag); + SampleManager.SetChannelReverbFlag(k, m_asActiveSamples[k].m_bReverb); #endif #ifdef EXTERNAL_3D_SOUND if (m_asActiveSamples[k].m_bIs2D) { - uint8 offset = m_asActiveSamples[k].m_nOffset; + uint8 offset = m_asActiveSamples[k].m_nPan; if (offset == 63) x = 0.0f; else if (offset >= 63) @@ -1171,19 +1183,19 @@ cAudioManager::ProcessActiveQueues() usedX = x; usedY = 0.0f; usedZ = 0.0f; - m_asActiveSamples[k].m_SoundIntensity = 100000.0f; + m_asActiveSamples[k].m_MaxDistance = 100000.0f; } else { usedX = position.x; usedY = position.y; usedZ = position.z; } SampleManager.SetChannel3DPosition(k, usedX, usedY, usedZ); - SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_SoundIntensity, 0.25f * m_asActiveSamples[k].m_SoundIntensity); + SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_MaxDistance, 0.25f * m_asActiveSamples[k].m_MaxDistance); #endif SampleManager.StartChannel(k); } - m_asActiveSamples[k].m_bIsProcessed = TRUE; - sample.m_bIsProcessed = TRUE; + m_asActiveSamples[k].m_bIsBeingPlayed = TRUE; + sample.m_bIsBeingPlayed = TRUE; sample.m_nVolumeChange = -1; break; } @@ -1212,34 +1224,34 @@ cAudioManager::ClearActiveSamples() m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE; m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK; m_asActiveSamples[i].m_bIs2D = FALSE; - m_asActiveSamples[i].m_nReleasingVolumeModificator = 5; + m_asActiveSamples[i].m_nPriority = 5; m_asActiveSamples[i].m_nFrequency = 0; m_asActiveSamples[i].m_nVolume = 0; #ifdef EXTERNAL_3D_SOUND m_asActiveSamples[i].m_nEmittingVolume = 0; #endif m_asActiveSamples[i].m_fDistance = 0.0f; - m_asActiveSamples[i].m_bIsProcessed = FALSE; - m_asActiveSamples[i].m_bLoopEnded = FALSE; + m_asActiveSamples[i].m_bIsBeingPlayed = FALSE; + m_asActiveSamples[i].m_bIsPlayingFinished = FALSE; m_asActiveSamples[i].m_nLoopCount = 1; #ifndef GTA_PS2 m_asActiveSamples[i].m_nLoopStart = 0; m_asActiveSamples[i].m_nLoopEnd = -1; #endif m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f; - m_asActiveSamples[i].m_SoundIntensity = 200.0f; - m_asActiveSamples[i].m_nOffset = 63; - m_asActiveSamples[i].m_bReleasingSoundFlag = FALSE; - m_asActiveSamples[i].m_nCalculatedVolume = 0; - m_asActiveSamples[i].m_nReleasingVolumeDivider = 0; + m_asActiveSamples[i].m_MaxDistance = 200.0f; + m_asActiveSamples[i].m_nPan = 63; + m_asActiveSamples[i].m_bStatic = FALSE; + m_asActiveSamples[i].m_nFinalPriority = 0; + m_asActiveSamples[i].m_nFramesToPlay = 0; m_asActiveSamples[i].m_nVolumeChange = -1; m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f); #ifdef AUDIO_REVERB - m_asActiveSamples[i].m_bReverbFlag = FALSE; + m_asActiveSamples[i].m_bReverb = FALSE; #endif // AUDIO_REVERB #ifdef AUDIO_REFLECTIONS - m_asActiveSamples[i].m_nLoopsRemaining = 0; - m_asActiveSamples[i].m_bRequireReflection = FALSE; + m_asActiveSamples[i].m_nReflectionDelay = 0; + m_asActiveSamples[i].m_bReflections = FALSE; #endif // AUDIO_REFLECTIONS } } @@ -1267,17 +1279,17 @@ cAudioManager::AdjustSamplesVolume() tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]]; if (!pSample->m_bIs2D) - pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_SoundIntensity, pSample->m_fDistance); + pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_MaxDistance, pSample->m_fDistance); } } uint8 -cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist) +cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float distance) { - float quatIntensity = intensity / 4.0f; - float diffIntensity = intensity - quatIntensity; - if (dist > diffIntensity) - return (quatIntensity - (dist - diffIntensity)) * (float)emittingVolume / quatIntensity; + float minDistance = maxDistance / 4.0f; + float diffDistance = maxDistance - minDistance; + if (distance > diffDistance) + return (minDistance - (distance - diffDistance)) * (float)emittingVolume / minDistance; return emittingVolume; } #endif diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 17ef9ef0..a3e351dd 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -9,41 +9,49 @@ class tSound { public: - int32 m_nEntityIndex; - uint32 m_nCounter; - uint32 m_nSampleIndex; - uint8 m_nBankIndex; - bool8 m_bIs2D; - uint32 m_nReleasingVolumeModificator; - uint32 m_nFrequency; - uint8 m_nVolume; - float m_fDistance; - uint32 m_nLoopCount; + int32 m_nEntityIndex; // audio entity index + uint32 m_nCounter; // I'm not sure what this is but it looks like a virtual counter to determine the same sound in queue + // Values higher than 255 are used by reflections + uint32 m_nSampleIndex; // An index of sample from AudioSamples.h + uint8 m_nBankIndex; // A sound bank index. IDK what's the point of it here since samples are hardcoded anyway + bool8 m_bIs2D; // If TRUE then sound is played in 2D space (such as frontend or police radio) + uint32 m_nPriority; // The multiplier for the sound priority (see m_nFinalPriority below). Lesser value means higher priority + uint32 m_nFrequency; // Sound frequency, plain and simple + uint8 m_nVolume; // Sound volume (0..127), only used as an actual volume without EXTERNAL_3D_SOUND (see m_nEmittingVolume) + float m_fDistance; // Distance to camera (useless if m_bIs2D == TRUE) + uint32 m_nLoopCount; // 0 - always loop, 1 - don't loop, other values never seen #ifndef GTA_PS2 + // Loop offsets uint32 m_nLoopStart; int32 m_nLoopEnd; #endif #ifdef EXTERNAL_3D_SOUND - uint8 m_nEmittingVolume; + uint8 m_nEmittingVolume; // The volume in 3D space, provided to 3D audio engine #endif - float m_fSpeedMultiplier; - float m_SoundIntensity; - bool8 m_bReleasingSoundFlag; - CVector m_vecPos; + float m_fSpeedMultiplier; // Used for doppler effect. 0.0f - unaffected by doppler + float m_MaxDistance; // The maximum distance at which sound could be heard. Minimum distance = MaxDistance / 5 or MaxDistance / 4 in case of emitting volume (useless if m_bIs2D == TRUE) + bool8 m_bStatic; // If TRUE then sound parameters cannot be changed during playback (frequency, position, etc.) + CVector m_vecPos; // Position of sound in 3D space. Unused if m_bIs2D == TRUE #if !defined(GTA_PS2) || defined(AUDIO_REVERB) // GTA_PS2 because this field exists on mobile but not on PS2 - bool8 m_bReverbFlag; + bool8 m_bReverb; // Toggles reverb effect #endif #ifdef AUDIO_REFLECTIONS - uint8 m_nLoopsRemaining; - bool8 m_bRequireReflection; // Used for oneshots + uint8 m_nReflectionDelay; // Number of frames before reflection could be played. This is calculated internally by AudioManager and shouldn't be set by queued sample + bool8 m_bReflections; // Add sound reflections #endif - uint8 m_nOffset; - uint8 m_nFrontRearOffset; - uint32 m_nReleasingVolumeDivider; - bool8 m_bIsProcessed; - bool8 m_bLoopEnded; - uint32 m_nCalculatedVolume; - int8 m_nVolumeChange; + uint8 m_nPan; // Sound panning (0-127). Controls the volume of the playback coming from left and right speaker. Calculated internally unless m_bIs2D==TRUE. + // 0 = L 100% R 0% + // 63 = L 100% R 100% + // 127 = L 0% R 100% + uint8 m_nFrontRearPan; // Used on PS2 for surround panning + uint32 m_nFramesToPlay; // Number of frames the sound would be played (if it stops being queued). + // This one is being set by queued sample for looping sounds, otherwise calculated inside AudioManager + + // all fields below are internal to AudioManager calculations and aren't set by queued sample + bool8 m_bIsBeingPlayed; // Set to TRUE when the sound was added or changed on current frame to avoid it being overwritten + bool8 m_bIsPlayingFinished; // Not sure about the name. Set to TRUE when sampman channel becomes free + uint32 m_nFinalPriority; // Actual value used to compare priority, calculated using volume and m_nPriority. Lesser value means higher priority + int8 m_nVolumeChange; // How much m_nVolume should reduce per each frame. }; VALIDATE_SIZE(tSound, 96); @@ -227,8 +235,8 @@ class cAudioManager { public: bool8 m_bIsInitialised; - bool8 m_bReverb; // unused - bool8 m_bFifthFrameFlag; + bool8 m_bIsSurround; // used on PS2 + bool8 m_bReduceReleasingPriority; uint8 m_nActiveSamples; bool8 m_bDoubleVolume; // unused bool8 m_bDynamicAcousticModelingStatus; @@ -320,7 +328,7 @@ public: #endif void ServiceSoundEffects(); - uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance); + uint8 ComputeVolume(uint8 emittingVolume, float maxDistance, float distance); void TranslateEntity(Const CVector *v1, CVector *v2); int32 ComputeFrontRearMix(float, CVector *); int32 ComputePan(float, CVector *); @@ -342,7 +350,7 @@ public: #ifdef EXTERNAL_3D_SOUND // actually must have been && AUDIO_MSS as well void AdjustSamplesVolume(); // inlined - uint8 ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist); // inlined + uint8 ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float distance); // inlined #endif // audio logic @@ -623,12 +631,12 @@ public: #define SET_EMITTING_VOLUME(vol) #endif #ifdef AUDIO_REFLECTIONS -#define SET_SOUND_REFLECTION(b) m_sQueueSample.m_bRequireReflection = b +#define SET_SOUND_REFLECTION(b) m_sQueueSample.m_bReflections = b #else #define SET_SOUND_REFLECTION(b) #endif #ifdef AUDIO_REVERB -#define SET_SOUND_REVERB(b) m_sQueueSample.m_bReverbFlag = b +#define SET_SOUND_REVERB(b) m_sQueueSample.m_bReverb = b #else #define SET_SOUND_REVERB(b) #endif diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp index dd1724ab..f741a477 100644 --- a/src/audio/PolRadio.cpp +++ b/src/audio/PolRadio.cpp @@ -104,16 +104,16 @@ cAudioManager::DoPoliceRadioCrackle() m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE; m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_bIs2D = TRUE; - m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_nPriority = 10; m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15; m_sQueueSample.m_nLoopCount = 0; SET_EMITTING_VOLUME(m_sQueueSample.m_nVolume); SET_LOOP_OFFSETS(SFX_POLICE_RADIO_CRACKLE) - m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bStatic = FALSE; SET_SOUND_REVERB(FALSE); - m_sQueueSample.m_nOffset = 63; - m_sQueueSample.m_nReleasingVolumeDivider = 3; + m_sQueueSample.m_nPan = 63; + m_sQueueSample.m_nFramesToPlay = 3; SET_SOUND_REFLECTION(FALSE); AddSampleToRequestedQueue(); } diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index a3aec041..416f2aa0 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -135,7 +135,7 @@ CBoat::ProcessControl(void) m_fBuoyancy *= 0.99f; #ifdef FIX_BUGS - if(FindPlayerPed() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && GetModelIndex() == MI_PREDATOR){ + if(FindPlayerPed() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && GetModelIndex() == MI_PREDATOR && pDriver && IsPolicePedModel(pDriver->GetModelIndex())) { #else if(FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 && GetModelIndex() == MI_PREDATOR){ #endif |