diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-09-26 03:10:00 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-09-26 03:10:00 +0200 |
commit | a75ddd0d0ca4465f9b10305045b18dbecc76e504 (patch) | |
tree | 8e821a43c8b8a5c396a8ca66ac8909636d681bdc | |
parent | flat tyre and minimal refractoring (diff) | |
download | re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar.gz re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar.bz2 re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar.lz re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar.xz re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.tar.zst re3-a75ddd0d0ca4465f9b10305045b18dbecc76e504.zip |
-rw-r--r-- | src/audio/AudioLogic.cpp | 23 | ||||
-rw-r--r-- | src/vehicles/Automobile.cpp | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 3bc7f279..10e0c78b 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -2349,6 +2349,8 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) static uint8 GunIndex = 53; static uint8 iWheelIndex = 82; static uint8 CrunchOffset = 0; + static uint8 heliIndex = 0; + for (int i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) { noReflections = 0; @@ -2623,6 +2625,25 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params) emittingVol = m_anRandomTable[4] % 25 + 75; break; } + case SOUND_31:{ + const float SOUND_INTENSITY = 35.0f; + relVol = ((CAutomobile*)params->m_pVehicle)->m_aWheelSpeed[1] * 50.0f / 11.0f; + if (relVol < 0.2 || 1.0 == relVol) + continue; + relVol /= 20; + emittingVol = (1.0f - relVol) * 70.0f; + maxDist = SQR(SOUND_INTENSITY); + m_sQueueSample.m_nSampleIndex = SFX_CAR_HELI_ROT; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nCounter = heliIndex + 89; + heliIndex = heliIndex != 1 ? heliIndex + 1 : 0; + 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_fSpeedMultiplier = 0.0f; + m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + break; + } case SOUND_WEAPON_SHOT_FIRED: { const float SOUND_INTENSITY = 120.0f; emittingVol = m_anRandomTable[2]; @@ -3498,7 +3519,7 @@ cAudioManager::ProcessVehicleFlatTyre(cVehicleParams* params) if (automobile->Damage.GetWheelStatus(i) == 1 && automobile->m_aWheelTimer[i] > 0.0) someBool = true; if (!someBool) - //return; + return; break; case 5: bike = (CBike*)params->m_pVehicle; diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index eec44c35..0154ae05 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -1486,7 +1486,7 @@ CAutomobile::ProcessControl(void) CMatrix mat; mat.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_BONNET])); CVector blade = mat.GetRight(); - blade = GetMatrix() * blade; + blade = Multiply3x3(blade, GetMatrix()); camDist /= Max(Sqrt(distSq), 0.01f); if(Abs(DotProduct(camDist, blade)) > 0.95f){ DMAudio.PlayOneShot(m_audioEntityId, SOUND_31, 0.0f); |