summaryrefslogtreecommitdiff
path: root/src/audio/AudioLogic.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-29 10:16:51 +0300
committerSergeanur <s.anureev@yandex.ua>2021-08-12 11:39:34 +0300
commit6c2d179aadd9e54afc010c7f8b79d663017d168c (patch)
tree60190b4286698f4ff609d214fe9e423202891da2 /src/audio/AudioLogic.cpp
parent2eb0390dc934ba589b8c90360d02eef9fbba1b5e (diff)
Add define to enable/disable external 3d audio simulation
Diffstat (limited to 'src/audio/AudioLogic.cpp')
-rw-r--r--src/audio/AudioLogic.cpp9
1 files changed, 9 insertions, 0 deletions
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;