diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-02-24 21:54:26 +0100 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-03-22 17:30:54 +0100 |
commit | 3b8a17747089f3e2e9f87158f42c575beb705feb (patch) | |
tree | 4c9407eb3298d0770e28cd50397d4f04d5ba2a0c /src | |
parent | Implement ProcessFires (diff) | |
download | re3-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 '')
-rw-r--r-- | src/audio/AudioManager.cpp | 30 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 22 |
2 files changed, 39 insertions, 13 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) diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index e4d2fa6d..24dfbce4 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -354,10 +354,10 @@ public: void ClearMissionAudio(); /// ok void ClearRequestedQueue(); /// ok int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, - float speedMultiplier) const; /// ok - int32 ComputePan(float, CVector *); /// ok + float speedMultiplier) const; /// ok + int32 ComputePan(float, CVector *); /// ok uint8 ComputeVolume(uint8 emittingVolume, float soundIntensity, float distance) const; /// ok - int32 CreateEntity(int32 type, void* entity); /// ok + int32 CreateEntity(int32 type, void *entity); /// ok void DestroyAllGameCreatedEntities(); /// ok void DestroyEntity(int32 id); /// ok @@ -535,7 +535,7 @@ public: void ProcessProjectiles(); /// ok void ProcessRainOnVehicle(cVehicleParams *params); /// ok void ProcessReverb() const; /// ok - bool ProcessReverseGear(cVehicleParams *a2); /// ok + bool ProcessReverseGear(cVehicleParams *params); /// ok void ProcessSawMillScriptObject(uint8 sound); /// ok void ProcessScriptObject(int32 id); /// ok void ProcessShopScriptObject(uint8 sound); /// ok @@ -558,12 +558,12 @@ public: int32 RandomDisplacement(uint32 seed) const; void ReacquireDigitalHandle() const; void ReleaseDigitalHandle() const; - void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, - float collisionPower, float intensity2); /// ok - void ReportCrime(int32 crime, const CVector *pos); /// ok - void ResetAudioLogicTimers(uint32 timer); /// ok - void ResetPoliceRadio(); /// ok - void ResetTimers(uint32 time); /// ok + void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, + float intensity2); /// ok + void ReportCrime(int32 crime, const CVector *pos); /// ok + void ResetAudioLogicTimers(uint32 timer); /// ok + void ResetPoliceRadio(); /// ok + void ResetTimers(uint32 time); /// ok void Service(); /// ok void ServiceCollisions(); /// ok @@ -585,7 +585,7 @@ public: void SetUpLoopingCollisionSound(cAudioCollision *col, uint8 counter); /// ok void SetUpOneShotCollisionSound(cAudioCollision *col); /// ok bool SetupCrimeReport(); /// ok - bool SetupJumboEngineSound(uint8 a2, int32 a3); // todo + bool SetupJumboEngineSound(uint8 vol, int32 freq); /// ok bool SetupJumboFlySound(uint8 emittingVol); /// ok bool SetupJumboRumbleSound(uint8 emittingVol); /// ok bool SetupJumboTaxiSound(uint8 vol); /// ok |