From 6c2d179aadd9e54afc010c7f8b79d663017d168c Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 29 Jul 2021 10:16:51 +0300 Subject: Add define to enable/disable external 3d audio simulation --- src/audio/AudioLogic.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/audio/AudioLogic.cpp') diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index d4d1ed96..e9ce7777 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -1329,6 +1329,9 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile * AddPlayerCarSample(vol, freq, (engineSoundType - CAR_SFX_BANKS_OFFSET + SFX_CAR_REV_1), SFX_BANK_0, 2, TRUE); } else { TranslateEntity(&m_sQueueSample.m_vecPos, &pos); +#ifndef EXTERNAL_3D_SOUND + m_sQueueSample.m_nOffset = ComputePan(m_sQueueSample.m_fDistance, &pos); +#endif if (bAccelSampleStopped) { if (CurrentPretendGear != 1 || currentGear != 2) { gearNr = currentGear - 1; @@ -1356,9 +1359,15 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CAutomobile * SampleManager.SetChannelLoopPoints(CHANNEL_PLAYER_VEHICLE_ENGINE, 0, -1); } +#ifdef EXTERNAL_3D_SOUND SampleManager.SetChannelEmittingVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, 85); SampleManager.SetChannel3DPosition(CHANNEL_PLAYER_VEHICLE_ENGINE, pos.x, pos.y, pos.z); SampleManager.SetChannel3DDistances(CHANNEL_PLAYER_VEHICLE_ENGINE, 50.f, 12.5f); +#else + + SampleManager.SetChannelVolume(CHANNEL_PLAYER_VEHICLE_ENGINE, ComputeVolume(85, 50.0f, m_sQueueSample.m_fDistance)); + SampleManager.SetChannelPan(CHANNEL_PLAYER_VEHICLE_ENGINE, m_sQueueSample.m_nOffset); +#endif freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; if (engineSoundType == SFX_BANK_TRUCK) freq /= 2; -- cgit v1.2.3