summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-27 23:52:46 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-27 23:55:22 +0200
commit49ee711c7555ad4685829178e6fb6b4199a87d37 (patch)
tree85a93017ad7d79b1a9e90ad0b8e9990cbaf7fa33
parentAudioLogic type fixes and reordering (before peds) (diff)
downloadre3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar.gz
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar.bz2
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar.lz
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar.xz
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.tar.zst
re3-49ee711c7555ad4685829178e6fb6b4199a87d37.zip
-rw-r--r--src/audio/AudioLogic.cpp162
-rw-r--r--src/audio/AudioManager.h8
2 files changed, 85 insertions, 85 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 4423b826..a180b8b0 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -8118,83 +8118,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;
@@ -9113,6 +9036,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;
@@ -9784,7 +9784,7 @@ FindMissionAudioSfx(const char *name)
}
bool8
-cAudioManager::MissionScriptAudioUsesPoliceChannel(int32 soundMission) const
+cAudioManager::MissionScriptAudioUsesPoliceChannel(uint32 soundMission)
{
return FALSE;
}
@@ -9809,7 +9809,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];
@@ -9835,7 +9835,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;
@@ -9843,7 +9843,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 a3216e07..450a8818 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
@@ -389,7 +389,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);
@@ -410,7 +410,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);