summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-02-24 21:54:26 +0100
committerFilip Gawin <filip.gawin@zoho.com>2020-03-22 17:30:54 +0100
commit3b8a17747089f3e2e9f87158f42c575beb705feb (patch)
tree4c9407eb3298d0770e28cd50397d4f04d5ba2a0c /src/audio/AudioManager.cpp
parentImplement ProcessFires (diff)
downloadre3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar.gz
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar.bz2
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar.lz
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar.xz
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.tar.zst
re3-3b8a17747089f3e2e9f87158f42c575beb705feb.zip
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp
index ab3745f5..6e65f28b 100644
--- a/src/audio/AudioManager.cpp
+++ b/src/audio/AudioManager.cpp
@@ -7922,8 +7922,34 @@ cAudioManager::SetSpeakerConfig(int32 conf) const
SampleManager.SetSpeakerConfig(conf);
}
-WRAPPER
-bool cAudioManager::SetupJumboEngineSound(uint8, int32) { EAXJMP(0x56F140); }
+bool
+cAudioManager::SetupJumboEngineSound(uint8 vol, int32 freq)
+{
+ if(m_sQueueSample.m_fDistance >= 180.f) return 0;
+
+ uint8 emittingVol = vol - gJumboVolOffsetPercentage % 50;
+ m_sQueueSample.m_bVolume = ComputeVolume(emittingVol, 180.f, m_sQueueSample.m_fDistance);
+ if(m_sQueueSample.m_bVolume) {
+ m_sQueueSample.m_counter = 3;
+ m_sQueueSample.m_nSampleIndex = SFX_JUMBO_ENGINE;
+ m_sQueueSample.m_bBankIndex = 0;
+ m_sQueueSample.m_bIsDistant = 0;
+ m_sQueueSample.field_16 = 1;
+ m_sQueueSample.m_nFrequency = freq;
+ m_sQueueSample.m_nLoopCount = 0;
+ m_sQueueSample.m_bEmittingVolume = emittingVol;
+ m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex);
+ m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
+ m_sQueueSample.field_48 = 4.0;
+ m_sQueueSample.m_fSoundIntensity = 180.0f;
+ m_sQueueSample.field_56 = 0;
+ m_sQueueSample.field_76 = 4;
+ m_sQueueSample.m_bReverbFlag = 1;
+ m_sQueueSample.m_bRequireReflection = 0;
+ AddSampleToRequestedQueue();
+ }
+ return true;
+}
bool
cAudioManager::SetupJumboFlySound(uint8 emittingVol)