safe before clean up

This commit is contained in:
Roman Masanin 2020-09-25 04:57:11 +03:00
parent f097b9c972
commit 4d1023ca30

View File

@ -3151,9 +3151,9 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
//173-243 //on height distance
if (volume != 0) {//!! if (volume != 0) {//!!
m_sQueueSample.m_nVolume = cAudioManager::ComputeVolume(volume, 250.0f, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(volume, 250.0f, m_sQueueSample.m_fDistance);
if (m_sQueueSample.m_nVolume != 0) { //!! if (m_sQueueSample.m_nVolume != 0) { //!!
m_sQueueSample.m_nCounter = 88; m_sQueueSample.m_nCounter = 88;
if (boat != nil) { //!! if (boat != nil) { //!!
@ -3242,13 +3242,67 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
} }
//sound from front of helicopter
m_sQueueSample.m_nVolume = ComputeVolume(volume_1, 140.0f, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(volume_1, 140.0f, m_sQueueSample.m_fDistance);
if (!m_sQueueSample.m_nVolume) { //!! if (m_sQueueSample.m_nVolume != 0) {
LABEL_105: m_sQueueSample.m_nCounter = 3; //347 andro
if (!boat && params->m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance >= 30.0f) { //!! if (hunterBool) { //!!
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_1;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freqModifier_2;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = volume_1;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_fSoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
} else if (boat) { //!!
m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO1;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = volume_1;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_fSoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
} else {
m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_MAI;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freqModifier_2;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = volume_1;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_fSoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
}
}
if (!boat && params->m_VehicleType != VEHICLE_TYPE_HELI && m_sQueueSample.m_fDistance < 30.0f) { //!!
//engine starting sound
if (automobile->bEngineOn) { if (automobile->bEngineOn) {
if (speedMultiplied >= 1.0f) { if (speedMultiplied < 1.0f) {
volume_5 = (1.0f - 0.5f * speedMultiplied) * 70.0f; volume_5 = (1.0f - 0.5f * speedMultiplied) * 70.0f;
m_sQueueSample.m_nVolume = ComputeVolume(volume_5, 30.0, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(volume_5, 30.0, m_sQueueSample.m_fDistance);
if (m_sQueueSample.m_nVolume) { if (m_sQueueSample.m_nVolume) {
@ -3280,7 +3334,9 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
} }
} }
} }
volume_4 = ((0.5 * vehCameraDot + 0.5) * volumeModifier * 127.0);
if (boat) { if (boat) {
if (accelerate <= 0 && brake <= 0) //!! if (accelerate <= 0 && brake <= 0) //!!
m_sQueueSample.m_nFrequency = 7143 + Min(1.0f, vehAtYAbs) * 1857; m_sQueueSample.m_nFrequency = 7143 + Min(1.0f, vehAtYAbs) * 1857;
@ -3293,18 +3349,11 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
m_sQueueSample.m_nFrequency = clamp(m_sQueueSample.m_nFrequency, freqPrev_1 - 98, freqPrev_1 + 98); m_sQueueSample.m_nFrequency = clamp(m_sQueueSample.m_nFrequency, freqPrev_1 - 98, freqPrev_1 + 98);
freqPrev_1 = m_sQueueSample.m_nFrequency; freqPrev_1 = m_sQueueSample.m_nFrequency;
} }
//after accel rotor sound
volume_4 = ((0.5 * vehCameraDot + 0.5) * volumeModifier * 127.0);
m_sQueueSample.m_nVolume = ComputeVolume(volume_4, 140.0, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(volume_4, 140.0, m_sQueueSample.m_fDistance);
if (!m_sQueueSample.m_nVolume) if (m_sQueueSample.m_nVolume != 0) {
goto LABEL_147;
m_sQueueSample.m_nCounter = 1; m_sQueueSample.m_nCounter = 1;
if (hunterBool) { if (hunterBool) {
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_2; m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_2;
m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nBankIndex = SFX_BANK_0;
@ -3330,10 +3379,14 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
LABEL_147: }
if (boat) { if (boat) {
//489-568 //489-568
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == 15 && m_sQueueSample.m_fDistance < 20.0 && speedMultiplied > 0.0) { //?? 525 andro if (TheCamera.Cams[TheCamera.ActiveCam].Mode == 15 && m_sQueueSample.m_fDistance < 20.0f && speedMultiplied > 0.0f) { //?? 525 andro
volume_3 = speedMultiplied * 100.0f; volume_3 = speedMultiplied * 100.0f;
m_sQueueSample.m_nVolume = ComputeVolume(volume_3, 20.0f, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(volume_3, 20.0f, m_sQueueSample.m_fDistance);
if (accelerate <= 0 && brake <= 0)//!! if (accelerate <= 0 && brake <= 0)//!!
@ -3364,7 +3417,7 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
} }
} }
} else { } else {
//573-645 //vacuum cleaner sound
posBackup = m_sQueueSample.m_vecPos; posBackup = m_sQueueSample.m_vecPos;
distCalcBool = params->m_bDistanceCalculated; distCalcBool = params->m_bDistanceCalculated;
distance_3 = params->m_fDistance; distance_3 = params->m_fDistance;
@ -3406,54 +3459,6 @@ void cAudioManager::ProcessCarHeli(cVehicleParams* params)
} }
cameraMatrix.~CMatrix(); cameraMatrix.~CMatrix();
return; return;
}
m_sQueueSample.m_nCounter = 3; //347 andro
if (hunterBool) { //!!
m_sQueueSample.m_nSampleIndex = SFX_HELI_APACHE_1;
} else {
if (boat) { //!!
m_sQueueSample.m_nSampleIndex = SFX_SEAPLANE_PRO1;
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = volume_1;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_fSoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
goto LABEL_105;
}
m_sQueueSample.m_nSampleIndex = 8;
}
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_nFrequency = (volumeModifier + 1) * 16000 + freqModifier_2;
m_sQueueSample.m_bIs2D = false;
m_sQueueSample.m_nReleasingVolumeModificator = 1;
m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = volume_1;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 6.0f;
m_sQueueSample.m_fSoundIntensity = 140.0f;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue();
goto LABEL_105;
} }
//TODO use it in ProcessVehicle //TODO use it in ProcessVehicle