diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-02-24 20:18:50 +0100 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-03-22 17:30:54 +0100 |
commit | 31382bc22cb945bcd9712a1865ac94f1d7cf3a7c (patch) | |
tree | eaf7d3d6d0df88cec785b6bcdd5f06cb9389a93b /src/audio | |
parent | Console (diff) | |
download | re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar.gz re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar.bz2 re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar.lz re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar.xz re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.tar.zst re3-31382bc22cb945bcd9712a1865ac94f1d7cf3a7c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioManager.cpp | 69 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 2 |
2 files changed, 67 insertions, 4 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index ff7babc4..7f7af157 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -3172,11 +3172,74 @@ cAudioManager::ProcessCarBombTick(cVehicleParams *params) return true; } -WRAPPER void -cAudioManager::ProcessCesna(void *) +cAudioManager::ProcessCesna(cVehicleParams *params) { - EAXJMP(0x56ADF0); + static uint8 nAccel = 0; + + //((CAutomobile *)params->m_pVehicle)->Damage.GetEngineStatus(); + + if(FindPlayerVehicle() == params->m_pVehicle) { + if(params->m_nIndex == DODO) { + if(Pads[0].GetAccelerate() <= 0) { + if(nAccel) --nAccel; + } else if(nAccel < 60) { + ++nAccel; + } + AddPlayerCarSample(85 * (60 - nAccel) / 60 + 20, 8500 * nAccel / 60 + 17000, SFX_CESNA_IDLE, 0, + 52, 1); + AddPlayerCarSample(85 * nAccel / 60 + 20, 8500 * nAccel / 60 + 17000, SFX_CESNA_REV, 0, 2, 1); + } + } else if(params->m_nIndex == DODO) { + AddPlayerCarSample(105, 17000, SFX_CESNA_IDLE, 0, 52, 1); + } else if(params->m_fDistance < 40000.f) { + CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); + m_sQueueSample.m_bVolume = ComputeVolume(80, 200.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_counter = 52; + m_sQueueSample.m_nSampleIndex = SFX_CESNA_IDLE; + m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_bIsDistant = 0; + m_sQueueSample.field_16 = 0; + m_sQueueSample.m_nFrequency = 12500; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.field_76 = 8; + m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nLoopStart = + SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.field_48 = 8.0; + m_sQueueSample.m_fSoundIntensity = 200.0f; + m_sQueueSample.field_56 = 0; + m_sQueueSample.m_bReverbFlag = 1; + m_sQueueSample.m_bRequireReflection = 0; + AddSampleToRequestedQueue(); + } + if(params->m_fDistance < 8100.f) { + m_sQueueSample.m_bVolume = ComputeVolume(80, 90.f, m_sQueueSample.m_fDistance); + if(m_sQueueSample.m_bVolume) { + m_sQueueSample.m_counter = 2; + m_sQueueSample.m_nSampleIndex = SFX_CESNA_REV; + m_sQueueSample.m_bBankIndex = 0; + m_sQueueSample.m_bIsDistant = 0; + m_sQueueSample.field_16 = 0; + m_sQueueSample.m_nFrequency = 25000; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.field_76 = 4; + m_sQueueSample.m_bEmittingVolume = 80; + m_sQueueSample.m_nLoopStart = + SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = + SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.field_48 = 8.0; + m_sQueueSample.m_fSoundIntensity = 90.0f; + m_sQueueSample.field_56 = 0; + m_sQueueSample.m_bReverbFlag = 1; + m_sQueueSample.m_bRequireReflection = 0; + AddSampleToRequestedQueue(); + } + } + } } void diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index bd34c800..5e533bff 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -498,7 +498,7 @@ public: void ProcessBridgeOneShots(); /// ok void ProcessBridgeWarning(); /// ok bool ProcessCarBombTick(cVehicleParams *params); /// ok - void ProcessCesna(void *); // todo requires CPlane + void ProcessCesna(cVehicleParams *params); /// ok void ProcessCinemaScriptObject(uint8 sound); /// ok void ProcessCrane(); // todo requires CCrane void ProcessDocksScriptObject(uint8 sound); /// ok |