diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-07-27 23:56:42 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-07-27 23:56:42 +0200 |
commit | 98003d0d41c8355dff7f54708abfd228bd861116 (patch) | |
tree | bb6784476fd2e864fb9df9e609198e7be9ade8d9 | |
parent | Merge branch 'miami' into lcs (diff) | |
parent | AudioLogic type fixes and reordering (after peds) (diff) | |
download | re3-98003d0d41c8355dff7f54708abfd228bd861116.tar re3-98003d0d41c8355dff7f54708abfd228bd861116.tar.gz re3-98003d0d41c8355dff7f54708abfd228bd861116.tar.bz2 re3-98003d0d41c8355dff7f54708abfd228bd861116.tar.lz re3-98003d0d41c8355dff7f54708abfd228bd861116.tar.xz re3-98003d0d41c8355dff7f54708abfd228bd861116.tar.zst re3-98003d0d41c8355dff7f54708abfd228bd861116.zip |
-rw-r--r-- | src/audio/AudioLogic.cpp | 162 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 8 |
2 files changed, 85 insertions, 85 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 0a859518..c8dbe2ff 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -8131,83 +8131,6 @@ cAudioManager::ProcessWaterCannon(int32) } } -//positon of arcade machines -CVector aVecExtraSoundPosition[] = { CVector(-1042.546f, 88.794f, 11.324f), CVector(-1004.476f, 181.697f, 11.324f) }; - -void -cAudioManager::ProcessExtraSounds() -{ - //const float SOUND_INTENSITY = 18.0f; - //const uint8 EMITTING_VOLUME = 50; - - //float distance; - - //for (int i = 0; i < ARRAY_SIZE(aVecExtraSoundPosition); i++) { - // m_sQueueSample.m_vecPos = aVecExtraSoundPosition[i]; - // distance = GetDistanceSquared(m_sQueueSample.m_vecPos); - // if (distance < SQR(SOUND_INTENSITY)) { - // m_sQueueSample.m_fDistance = Sqrt(distance); - // m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - // if (m_sQueueSample.m_nVolume != 0) { - // m_sQueueSample.m_nCounter = i; - // m_sQueueSample.m_nSampleIndex = SFX_ARCADE; - // m_sQueueSample.m_nBankIndex = SFX_BANK_0; - // m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARCADE); - // m_sQueueSample.m_bIs2D = FALSE; - // m_sQueueSample.m_nLoopCount = 0; - // m_sQueueSample.m_bReleasingSoundFlag = FALSE; - // m_sQueueSample.m_nReleasingVolumeModificator = 4; - // m_sQueueSample.m_fSpeedMultiplier = 3.0f; - // m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; - // SET_LOOP_OFFSETS(SFX_ARCADE) - // m_sQueueSample.m_bReverbFlag = TRUE; - // m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - // m_sQueueSample.m_bRequireReflection = FALSE; - // m_sQueueSample.m_nReleasingVolumeDivider = 3; - // AddSampleToRequestedQueue(); - // } - // } - //} -} - -void -cAudioManager::ProcessEscalators() -{ - const float SOUND_INTENSITY = 30.0f; - const uint8 EMITTING_VOLUME = 26; - - float distance; - - for (int i = 0; i < CEscalators::NumEscalators; i++) { - if (!CEscalators::GetEscalator(i).IsActive()) - continue; - m_sQueueSample.m_vecPos = CEscalators::GetEscalator(i).GetPosition(); - distance = GetDistanceSquared(m_sQueueSample.m_vecPos); - if (distance < SQR(SOUND_INTENSITY)) { - m_sQueueSample.m_fDistance = Sqrt(distance); - m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); - if (m_sQueueSample.m_nVolume != 0) { - m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP; - m_sQueueSample.m_nBankIndex = SFX_BANK_0; - m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973; - m_sQueueSample.m_nReleasingVolumeModificator = 3; - m_sQueueSample.m_fSpeedMultiplier = 3.0f; - m_sQueueSample.m_nReleasingVolumeDivider = 5; - m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; - m_sQueueSample.m_nCounter = i; - m_sQueueSample.m_bIs2D = FALSE; - m_sQueueSample.m_nLoopCount = 0; - m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; - SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) - m_sQueueSample.m_bReverbFlag = TRUE; - m_sQueueSample.m_bReleasingSoundFlag = FALSE; - m_sQueueSample.m_bRequireReflection = FALSE; - AddSampleToRequestedQueue(); - } - } - } -} - #pragma region SCRIPT_OBJECTS const int SCRIPT_OBJECT_INTENSITY_S = 30; const int SCRIPT_OBJECT_INTENSITY_L = 80; @@ -9126,6 +9049,83 @@ cAudioManager::ProcessProjectiles() } void +cAudioManager::ProcessEscalators() +{ + const float SOUND_INTENSITY = 30.0f; + const uint8 EMITTING_VOLUME = 26; + + float distance; + + for (int i = 0; i < CEscalators::NumEscalators; i++) { + if (!CEscalators::GetEscalator(i).IsActive()) + continue; + m_sQueueSample.m_vecPos = CEscalators::GetEscalator(i).GetPosition(); + distance = GetDistanceSquared(m_sQueueSample.m_vecPos); + if (distance < SQR(SOUND_INTENSITY)) { + m_sQueueSample.m_fDistance = Sqrt(distance); + m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + if (m_sQueueSample.m_nVolume != 0) { + m_sQueueSample.m_nSampleIndex = SFX_BOAT_V12_LOOP; + m_sQueueSample.m_nBankIndex = SFX_BANK_0; + m_sQueueSample.m_nFrequency = i * 50 % 250 + 3973; + m_sQueueSample.m_nReleasingVolumeModificator = 3; + m_sQueueSample.m_fSpeedMultiplier = 3.0f; + m_sQueueSample.m_nReleasingVolumeDivider = 5; + m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_nCounter = i; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; + SET_LOOP_OFFSETS(SFX_BOAT_V12_LOOP) + m_sQueueSample.m_bReverbFlag = TRUE; + m_sQueueSample.m_bReleasingSoundFlag = FALSE; + m_sQueueSample.m_bRequireReflection = FALSE; + AddSampleToRequestedQueue(); + } + } + } +} + +//positon of arcade machines +CVector aVecExtraSoundPosition[] = { CVector(-1042.546f, 88.794f, 11.324f), CVector(-1004.476f, 181.697f, 11.324f) }; + +void +cAudioManager::ProcessExtraSounds() +{ + //const float SOUND_INTENSITY = 18.0f; + //const uint8 EMITTING_VOLUME = 50; + + //float distance; + + //for (int i = 0; i < ARRAY_SIZE(aVecExtraSoundPosition); i++) { + // m_sQueueSample.m_vecPos = aVecExtraSoundPosition[i]; + // distance = GetDistanceSquared(m_sQueueSample.m_vecPos); + // if (distance < SQR(SOUND_INTENSITY)) { + // m_sQueueSample.m_fDistance = Sqrt(distance); + // m_sQueueSample.m_nVolume = ComputeVolume(EMITTING_VOLUME, SOUND_INTENSITY, m_sQueueSample.m_fDistance); + // if (m_sQueueSample.m_nVolume != 0) { + // m_sQueueSample.m_nCounter = i; + // m_sQueueSample.m_nSampleIndex = SFX_ARCADE; + // m_sQueueSample.m_nBankIndex = SFX_BANK_0; + // m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_ARCADE); + // m_sQueueSample.m_bIs2D = FALSE; + // m_sQueueSample.m_nLoopCount = 0; + // m_sQueueSample.m_bReleasingSoundFlag = FALSE; + // m_sQueueSample.m_nReleasingVolumeModificator = 4; + // m_sQueueSample.m_fSpeedMultiplier = 3.0f; + // m_sQueueSample.m_nEmittingVolume = EMITTING_VOLUME; + // SET_LOOP_OFFSETS(SFX_ARCADE) + // m_sQueueSample.m_bReverbFlag = TRUE; + // m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + // m_sQueueSample.m_bRequireReflection = FALSE; + // m_sQueueSample.m_nReleasingVolumeDivider = 3; + // AddSampleToRequestedQueue(); + // } + // } + //} +} + +void cAudioManager::ProcessGarages() { const float SOUND_INTENSITY = 80.0f; @@ -11292,7 +11292,7 @@ FindMissionAudioSfx(const char *name) } bool8 -cAudioManager::MissionScriptAudioUsesPoliceChannel(int32 soundMission) const +cAudioManager::MissionScriptAudioUsesPoliceChannel(uint32 soundMission) { return FALSE; } @@ -11319,7 +11319,7 @@ cAudioManager::PreloadMissionAudio(uint8 slot, Const char *name) } uint8 -cAudioManager::GetMissionAudioLoadingStatus(uint8 slot) const +cAudioManager::GetMissionAudioLoadingStatus(uint8 slot) { if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) return m_sMissionAudio.m_nLoadingStatus[slot]; @@ -11345,7 +11345,7 @@ cAudioManager::PlayLoadedMissionAudio(uint8 slot) } bool8 -cAudioManager::ShouldDuckMissionAudio(uint8 slot) const +cAudioManager::ShouldDuckMissionAudio(uint8 slot) { //if (IsMissionAudioSamplePlaying(slot)) // return m_sMissionAudio.m_nSampleIndex[slot] != STREAMED_SOUND_MISSION_ROK2_01; @@ -11353,7 +11353,7 @@ cAudioManager::ShouldDuckMissionAudio(uint8 slot) const } bool8 -cAudioManager::IsMissionAudioSamplePlaying(uint8 slot) const +cAudioManager::IsMissionAudioSamplePlaying(uint8 slot) { if (m_bIsInitialised) { if (slot < MISSION_AUDIO_SLOTS) diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 480f39f9..2f89ea6a 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -255,8 +255,8 @@ public: float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; } - bool8 IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; } - bool8 ShouldDuckMissionAudio(uint8 slot) const; + bool8 IsMissionAudioSamplePlaying(uint8 slot); // { return m_sMissionAudio.m_nPlayStatus == 1; } + bool8 ShouldDuckMissionAudio(uint8 slot); // "Should" be in alphabetic order, except "getXTalkSfx" void AddDetailsToRequestedOrderList(uint8 sample); // inlined in vc @@ -392,7 +392,7 @@ public: float GetCollisionRatio(float a, float b, float c, float d); // inlined in vc float GetDistanceSquared(const CVector &v); // inlined in vc int32 GetJumboTaxiFreq(); // inlined in vc - uint8 GetMissionAudioLoadingStatus(uint8 slot) const; + uint8 GetMissionAudioLoadingStatus(uint8 slot); int8 GetMissionScriptPoliceAudioPlayingStatus(); uint8 GetNum3DProvidersAvailable(); uint32 GetPedCommentSfx(CPed *ped, int32 sound); @@ -413,7 +413,7 @@ public: void LoadBankIfNecessary(uint8 bank); // this is used only on PS2 but technically not a platform code - bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; + bool8 MissionScriptAudioUsesPoliceChannel(uint32 soundMission); void PlayLoadedMissionAudio(uint8 slot); void PlayOneShot(int32 index, uint16 sound, float vol); |